meshOctreeAutomaticRefinement.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  meshOctreeAutomaticRefinement
26 
27 Description
28  Automatic octree for mesh generation. This class checks if the current
29  octree resolution is enough to resolve all surface features
30 
31 SourceFiles
32  meshOctreeAutomaticRefinement.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef meshOctreeAutomaticRefinement_H
37 #define meshOctreeAutomaticRefinement_H
38 
39 #include "meshOctreeModifier.H"
40 #include "IOdictionary.H"
41 //#include "volFields.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declarations
49 class triSurfaceCurvatureEstimator;
52 
53 /*---------------------------------------------------------------------------*\
54  Class meshOctreeAutomaticRefinement Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 {
59  // Private data
60  //- reference to meshOctree
62 
63  //- const reference to mesh dictionary
64  const IOdictionary& meshDict_;
65 
66  //- use DATA boxes
67  bool useDATABoxes_;
68 
69  //- a flag for activating paired refinement
70  bool hexRefinement_;
71 
72  // Private member functions
73  //- meshOctreeAddressing pointer
75 
76  //- calculate octree addresing
77  void createOctreeAddressing() const;
79 
80  //- surface partitioner pointer
82 
83  //- calculate partitionerPtr_
84  void createSurfacePartitioner() const;
85  const triSurfacePartitioner& partitioner() const;
86 
87  //- curvature estimator pointer
89 
90  //- calculate curvaturePtr_
91  void createCurvatureEstimator() const;
93 
94  // Functions and data performing automatic refinement
95  //- maximum allowed refinement level
97 
98  //- set maxRefLevel_
99  void setMaxRefLevel();
100 
101  //- refine selected boxes
103 
104  //- refine DATA boxes based on curvature
105  bool curvatureRefinement();
107 
108  //- refine DATA boxes which contain two or more independent parts
109  //- of the surface in their vicinity
110  bool proximityRefinement();
112  (
113  labelList&,
114  const labelLongList&
115  );
116 
117  //- refine DATA boxes containing 2 or more corners, 2 or more distinct
118  //- edges, etc.
120  (
121  labelList&,
122  const labelLongList&
123  );
124 
125  //- refine boxes based on the number of contained surface corners
127  (
128  labelList&,
129  const labelLongList&
130  );
131 
132  // Private copy constructor
133  //- Disallow default bitwise copy construct
135 
136  //- Disallow default bitwise assignment
138 
139 public:
140 
141  // Constructors
142 
143  //- Construct from meshOctree, dictionary and boolean
145  (
146  meshOctree& mo,
147  const IOdictionary& dict,
148  bool useDATABoxes = false
149  );
150 
151  // Destructor
152 
154 
155  // Member Functions
156  //- activate hex refinement
157  void activateHexRefinement();
158 
159  //- refine octree boxes which are too coarse and cannot capture
160  //- surface features
161  void automaticRefinement();
162 };
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
Foam::meshOctreeAutomaticRefinement
Definition: meshOctreeAutomaticRefinement.H:56
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
Foam::meshOctreeAutomaticRefinement::octreeAddressingPtr_
meshOctreeAddressing * octreeAddressingPtr_
meshOctreeAddressing pointer
Definition: meshOctreeAutomaticRefinement.H:73
Foam::triSurfacePartitioner
Definition: triSurfacePartitioner.H:53
Foam::meshOctreeAutomaticRefinement::proximityRefinement
bool proximityRefinement()
Definition: meshOctreeAutomaticRefinementRef.C:93
Foam::meshOctreeAutomaticRefinement::meshOctreeAutomaticRefinement
meshOctreeAutomaticRefinement(const meshOctreeAutomaticRefinement &)
Disallow default bitwise copy construct.
Foam::meshOctreeAutomaticRefinement::curvature
const triSurfaceCurvatureEstimator & curvature() const
Definition: meshOctreeAutomaticRefinement.C:98
Foam::meshOctreeAutomaticRefinement::~meshOctreeAutomaticRefinement
~meshOctreeAutomaticRefinement()
Definition: meshOctreeAutomaticRefinement.C:187
Foam::meshOctreeAutomaticRefinement::meshDict_
const IOdictionary & meshDict_
const reference to mesh dictionary
Definition: meshOctreeAutomaticRefinement.H:63
Foam::meshOctreeAutomaticRefinement::refineBasedOnContainedPartitions
bool refineBasedOnContainedPartitions(labelList &, const labelLongList &)
Definition: meshOctreeAutomaticRefinementRef.C:222
Foam::meshOctreeAutomaticRefinement::refineBasedOnContainedCorners
bool refineBasedOnContainedCorners(labelList &, const labelLongList &)
refine boxes based on the number of contained surface corners
Definition: meshOctreeAutomaticRefinementRef.C:128
Foam::meshOctreeAutomaticRefinement::octree_
meshOctree & octree_
reference to meshOctree
Definition: meshOctreeAutomaticRefinement.H:60
Foam::meshOctreeAutomaticRefinement::octreeAddressing
const meshOctreeAddressing & octreeAddressing() const
Definition: meshOctreeAutomaticRefinement.C:49
meshOctreeModifier.H
Foam::meshOctreeAutomaticRefinement::createOctreeAddressing
void createOctreeAddressing() const
calculate octree addresing
Definition: meshOctreeAutomaticRefinement.C:43
Foam::meshOctreeAutomaticRefinement::curvatureRefinement
bool curvatureRefinement()
refine DATA boxes based on curvature
Definition: meshOctreeAutomaticRefinementRef.C:79
Foam::meshOctreeAutomaticRefinement::maxRefLevel_
direction maxRefLevel_
maximum allowed refinement level
Definition: meshOctreeAutomaticRefinement.H:95
Foam::meshOctreeAutomaticRefinement::createCurvatureEstimator
void createCurvatureEstimator() const
calculate curvaturePtr_
Definition: meshOctreeAutomaticRefinement.C:93
Foam::meshOctreeAutomaticRefinement::useDATABoxes_
bool useDATABoxes_
use DATA boxes
Definition: meshOctreeAutomaticRefinement.H:66
Foam::LongList< label >
Foam::meshOctreeAutomaticRefinement::setMaxRefLevel
void setMaxRefLevel()
set maxRefLevel_
Definition: meshOctreeAutomaticRefinement.C:118
triSurfacePartitioner
Provides information regarding surface partitions on the surface triangulation, and connectivity betw...
Foam::meshOctreeAutomaticRefinement::partitionerPtr_
triSurfacePartitioner * partitionerPtr_
surface partitioner pointer
Definition: meshOctreeAutomaticRefinement.H:80
Foam::meshOctreeAutomaticRefinement::refineSelectedBoxes
void refineSelectedBoxes(labelList &, labelLongList &)
refine selected boxes
Definition: meshOctreeAutomaticRefinementRef.C:464
dict
dictionary dict
Definition: searchingEngine.H:14
meshOctreeAddressing
Automatic octree for mesh generation. This class checks if the current octree resolution is enough to...
Foam::meshOctreeAutomaticRefinement::curvaturePtr_
triSurfaceCurvatureEstimator * curvaturePtr_
curvature estimator pointer
Definition: meshOctreeAutomaticRefinement.H:87
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::meshOctreeAutomaticRefinement::refineBasedOnCurvature
bool refineBasedOnCurvature(labelList &, const labelLongList &)
Definition: meshOctreeAutomaticRefinementRef.C:328
IOdictionary.H
Foam::meshOctreeAddressing
Definition: meshOctreeAddressing.H:59
Foam::meshOctreeAutomaticRefinement::operator=
void operator=(const meshOctreeAutomaticRefinement &)
Disallow default bitwise assignment.
Foam::meshOctreeAutomaticRefinement::refineBasedOnProximityTests
bool refineBasedOnProximityTests(labelList &, const labelLongList &)
Definition: meshOctreeAutomaticRefinementRef.C:400
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::meshOctreeAutomaticRefinement::activateHexRefinement
void activateHexRefinement()
activate hex refinement
Definition: meshOctreeAutomaticRefinementRef.C:60
Foam::meshOctree
Definition: meshOctree.H:55
Foam::direction
unsigned char direction
Definition: direction.H:43
Foam::meshOctreeAutomaticRefinement::partitioner
const triSurfacePartitioner & partitioner() const
Definition: meshOctreeAutomaticRefinement.C:74
Foam::meshOctreeAutomaticRefinement::createSurfacePartitioner
void createSurfacePartitioner() const
calculate partitionerPtr_
Definition: meshOctreeAutomaticRefinement.C:69
Foam::triSurfaceCurvatureEstimator
Definition: triSurfaceCurvatureEstimator.H:51
Foam::meshOctreeAutomaticRefinement::automaticRefinement
void automaticRefinement()
Definition: meshOctreeAutomaticRefinementRef.C:65
Foam::meshOctreeAutomaticRefinement::hexRefinement_
bool hexRefinement_
a flag for activating paired refinement
Definition: meshOctreeAutomaticRefinement.H:69