quadricMetric.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
11  cfMesh is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation; either version 3 of the License, or (at your
14  option) any later version.
15 
16  cfMesh is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  quadricMetric
26 
27 Description
28  Mesh smoothing using quadric metric. The metric is strictly convex
29 
30 SourceFiles
31  quadricMetric.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef quadricMetric_H
36 #define quadricMetric_H
37 
38 #include "simplexSmoother.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 // Forward declarations
46 class partTetMeshSimplex;
47 
48 /*---------------------------------------------------------------------------*\
49  Class quadricMetric Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class quadricMetric
53 :
54  public simplexSmoother
55 {
56  // Private data
57  //- free vertex
58  point& p_;
59 
60  //- normals of triangles forming the outer hull
62 
63  //- centres of triangles forming the outer hull
65 
66  // Private member functions
67  //- evaluate the value of the metric
68  scalar evaluateMetric() const;
69 
70  //- evaluate metric gradients
71  void evaluateGradients(vector& grad, tensor& gradGrad) const;
72 
73  public:
74 
75  // Constructor
77 
78  // Destructor
80 
81  // Member functions
82  //- find the best position such that all tets making a simplex
83  //- have a positive volume
84  void optimizeNodePosition(const scalar tol = 0.001);
85 };
86 
87 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
88 
89 } // End namespace Foam
90 
91 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
92 
93 #endif
94 
95 // ************************************************************************* //
Foam::Tensor
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
Definition: complexI.H:224
Foam::quadricMetric::p_
point & p_
free vertex
Definition: quadricMetric.H:57
Foam::fvc::grad
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
Definition: fvcGrad.C:52
Foam::partTetMeshSimplex
Definition: partTetMeshSimplex.H:52
Foam::quadricMetric::~quadricMetric
~quadricMetric()
Definition: quadricMetric.C:97
Foam::quadricMetric::centres_
DynList< point, 64 > centres_
centres of triangles forming the outer hull
Definition: quadricMetric.H:63
Foam::quadricMetric::evaluateMetric
scalar evaluateMetric() const
evaluate the value of the metric
Definition: quadricMetric.C:42
Foam::simplexSmoother
class for volume optimizer
Definition: simplexSmoother.H:56
partTetMeshSimplex
A simplex which is used for smoothing purposes.
Foam::quadricMetric
Definition: quadricMetric.H:51
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::DynList
Definition: DynList.H:53
Foam::quadricMetric::evaluateGradients
void evaluateGradients(vector &grad, tensor &gradGrad) const
evaluate metric gradients
Definition: quadricMetric.C:52
Foam::quadricMetric::normals_
DynList< vector, 64 > normals_
normals of triangles forming the outer hull
Definition: quadricMetric.H:60
Foam::quadricMetric::quadricMetric
quadricMetric(partTetMeshSimplex &simplex)
Definition: quadricMetric.C:68
Foam::Vector< scalar >
simplexSmoother.H
Foam::quadricMetric::optimizeNodePosition
void optimizeNodePosition(const scalar tol=0.001)
Definition: quadricMetric.C:104