tetMeshGenerator.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  tetMeshGenerator
26 
27 Description
28  Creates cartesian mesh from the octree
29 
30 SourceFiles
31  tetMeshGenerator.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef tetMeshGenerator_H
36 #define tetMeshGenerator_H
37 
38 #include "polyMeshGen.H"
39 #include "IOdictionary.H"
40 #include "workflowControls.H"
41 //#include "volFields.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declarations
49 class triSurf;
50 class meshOctree;
51 class Time;
52 
53 /*---------------------------------------------------------------------------*\
54  Class tetMeshGenerator Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class tetMeshGenerator
58 {
59  // Private data
60  //- reference to Time
61  const Time& runTime_;
62 
63  //- pointer to the surface
64  const triSurf* surfacePtr_;
65 
66  //- pointer to the modified surface mesh
67  const triSurf* modSurfacePtr_;
68 
69  //- IOdictionary containing information about cell sizes, etc..
71 
72  //- pointer to the octree
74 
75  //- mesh
77 
78  //- workflow controller
80 
81  // Private member functions
82  //- create cartesian mesh
83  void createTetMesh();
84 
85  //- prepare mesh surface
86  void surfacePreparation();
87 
88  //- map mesh to the surface and untangle surface
89  void mapMeshToSurface();
90 
91  //- capture edges and corners
92  void extractPatches();
93 
94  //- capture edges and corners
95  void mapEdgesAndCorners();
96 
97  //- optimise surface mesh
98  void optimiseMeshSurface();
99 
100  //- add boundary layers
101  void generateBoundaryLayers();
102 
103  //- mesh optimisation
104  void optimiseFinalMesh();
105 
106  //- re-project points back on the surface mesh after back-scaling
108 
109  //- refine boundary layers
110  void refBoundaryLayers();
111 
112  //- replace boundaries
113  void replaceBoundaries();
114 
115  //- renumber the mesh
116  void renumberMesh();
117 
118  //- generate mesh
119  void generateMesh();
120 
121  //- Disallow default bitwise copy construct
123 
124  //- Disallow default bitwise assignment
125  void operator=(const tetMeshGenerator&);
126 
127 public:
128 
129  // Constructors
130 
131  //- Construct from time
132  tetMeshGenerator(const Time&);
133 
134  // Destructor
135 
137 
138 
139  // Member Functions
140 
141  //- write the mesh
142  void writeMesh() const;
143 };
144 
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 } // End namespace Foam
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 #endif
153 
154 // ************************************************************************* //
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
Foam::tetMeshGenerator::createTetMesh
void createTetMesh()
create cartesian mesh
Definition: tetMeshGenerator.C:59
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
Foam::tetMeshGenerator::optimiseFinalMesh
void optimiseFinalMesh()
mesh optimisation
Definition: tetMeshGenerator.C:143
Foam::tetMeshGenerator::~tetMeshGenerator
~tetMeshGenerator()
Definition: tetMeshGenerator.C:378
Foam::tetMeshGenerator::generateMesh
void generateMesh()
generate mesh
Definition: tetMeshGenerator.C:235
Foam::tetMeshGenerator::runTime_
const Time & runTime_
reference to Time
Definition: tetMeshGenerator.H:60
Foam::polyMeshGen
Definition: polyMeshGen.H:46
Foam::tetMeshGenerator::replaceBoundaries
void replaceBoundaries()
replace boundaries
Definition: tetMeshGenerator.C:225
Foam::tetMeshGenerator::optimiseMeshSurface
void optimiseMeshSurface()
optimise surface mesh
Definition: tetMeshGenerator.C:110
Foam::tetMeshGenerator::refBoundaryLayers
void refBoundaryLayers()
refine boundary layers
Definition: tetMeshGenerator.C:206
Foam::tetMeshGenerator::writeMesh
void writeMesh() const
write the mesh
Definition: tetMeshGenerator.C:387
Foam::tetMeshGenerator::renumberMesh
void renumberMesh()
renumber the mesh
Definition: tetMeshGenerator.C:230
Foam::tetMeshGenerator::extractPatches
void extractPatches()
capture edges and corners
Definition: tetMeshGenerator.C:95
polyMeshGen.H
Foam::tetMeshGenerator::mesh_
polyMeshGen mesh_
mesh
Definition: tetMeshGenerator.H:75
Foam::tetMeshGenerator::operator=
void operator=(const tetMeshGenerator &)
Disallow default bitwise assignment.
Foam::tetMeshGenerator::meshDict_
IOdictionary meshDict_
IOdictionary containing information about cell sizes, etc..
Definition: tetMeshGenerator.H:69
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::tetMeshGenerator::tetMeshGenerator
tetMeshGenerator(const tetMeshGenerator &)
Disallow default bitwise copy construct.
IOdictionary.H
Foam::tetMeshGenerator::surfacePtr_
const triSurf * surfacePtr_
pointer to the surface
Definition: tetMeshGenerator.H:63
Foam::meshOctree
Definition: meshOctree.H:55
triSurf
A class for triangulated surface used in the meshing process. It is derived from points and facets wi...
meshOctree
Octree for mesh generation.
Foam::tetMeshGenerator::controller_
workflowControls controller_
workflow controller
Definition: tetMeshGenerator.H:78
workflowControls.H
Foam::tetMeshGenerator::surfacePreparation
void surfacePreparation()
prepare mesh surface
Definition: tetMeshGenerator.C:67
Foam::tetMeshGenerator::projectSurfaceAfterBackScaling
void projectSurfaceAfterBackScaling()
re-project points back on the surface mesh after back-scaling
Definition: tetMeshGenerator.C:180
Foam::tetMeshGenerator::octreePtr_
meshOctree * octreePtr_
pointer to the octree
Definition: tetMeshGenerator.H:72
Foam::tetMeshGenerator::mapMeshToSurface
void mapMeshToSurface()
map mesh to the surface and untangle surface
Definition: tetMeshGenerator.C:81
Foam::tetMeshGenerator::modSurfacePtr_
const triSurf * modSurfacePtr_
pointer to the modified surface mesh
Definition: tetMeshGenerator.H:66
Foam::tetMeshGenerator::mapEdgesAndCorners
void mapEdgesAndCorners()
capture edges and corners
Definition: tetMeshGenerator.C:105
Foam::workflowControls
Definition: workflowControls.H:55
Foam::triSurf
Definition: triSurf.H:59
Foam::tetMeshGenerator::generateBoundaryLayers
void generateBoundaryLayers()
add boundary layers
Definition: tetMeshGenerator.C:116
Foam::tetMeshGenerator
Definition: tetMeshGenerator.H:56