knuppMetric.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  knuppMetric
26 
27 Description
28  Mesh smoothing using Knupp's metric. The metric is non-zero for inverted
29  tets only
30 
31 SourceFiles
32  knuppMetric.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef knuppMetric_H
37 #define knuppMetric_H
38 
39 #include "simplexSmoother.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declarations
47 class partTetMeshSimplex;
48 
49 /*---------------------------------------------------------------------------*\
50  Class knuppMetric Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 //- class for mesh untangler
54 class knuppMetric
55 :
56  public simplexSmoother
57 {
58  // Private data
59  //- free vertex
60  point& p_;
61 
62  //- normals of triangles forming the outer hull
64 
65  //- centres of triangles forming the outer hull
67 
68  //- control parameter. It helps the point get inside the feasible region
69  scalar beta_;
70 
71  // Private member functions
72  //- evaluate the value of the metric
73  scalar evaluateMetric() const;
74  scalar evaluateMetricNoBeta() const;
75 
76  //- evaluate metric gradients
77  void evaluateGradients(vector& grad, tensor& gradGrad) const;
78 
79  public:
80 
82 
83  // Destructor
84  ~knuppMetric();
85 
86  // Member functions
87  //- find the best position such that all tets making a simplex
88  //- have a positive volume
89  void optimizeNodePosition(const scalar tol = 0.001);
90 };
91 
92 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
93 
94 } // End namespace Foam
95 
96 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
97 
98 #endif
99 
100 // ************************************************************************* //
Foam::Tensor
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
Definition: complexI.H:224
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::knuppMetric::evaluateMetric
scalar evaluateMetric() const
evaluate the value of the metric
Definition: knuppMetric.C:42
Foam::knuppMetric::p_
point & p_
free vertex
Definition: knuppMetric.H:59
Foam::knuppMetric::~knuppMetric
~knuppMetric()
Definition: knuppMetric.C:117
Foam::knuppMetric::beta_
scalar beta_
control parameter. It helps the point get inside the feasible region
Definition: knuppMetric.H:68
Foam::knuppMetric
class for mesh untangler
Definition: knuppMetric.H:53
Foam::knuppMetric::knuppMetric
knuppMetric(partTetMeshSimplex &simplex)
Definition: knuppMetric.C:85
Foam::simplexSmoother
class for volume optimizer
Definition: simplexSmoother.H:56
partTetMeshSimplex
A simplex which is used for smoothing purposes.
Foam::knuppMetric::evaluateMetricNoBeta
scalar evaluateMetricNoBeta() const
Definition: knuppMetric.C:55
Foam::knuppMetric::normals_
DynList< vector, 64 > normals_
normals of triangles forming the outer hull
Definition: knuppMetric.H:62
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::DynList
Definition: DynList.H:53
Foam::knuppMetric::optimizeNodePosition
void optimizeNodePosition(const scalar tol=0.001)
Definition: knuppMetric.C:124
Foam::Vector< scalar >
Foam::knuppMetric::evaluateGradients
void evaluateGradients(vector &grad, tensor &gradGrad) const
evaluate metric gradients
Definition: knuppMetric.C:68
Foam::knuppMetric::centres_
DynList< point, 64 > centres_
centres of triangles forming the outer hull
Definition: knuppMetric.H:65
simplexSmoother.H