DistributedDelaunayMesh.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM 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 OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::DistributedDelaunayMesh
26 
27 Description
28 
29 SourceFiles
30  DistributedDelaunayMeshI.H
31  DistributedDelaunayMesh.C
32  DistributedDelaunayMeshIO.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef DistributedDelaunayMesh_H
37 #define DistributedDelaunayMesh_H
38 
39 #include "DelaunayMesh.H"
41 #include "autoPtr.H"
42 #include "boundBox.H"
43 #include "indexedVertex.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 class mapDistribute;
51 
52 /*---------------------------------------------------------------------------*\
53  Class DistributedDelaunayMesh Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 template<class Triangulation>
58 :
59  public DelaunayMesh<Triangulation>
60 {
61 public:
62 
63  typedef typename Triangulation::Vertex_handle Vertex_handle;
64  typedef typename Triangulation::Cell_handle Cell_handle;
65  typedef typename Triangulation::Point Point;
66 
67  typedef typename Triangulation::Finite_vertices_iterator
69  typedef typename Triangulation::Finite_cells_iterator
71  typedef typename Triangulation::All_cells_iterator
73 
76 
77 
78 private:
79 
81 
82 
83  // Private Member Functions
84 
85  //-
86  bool distributeBoundBoxes(const boundBox& bb);
87 
88  //-
89  bool isLocal(const Vertex_handle& v) const;
90 
91  bool isLocal(const label localProcIndex) const;
92 
94  (
95  const point& centre,
96  const scalar radiusSqr
97  ) const;
98 
100  (
101  const Cell_handle& cit,
102  Map<labelList>& circumsphereOverlaps
103  ) const;
104 
106  (
107  Map<labelList>& circumsphereOverlaps
108  ) const;
109 
111  (
112  const Map<labelList>& circumsphereOverlaps,
113  PtrList<labelPairHashSet>& referralVertices,
114  DynamicList<label>& targetProcessor,
115  DynamicList<Vb>& parallelInfluenceVertices
116  );
117 
119  (
120  const DynamicList<label>& targetProcessor,
121  DynamicList<Vb>& parallelVertices,
122  PtrList<labelPairHashSet>& referralVertices,
123  labelPairHashSet& receivedVertices
124  );
125 
126  //- Disallow default bitwise copy construct
128 
129  //- Disallow default bitwise assignment
131 
132 
133 public:
134 
135  // Constructors
136 
137  //- Construct from components
138  explicit DistributedDelaunayMesh(const Time& runTime);
139 
141  (
142  const Time& runTime,
143  const word& meshName
144  );
145 
146 
147  //- Destructor
149 
150 
151  // Queries
152 
153  //- Use DelaunayMesh timeCheck function
155 
156  scalar calculateLoadUnbalance() const;
157 
158 
159  // Member Functions
160 
161  //- Build a mapDistribute for the supplied destination processor data
162  static autoPtr<mapDistribute> buildMap(const List<label>& toProc);
163 
164  //-
165  bool distribute(const boundBox& bb);
166 
168  (
169  const backgroundMeshDecomposition& decomposition,
171  );
172 
173  //- Refer vertices so that the processor interfaces are consistent
174  void sync(const boundBox& bb);
175 
176  //- Refer vertices so that the processor interfaces are consistent
177  void sync
178  (
179  const boundBox& bb,
180  PtrList<labelPairHashSet>& referralVertices,
181  labelPairHashSet& receivedVertices,
182  bool iterateReferral = true
183  );
184 
185  //- Inserts points into the triangulation if the point is within
186  // the circumsphere of another cell. Returns HashSet of failed
187  // point insertions
188  template<class PointIterator>
190  (
191  PointIterator begin,
192  PointIterator end,
193  bool printErrors = true
194  );
195 
196 // distributeField();
197 
198 
199  // Queries
200 
201 
202 };
203 
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 } // End namespace Foam
208 
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 
211 //#include "DistributedDelaunayMeshI.H"
212 
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214 
215 #ifdef NoRepository
216  #include "DistributedDelaunayMesh.C"
217 #endif
218 
219 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220 
221 #endif
222 
223 // ************************************************************************* //
Foam::DistributedDelaunayMesh::~DistributedDelaunayMesh
~DistributedDelaunayMesh()
Destructor.
Foam::DistributedDelaunayMesh::operator=
void operator=(const DistributedDelaunayMesh< Triangulation > &)
Disallow default bitwise assignment.
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::DynamicList< label >
Foam::DistributedDelaunayMesh::findProcessorBoundaryCells
void findProcessorBoundaryCells(Map< labelList > &circumsphereOverlaps) const
Foam::DistributedDelaunayMesh::overlapProcessors
labelList overlapProcessors(const point &centre, const scalar radiusSqr) const
Foam::Map
A HashTable to objects of type <T> with a label key.
Definition: PrimitivePatchTemplate.H:68
Foam::DistributedDelaunayMesh::DistributedDelaunayMesh
DistributedDelaunayMesh(const DistributedDelaunayMesh< Triangulation > &)
Disallow default bitwise copy construct.
Foam::HashSet
A HashTable with keys but without contents.
Definition: HashSet.H:59
Foam::DistributedDelaunayMesh::rangeInsertReferredWithInfo
labelPairHashSet rangeInsertReferredWithInfo(PointIterator begin, PointIterator end, bool printErrors=true)
Inserts points into the triangulation if the point is within.
Foam::DistributedDelaunayMesh::Finite_cells_iterator
Triangulation::Finite_cells_iterator Finite_cells_iterator
Definition: DistributedDelaunayMesh.H:69
Foam::DistributedDelaunayMesh::buildMap
static autoPtr< mapDistribute > buildMap(const List< label > &toProc)
Build a mapDistribute for the supplied destination processor data.
Foam::DistributedDelaunayMesh::Cell_handle
Triangulation::Cell_handle Cell_handle
Definition: DistributedDelaunayMesh.H:63
backgroundMeshDecomposition.H
Foam::DistributedDelaunayMesh::sync
void sync(const boundBox &bb)
Refer vertices so that the processor interfaces are consistent.
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
DistributedDelaunayMesh.C
Foam::DistributedDelaunayMesh::referVertices
label referVertices(const DynamicList< label > &targetProcessor, DynamicList< Vb > &parallelVertices, PtrList< labelPairHashSet > &referralVertices, labelPairHashSet &receivedVertices)
Foam::DistributedDelaunayMesh::markVerticesToRefer
void markVerticesToRefer(const Map< labelList > &circumsphereOverlaps, PtrList< labelPairHashSet > &referralVertices, DynamicList< label > &targetProcessor, DynamicList< Vb > &parallelInfluenceVertices)
Foam::DistributedDelaunayMesh::All_cells_iterator
Triangulation::All_cells_iterator All_cells_iterator
Definition: DistributedDelaunayMesh.H:71
Foam::DistributedDelaunayMesh
Definition: DistributedDelaunayMesh.H:56
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::DistributedDelaunayMesh::calculateLoadUnbalance
scalar calculateLoadUnbalance() const
Foam::DistributedDelaunayMesh::labelPairHashSet
DelaunayMesh< Triangulation >::labelPairHashSet labelPairHashSet
Definition: DistributedDelaunayMesh.H:74
Foam::DistributedDelaunayMesh::checkProcBoundaryCell
bool checkProcBoundaryCell(const Cell_handle &cit, Map< labelList > &circumsphereOverlaps) const
Foam::DistributedDelaunayMesh::Vertex_handle
Triangulation::Vertex_handle Vertex_handle
Definition: DistributedDelaunayMesh.H:62
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
boundBox.H
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::DelaunayMesh< CellSizeDelaunay >::Cell_handle
CellSizeDelaunay ::Cell_handle Cell_handle
Definition: DelaunayMesh.H:66
Foam::DistributedDelaunayMesh::distribute
bool distribute(const boundBox &bb)
Foam::Vector< scalar >
Foam::DistributedDelaunayMesh::isLocal
bool isLocal(const Vertex_handle &v) const
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::DistributedDelaunayMesh::Finite_vertices_iterator
Triangulation::Finite_vertices_iterator Finite_vertices_iterator
Definition: DistributedDelaunayMesh.H:67
Foam::backgroundMeshDecomposition
Store a background polyMesh to use for the decomposition of space and queries for parallel conformalV...
Definition: backgroundMeshDecomposition.H:92
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::boundBox
A bounding box defined in terms of the points at its extremities.
Definition: boundBox.H:55
Foam::DistributedDelaunayMesh::allBackgroundMeshBounds_
autoPtr< List< boundBox > > allBackgroundMeshBounds_
Definition: DistributedDelaunayMesh.H:79
meshName
static char meshName[]
Definition: globalFoam.H:7
Point
CGAL::Point_3< K > Point
Definition: CGALIndexedPolyhedron.H:51
Foam::DelaunayMesh
The vertex and cell classes must have an index defined.
Definition: DelaunayMesh.H:60
Foam::DistributedDelaunayMesh::Point
Triangulation::Point Point
Definition: DistributedDelaunayMesh.H:64
Foam::DistributedDelaunayMesh::distributeBoundBoxes
bool distributeBoundBoxes(const boundBox &bb)
DelaunayMesh.H
Foam::DelaunayMesh< CellSizeDelaunay >::Vertex_handle
CellSizeDelaunay ::Vertex_handle Vertex_handle
Definition: DelaunayMesh.H:67
autoPtr.H