meshOctreeCreator.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  meshOctreeCreator
26 
27 Description
28  Creates octree for mesh generation
29 
30 SourceFiles
31  meshOctreeCreator.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef meshOctreeCreator_H
36 #define meshOctreeCreator_H
37 
38 #include "boolList.H"
39 #include "DynList.H"
40 #include "IOdictionary.H"
41 #include "meshOctreeModifier.H"
42 #include "patchRefinementList.H"
43 
44 #include <map>
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 // Forward declarations
52 class meshOctreeCube;
53 
54 /*---------------------------------------------------------------------------*\
55  Class meshOctreeCreator Declaration
56 \*---------------------------------------------------------------------------*/
57 
59 {
60 protected:
61 
62  // Protected data
63  //- Reference to meshOctree
65 
66  //- Scaling factor
67  scalar scalingFactor_;
68 
69  //- Dictionary containing information necessary to perform refinement
71 
72  //- hex refinement flag
73  bool hexRefinement_;
74 
75 private:
76  // Private member functions
77 
78  // Octree refinement
79  //- refine boxes contained inside the objects for refinement
81 
82  //- refine boxes intersected by surface meshes
83  //- used as refinement sources
85 
86  //- refine boxes by edge meshes
87  //- used as refinement sources
89 
90  //- refine boxes near DATA boxes to get a nice smooth surface
91  void refineBoxesNearDataBoxes(const label nLayers = 1);
92 
93  //- refine boxes of the given flag to the given size
94  void refineBoxes(const direction refLevel, const direction cubeType);
95 
96  // Private octree creation methods
97  void refineBoundary();
100 
101  // Private member functions for parallel runs
102  //- move octree cubes from one processor to another until
103  //- each processor contains the same number of leaves
104  //- of the required type
105  void loadDistribution(const bool distributeUsed = false);
106 
107  // information about octree refinement
108  //- ref level to achieve max cell size
110 
111  //- this list contains ref level for each surface triangle
113 
114  //- set the boundBox such that maxCellSize is achieved
116 
117  // Private copy constructor
118  //- Disallow default bitwise copy construct
120 
121  //- Disallow default bitwise assignment
122  void operator=(const meshOctreeCreator&);
123 
124 public:
125 
126  // Constructors
127 
128  //- construct from meshOctree
130 
131  //- Construct from meshOctree and dictionary
133 
134  // Destructor
135 
137 
138 
139  // Member Functions
140  //- set the scaling factor
141  void setScalingFactor(const scalar);
142 
143  //- activate octree refinement which marks all sons of an octree box
144  //- for refinement in case a single son is marked for refinement
145  //- this type of refinement is necessary for creating hex meshes
146  void activateHexRefinement();
147 
148  //- create octree boxes
149  void createOctreeBoxes();
150 
151  //- refine boxes containing surface elements
152  //- this is used for proximity searches
154  (
155  const direction maxLevel,
156  const label nTrianglesInLeaf = 15
157  );
158 };
159 
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #endif
168 
169 // ************************************************************************* //
Foam::meshOctreeCreator::setScalingFactor
void setScalingFactor(const scalar)
set the scaling factor
Definition: meshOctreeCreator.C:74
Foam::meshOctreeCreator::refineBoxesIntersectingSurfaces
void refineBoxesIntersectingSurfaces()
Definition: meshOctreeCreatorAdjustOctreeToSurface.C:421
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
boolList.H
Foam::meshOctreeCreator::scalingFactor_
scalar scalingFactor_
Scaling factor.
Definition: meshOctreeCreator.H:66
Foam::meshOctreeCreator
Definition: meshOctreeCreator.H:57
meshOctreeCube
A cube stores information needed for mesh generation.
Foam::meshOctreeCreator::setRootCubeSizeAndRefParameters
void setRootCubeSizeAndRefParameters()
set the boundBox such that maxCellSize is achieved
Definition: meshOctreeCreatorCreateOctreeBoxes.C:49
Foam::meshOctreeCreator::refineInsideAndUnknownBoxes
void refineInsideAndUnknownBoxes()
Definition: meshOctreeCreatorCreateOctreeBoxes.C:441
Foam::meshOctreeCreator::~meshOctreeCreator
~meshOctreeCreator()
Definition: meshOctreeCreator.C:69
meshOctreeModifier.H
patchRefinementList.H
Foam::meshOctreeCreator::refineBoxes
void refineBoxes(const direction refLevel, const direction cubeType)
refine boxes of the given flag to the given size
Definition: meshOctreeCreatorAdjustOctreeToSurface.C:1135
Foam::meshOctreeCreator::createInsideOutsideInformation
void createInsideOutsideInformation()
Definition: meshOctreeCreatorFrontalMarking.C:40
Foam::meshOctreeCreator::octree_
meshOctree & octree_
Reference to meshOctree.
Definition: meshOctreeCreator.H:63
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
Foam::meshOctreeCreator::refineBoxesNearDataBoxes
void refineBoxesNearDataBoxes(const label nLayers=1)
refine boxes near DATA boxes to get a nice smooth surface
Definition: meshOctreeCreatorAdjustOctreeToSurface.C:871
Foam::meshOctreeCreator::operator=
void operator=(const meshOctreeCreator &)
Disallow default bitwise assignment.
Foam::meshOctreeCreator::createOctreeWithRefinedBoundary
void createOctreeWithRefinedBoundary(const direction maxLevel, const label nTrianglesInLeaf=15)
Definition: meshOctreeCreatorCreateOctreeBoxes.C:498
Foam::meshOctreeCreator::createOctreeBoxes
void createOctreeBoxes()
create octree boxes
Definition: meshOctreeCreatorCreateOctreeBoxes.C:448
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::meshOctreeCreator::globalRefLevel_
direction globalRefLevel_
ref level to achieve max cell size
Definition: meshOctreeCreator.H:108
Foam::meshOctreeCreator::meshOctreeCreator
meshOctreeCreator(const meshOctreeCreator &)
Disallow default bitwise copy construct.
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::meshOctreeCreator::loadDistribution
void loadDistribution(const bool distributeUsed=false)
Definition: meshOctreeCreatorLoadDistribution.C:46
Foam::meshOctreeCreator::surfRefLevel_
List< DynList< std::pair< direction, scalar > > > surfRefLevel_
this list contains ref level for each surface triangle
Definition: meshOctreeCreator.H:111
IOdictionary.H
Foam::meshOctreeCreator::meshDictPtr_
const IOdictionary * meshDictPtr_
Dictionary containing information necessary to perform refinement.
Definition: meshOctreeCreator.H:69
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::meshOctreeCreator::refineBoxesIntersectingEdgeMeshes
void refineBoxesIntersectingEdgeMeshes()
Definition: meshOctreeCreatorAdjustOctreeToSurface.C:652
Foam::meshOctree
Definition: meshOctree.H:55
Foam::direction
unsigned char direction
Definition: direction.H:43
Foam::meshOctreeCreator::refineBoxesContainedInObjects
void refineBoxesContainedInObjects()
refine boxes contained inside the objects for refinement
Definition: meshOctreeCreatorAdjustOctreeToSurface.C:196
Foam::meshOctreeCreator::activateHexRefinement
void activateHexRefinement()
Definition: meshOctreeCreator.C:79
Foam::meshOctreeCreator::refineBoundary
void refineBoundary()
Definition: meshOctreeCreatorAdjustOctreeToSurface.C:57
Foam::meshOctreeCreator::hexRefinement_
bool hexRefinement_
hex refinement flag
Definition: meshOctreeCreator.H:72
DynList.H