voronoiMeshGenerator.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  voronoiMeshGenerator
26 
27 Description
28  Creates voronoi mesh template from the octree
29 
30 SourceFiles
31  voronoiMeshGenerator.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef voronoiMeshGenerator_H
36 #define voronoiMeshGenerator_H
37 
38 #include "polyMeshGen.H"
39 #include "IOdictionary.H"
40 #include "workflowControls.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // Forward declarations
48 class triSurf;
49 class meshOctree;
50 class Time;
51 
52 /*---------------------------------------------------------------------------*\
53  Class voronoiMeshGenerator Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 {
58  // Private data
59  //- reference to Time
60  const Time& runTime_;
61 
62  //- pointer to the surface
63  const triSurf* surfacePtr_;
64 
65  //- pointer to the modifier surface
66  const triSurf* modSurfacePtr_;
67 
68  //- pointer to the octree
70 
71  //- pointer to the list patches for boundary vertices
73 
74  //- IOdictionary containing information about cell sizes, etc..
76 
77  //- mesh
79 
80  //- workflow controller
82 
83  // Private member functions
84  //- create voronoi mesh
85  void createVoronoiMesh();
86 
87  //- prepare mesh surface
88  void surfacePreparation();
89 
90  //- map mesh to the surface and untangle surface
91  void mapMeshToSurface();
92 
93  //- assign patches to boundary faces
94  void extractPatches();
95 
96  //- capture edges and corners
97  void mapEdgesAndCorners();
98 
99  //- optimise surface mesh
100  void optimiseMeshSurface();
101 
102  //- add boundary layers
103  void generateBoudaryLayers();
104 
105  //- mesh optimisation
106  void optimiseFinalMesh();
107 
108  //- re-project points back on the surface mesh after back-scaling
110 
111  //- refine boundary layer
112  void refBoundaryLayers();
113 
114  //- replace boundaries
115  void replaceBoundaries();
116 
117  //- renumber the mesh
118  void renumberMesh();
119 
120  //- generate mesh
121  void generateMesh();
122 
123  //- Disallow default bitwise copy construct
125 
126  //- Disallow default bitwise assignment
127  void operator=(const voronoiMeshGenerator&);
128 
129 public:
130 
131  // Constructors
132 
133  //- Construct from time
134  voronoiMeshGenerator(const Time&);
135 
136  //- Construct from time and desired cell size
137  //voronoiMeshGenerator(const Time&, const volScalarField&);
138 
139  // Destructor
140 
142 
143 
144  // Member Functions
145 
146  //- write the mesh
147  void writeMesh() const;
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #endif
158 
159 // ************************************************************************* //
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
Foam::voronoiMeshGenerator::createVoronoiMesh
void createVoronoiMesh()
create voronoi mesh
Definition: voronoiMeshGenerator.C:59
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
Foam::voronoiMeshGenerator::refBoundaryLayers
void refBoundaryLayers()
refine boundary layer
Definition: voronoiMeshGenerator.C:180
Foam::voronoiMeshGenerator::projectSurfaceAfterBackScaling
void projectSurfaceAfterBackScaling()
re-project points back on the surface mesh after back-scaling
Definition: voronoiMeshGenerator.C:251
Foam::voronoiMeshGenerator::octreePtr_
meshOctree * octreePtr_
pointer to the octree
Definition: voronoiMeshGenerator.H:68
Foam::voronoiMeshGenerator::meshDict_
IOdictionary meshDict_
IOdictionary containing information about cell sizes, etc..
Definition: voronoiMeshGenerator.H:74
Foam::polyMeshGen
Definition: polyMeshGen.H:46
Foam::voronoiMeshGenerator::generateBoudaryLayers
void generateBoudaryLayers()
add boundary layers
Definition: voronoiMeshGenerator.C:146
Foam::voronoiMeshGenerator::modSurfacePtr_
const triSurf * modSurfacePtr_
pointer to the modifier surface
Definition: voronoiMeshGenerator.H:65
Foam::voronoiMeshGenerator::optimiseMeshSurface
void optimiseMeshSurface()
optimise surface mesh
Definition: voronoiMeshGenerator.C:133
Foam::voronoiMeshGenerator::surfacePreparation
void surfacePreparation()
prepare mesh surface
Definition: voronoiMeshGenerator.C:72
Foam::voronoiMeshGenerator::renumberMesh
void renumberMesh()
renumber the mesh
Definition: voronoiMeshGenerator.C:287
Foam::voronoiMeshGenerator
Definition: voronoiMeshGenerator.H:55
Foam::voronoiMeshGenerator::~voronoiMeshGenerator
~voronoiMeshGenerator()
Construct from time and desired cell size.
Definition: voronoiMeshGenerator.C:436
Foam::voronoiMeshGenerator::writeMesh
void writeMesh() const
write the mesh
Definition: voronoiMeshGenerator.C:446
polyMeshGen.H
Foam::voronoiMeshGenerator::replaceBoundaries
void replaceBoundaries()
replace boundaries
Definition: voronoiMeshGenerator.C:277
Foam::voronoiMeshGenerator::mapMeshToSurface
void mapMeshToSurface()
map mesh to the surface and untangle surface
Definition: voronoiMeshGenerator.C:87
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::voronoiMeshGenerator::surfacePtr_
const triSurf * surfacePtr_
pointer to the surface
Definition: voronoiMeshGenerator.H:62
Foam::voronoiMeshGenerator::pointRegionsPtr_
labelList * pointRegionsPtr_
pointer to the list patches for boundary vertices
Definition: voronoiMeshGenerator.H:71
IOdictionary.H
Foam::voronoiMeshGenerator::operator=
void operator=(const voronoiMeshGenerator &)
Disallow default bitwise assignment.
Foam::voronoiMeshGenerator::runTime_
const Time & runTime_
reference to Time
Definition: voronoiMeshGenerator.H:59
Foam::voronoiMeshGenerator::optimiseFinalMesh
void optimiseFinalMesh()
mesh optimisation
Definition: voronoiMeshGenerator.C:199
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
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::voronoiMeshGenerator::controller_
workflowControls controller_
workflow controller
Definition: voronoiMeshGenerator.H:80
workflowControls.H
Foam::voronoiMeshGenerator::mesh_
polyMeshGen mesh_
mesh
Definition: voronoiMeshGenerator.H:77
Foam::voronoiMeshGenerator::extractPatches
void extractPatches()
assign patches to boundary faces
Definition: voronoiMeshGenerator.C:113
Foam::workflowControls
Definition: workflowControls.H:55
Foam::triSurf
Definition: triSurf.H:59
Foam::voronoiMeshGenerator::mapEdgesAndCorners
void mapEdgesAndCorners()
capture edges and corners
Definition: voronoiMeshGenerator.C:123
Foam::voronoiMeshGenerator::generateMesh
void generateMesh()
generate mesh
Definition: voronoiMeshGenerator.C:297
Foam::voronoiMeshGenerator::voronoiMeshGenerator
voronoiMeshGenerator(const voronoiMeshGenerator &)
Disallow default bitwise copy construct.