cartesianMeshGenerator.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  cartesianMeshGenerator
26 
27 Description
28  Creates cartesian mesh from the octree
29 
30 SourceFiles
31  cartesianMeshGenerator.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef cartesianMeshGenerator_H
36 #define cartesianMeshGenerator_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 cartesianMeshGenerator Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 {
59  // Private data
60  //- reference to Time
61  const Time& db_;
62 
63  //- pointer to the surface
64  const triSurf* surfacePtr_;
65 
66  //- pointer to the modified surface
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 createCartesianMesh();
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  //- map points at feature edges and corners
95  void mapEdgesAndCorners();
96 
97  //- optimise surface mesh
98  void optimiseMeshSurface();
99 
100  //- add boundary layers
101  void generateBoundaryLayers();
102 
103  //- refine boundary layers
104  void refBoundaryLayers();
105 
106  //- mesh optimisation
107  void optimiseFinalMesh();
108 
109  //- re-project points back on the surface mesh after back-scaling
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 cartesianMeshGenerator&);
126 
127 public:
128 
129  // Constructors
130 
131  //- Construct from 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::cartesianMeshGenerator::projectSurfaceAfterBackScaling
void projectSurfaceAfterBackScaling()
re-project points back on the surface mesh after back-scaling
Definition: cartesianMeshGenerator.C:211
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
Foam::cartesianMeshGenerator
Definition: cartesianMeshGenerator.H:56
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
Foam::cartesianMeshGenerator::extractPatches
void extractPatches()
capture edges and corners
Definition: cartesianMeshGenerator.C:117
Foam::cartesianMeshGenerator::controller_
workflowControls controller_
workflow controller
Definition: cartesianMeshGenerator.H:78
Foam::cartesianMeshGenerator::surfacePtr_
const triSurf * surfacePtr_
pointer to the surface
Definition: cartesianMeshGenerator.H:63
Foam::cartesianMeshGenerator::replaceBoundaries
void replaceBoundaries()
replace boundaries
Definition: cartesianMeshGenerator.C:237
Foam::polyMeshGen
Definition: polyMeshGen.H:46
Foam::cartesianMeshGenerator::cartesianMeshGenerator
cartesianMeshGenerator(const cartesianMeshGenerator &)
Disallow default bitwise copy construct.
Foam::cartesianMeshGenerator::mesh_
polyMeshGen mesh_
mesh
Definition: cartesianMeshGenerator.H:75
Foam::cartesianMeshGenerator::db_
const Time & db_
reference to Time
Definition: cartesianMeshGenerator.H:60
Foam::cartesianMeshGenerator::generateBoundaryLayers
void generateBoundaryLayers()
add boundary layers
Definition: cartesianMeshGenerator.C:138
Foam::cartesianMeshGenerator::generateMesh
void generateMesh()
generate mesh
Definition: cartesianMeshGenerator.C:247
Foam::cartesianMeshGenerator::optimiseMeshSurface
void optimiseMeshSurface()
optimise surface mesh
Definition: cartesianMeshGenerator.C:132
Foam::cartesianMeshGenerator::mapEdgesAndCorners
void mapEdgesAndCorners()
map points at feature edges and corners
Definition: cartesianMeshGenerator.C:127
polyMeshGen.H
Foam::cartesianMeshGenerator::~cartesianMeshGenerator
~cartesianMeshGenerator()
Definition: cartesianMeshGenerator.C:391
Foam::cartesianMeshGenerator::meshDict_
IOdictionary meshDict_
IOdictionary containing information about cell sizes, etc..
Definition: cartesianMeshGenerator.H:69
Foam::cartesianMeshGenerator::modSurfacePtr_
const triSurf * modSurfacePtr_
pointer to the modified surface
Definition: cartesianMeshGenerator.H:66
Foam::cartesianMeshGenerator::mapMeshToSurface
void mapMeshToSurface()
map mesh to the surface and untangle surface
Definition: cartesianMeshGenerator.C:101
Foam::cartesianMeshGenerator::renumberMesh
void renumberMesh()
renumber the mesh
Definition: cartesianMeshGenerator.C:242
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::cartesianMeshGenerator::surfacePreparation
void surfacePreparation()
prepare mesh surface
Definition: cartesianMeshGenerator.C:76
Foam::cartesianMeshGenerator::operator=
void operator=(const cartesianMeshGenerator &)
Disallow default bitwise assignment.
Foam::cartesianMeshGenerator::octreePtr_
meshOctree * octreePtr_
pointer to the octree
Definition: cartesianMeshGenerator.H:72
IOdictionary.H
Foam::cartesianMeshGenerator::createCartesianMesh
void createCartesianMesh()
create cartesian mesh
Definition: cartesianMeshGenerator.C:62
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...
Foam::cartesianMeshGenerator::optimiseFinalMesh
void optimiseFinalMesh()
mesh optimisation
Definition: cartesianMeshGenerator.C:164
meshOctree
Octree for mesh generation.
workflowControls.H
Foam::workflowControls
Definition: workflowControls.H:55
Foam::triSurf
Definition: triSurf.H:59
Foam::cartesianMeshGenerator::writeMesh
void writeMesh() const
write the mesh
Definition: cartesianMeshGenerator.C:400
Foam::cartesianMeshGenerator::refBoundaryLayers
void refBoundaryLayers()
refine boundary layers
Definition: cartesianMeshGenerator.C:145