tetMeshOptimisation.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  tetMeshOptimisation
26 
27 Description
28  Mesh smoothing without any topological changes
29 
30 SourceFiles
31  tetMeshOptimisation.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef tetMeshOptimisation_H
36 #define tetMeshOptimisation_H
37 
38 #include "DynList.H"
39 #include "parPartTet.H"
40 #include "boundBox.H"
41 #include "labelLongList.H"
42 #include "boolList.H"
43 
44 #include <map>
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // Forward declarations
52 class partTetMesh;
53 class meshSurfaceEngine;
54 
55 /*---------------------------------------------------------------------------*\
56  Class tetMeshOptimisation Declaration
57 \*---------------------------------------------------------------------------*/
58 
60 {
61  // Private data
62  //- reference to the tet mesh
64 
65  // Private member functions needed for parallel runs
66  //- make sure that all processors have the same points
67  //- marked as negativeNode
68  void unifyNegativePoints(boolList& negativeNode) const;
69 
70  //- exchange data with other processors
71  void exchangeData
72  (
73  std::map<label, DynList<parPartTet> >& m,
74  boolList* negativeNodePtr = NULL
75  );
76 
77  //- update buffer layer points
79 
80  //- make sure that coordinates of moved points remain the same
81  //- on all processor containing those points
82  void unifyCoordinatesParallel(const boolList* negativeNodePtr = NULL);
83 
84 public:
85 
86  // Constructors
87 
88  //- Construct from tet mesh
90 
91 
92  // Destructor
93 
95 
96  // Member Functions
97  //- untangle mesh by using Patrik Knupp's simple metric
98  void optimiseUsingKnuppMetric(const label nInterations = 5);
99 
100  //- smooth using mesh untangler
101  void optimiseUsingMeshUntangler( const label nIerations = 5);
102 
103  //- smooth using volume optimizer
104  void optimiseUsingVolumeOptimizer(const label nIterations = 10);
105 
106  //- smooth boundary using the volume optimizer
108  (
109  const label nIterations = 3,
110  const bool nonShrinking = false
111  );
112 
113  //- smooth boundary using shrinking surface laplace
114  void optimiseBoundarySurfaceLaplace(const label nIterations = 3);
115 };
116 
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 } // End namespace Foam
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 #endif
125 
126 // ************************************************************************* //
Foam::tetMeshOptimisation::optimiseUsingKnuppMetric
void optimiseUsingKnuppMetric(const label nInterations=5)
untangle mesh by using Patrik Knupp's simple metric
Definition: tetMeshOptimisation.C:67
boolList.H
meshSurfaceEngine
Calculates surface of the mesh.
Foam::tetMeshOptimisation::optimiseBoundaryVolumeOptimizer
void optimiseBoundaryVolumeOptimizer(const label nIterations=3, const bool nonShrinking=false)
smooth boundary using the volume optimizer
Definition: tetMeshOptimisation.C:397
Foam::tetMeshOptimisation::exchangeData
void exchangeData(std::map< label, DynList< parPartTet > > &m, boolList *negativeNodePtr=NULL)
exchange data with other processors
Definition: tetMeshOptimisationParallel.C:90
Foam::tetMeshOptimisation::~tetMeshOptimisation
~tetMeshOptimisation()
Definition: tetMeshOptimisation.C:62
Foam::tetMeshOptimisation::optimiseUsingMeshUntangler
void optimiseUsingMeshUntangler(const label nIerations=5)
smooth using mesh untangler
Definition: tetMeshOptimisation.C:204
Foam::tetMeshOptimisation::tetMeshOptimisation
tetMeshOptimisation(partTetMesh &mesh)
Construct from tet mesh.
Definition: tetMeshOptimisation.C:55
Foam::tetMeshOptimisation::tetMesh_
partTetMesh & tetMesh_
reference to the tet mesh
Definition: tetMeshOptimisation.H:62
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
partTetMesh
Mesh smoothing without any topological changes.
Foam::tetMeshOptimisation::optimiseBoundarySurfaceLaplace
void optimiseBoundarySurfaceLaplace(const label nIterations=3)
smooth boundary using shrinking surface laplace
Definition: tetMeshOptimisation.C:546
Foam::tetMeshOptimisation
Definition: tetMeshOptimisation.H:58
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::DynList
Definition: DynList.H:53
Foam::partTetMesh
Definition: partTetMesh.H:59
boundBox.H
Foam::tetMeshOptimisation::updateBufferLayerPoints
void updateBufferLayerPoints()
update buffer layer points
Definition: tetMeshOptimisationParallel.C:209
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
labelLongList.H
Foam::tetMeshOptimisation::optimiseUsingVolumeOptimizer
void optimiseUsingVolumeOptimizer(const label nIterations=10)
smooth using volume optimizer
Definition: tetMeshOptimisation.C:337
Foam::tetMeshOptimisation::unifyNegativePoints
void unifyNegativePoints(boolList &negativeNode) const
Definition: tetMeshOptimisationParallel.C:43
parPartTet.H
Foam::tetMeshOptimisation::unifyCoordinatesParallel
void unifyCoordinatesParallel(const boolList *negativeNodePtr=NULL)
Definition: tetMeshOptimisationParallel.C:261
DynList.H