indexedCell.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  CGAL::indexedCell
26 
27 Description
28  An indexed form of CGAL::Triangulation_cell_base_3<K> used to keep
29  track of the Delaunay cells (tets) in the tessellation.
30 
31 SourceFiles
32  indexedCellI.H
33  indexedCell.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef indexedCell_H
38 #define indexedCell_H
39 
40 #include "CGAL/Triangulation_3.h"
41 #include "CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h"
42 #include "indexedVertex.H"
43 #include "List.H"
44 #include "globalIndex.H"
45 #include "Pstream.H"
46 #include "Swap.H"
47 #include "InfoProxy.H"
48 #include "tetCell.H"
49 #include "typeInfo.H"
50 #include "vectorTools.H"
51 #include "indexedCellEnum.H"
52 
53 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 
55 namespace CGAL
56 {
57 template<class Gt, class Cb> class indexedCell;
58 }
59 
60 namespace Foam
61 {
62 class Ostream;
63 template<class Gt, class Cb> Ostream& operator<<
64 (
65  Ostream&,
67 );
68 }
69 
70 
71 namespace CGAL
72 {
73 
74 /*---------------------------------------------------------------------------*\
75  Class indexedCell Declaration
76 \*---------------------------------------------------------------------------*/
77 
78 template
79 <
80  class Gt,
81  class Cb=CGAL::Delaunay_triangulation_cell_base_with_circumcenter_3<Gt>
82 >
83 class indexedCell
84 :
85  public Foam::indexedCellEnum,
86  public Cb
87 {
88  // Private data
89 
90  //- The index for this Delaunay tetrahedral cell. Type information is
91  // also carried:
92  // ctFar : the dual point of this cell does not form part of the
93  // internal or boundary of the dual mesh
94  // >=0 : the (local) index of an internal or boundary dual point,
95  // not on a processor face
96  // < 0 && > ctFar : the (global) index of a dual point on a processor
97  // face
99 
100  //- The number of times that this Delaunay cell has been limited
101  // during filtering
102  int filterCount_;
103 
104 
105  // Private member functions
106 
107  //- Same as globallyOrderedCellVertices but without sorting
109  (
110  const Foam::globalIndex& globalDelaunayVertexIndices
111  ) const;
112 
113 
114 public:
115 
116  typedef typename Cb::Triangulation_data_structure Tds;
118  typedef typename Cb::Cell_handle Cell_handle;
119 
120  template<typename TDS2>
121  struct Rebind_TDS
122  {
123  typedef typename Cb::template Rebind_TDS<TDS2>::Other Cb2;
124  typedef indexedCell<Gt, Cb2> Other;
125  };
126 
127 
128  // Constructors
129 
130  inline indexedCell();
131 
132  inline indexedCell
133  (
134  Vertex_handle v0,
135  Vertex_handle v1,
136  Vertex_handle v2,
137  Vertex_handle v3
138  );
139 
140  inline indexedCell
141  (
142  Vertex_handle v0,
143  Vertex_handle v1,
144  Vertex_handle v2,
145  Vertex_handle v3,
146  Cell_handle n0,
147  Cell_handle n1,
148  Cell_handle n2,
149  Cell_handle n3
150  );
151 
152 
153  // Member Functions
154 
155  inline Foam::label& cellIndex();
156 
157  inline Foam::label cellIndex() const;
158 
159 #ifdef CGAL_INEXACT
160  inline const Foam::point& dual();
161 #else
162  inline const Foam::point dual();
163 #endif
164 
165  inline bool unassigned() const;
166 
167  inline int& filterCount();
168 
169  inline int filterCount() const;
170 
171  //- Is the Delaunay cell real, i.e. any real vertex
172  inline bool real() const;
173 
174  //- Does the Delaunay cell have a far point
175  inline bool hasFarPoint() const;
176 
177  //- Does the Delaunay cell have a referred point
178  inline bool hasReferredPoint() const;
179 
180  //- Does the Delaunay cell have a feature point
181  inline bool hasFeaturePoint() const;
182 
183  //- Does the Delaunay cell have a seed point
184  inline bool hasSeedPoint() const;
185 
186  inline bool hasInternalPoint() const;
187  inline bool hasBoundaryPoint() const;
188 
189  inline bool hasConstrainedPoint() const;
190 
191  //- Does the Dual vertex form part of a processor patch
192  inline bool parallelDualVertex() const;
193 
194  inline Foam::label vertexLowestProc() const;
195 
196  //- Using the globalIndex object, return a list of four (sorted) global
197  // Delaunay vertex indices that uniquely identify this tet in parallel
199  (
200  const Foam::globalIndex& globalDelaunayVertexIndices
201  ) const;
202 
203  //- Using the globalIndex object, return a list of four vertices with
204  // so that the cell has a consistent orientation in parallel.
206  (
207  const Foam::globalIndex& globalDelaunayVertexIndices
208  ) const;
209 
210  //- Is the Delaunay cell part of the final dual mesh, i.e. any vertex
211  // form part of the internal or boundary definition
212  inline bool internalOrBoundaryDualVertex() const;
213 
214  //- Is the Delaunay cell real or referred (or mixed), i.e. all vertices
215  // form part of the real or referred internal or boundary definition
216  inline bool anyInternalOrBoundaryDualVertex() const;
217 
218  //- A dual vertex on the boundary will result from a Delaunay cell with
219  // least one Delaunay vertex outside and at least one inside
220  inline bool boundaryDualVertex() const;
221 
222  inline bool baffleSurfaceDualVertex() const;
223 
224  inline bool baffleEdgeDualVertex() const;
225 
226  //- A dual vertex on a feature edge will result from this Delaunay cell
227  inline bool featureEdgeDualVertex() const;
228 
229  //- A dual vertex on a feature point will result from this Delaunay cell
230  inline bool featurePointDualVertex() const;
231 
232  inline bool nearProcBoundary() const;
233 
234  inline bool potentialCoplanarCell() const;
235 
236  inline bool featurePointExternalCell() const;
237  inline bool featurePointInternalCell() const;
238 
239 
240  // Info
241 
242  //- Return info proxy.
243  // Used to print indexedCell information to a stream
245  {
246  return *this;
247  }
248 
249  friend Foam::Ostream& Foam::operator<< <Gt, Cb>
250  (
251  Foam::Ostream&,
253  );
254 
255 };
256 
257 
258 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
259 
260 } // End namespace CGAL
261 
262 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
263 
264 #include "indexedCellI.H"
265 
266 #ifdef NoRepository
267  #include "indexedCell.C"
268 #endif
269 
270 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
271 
272 #endif
273 
274 // ************************************************************************* //
CGAL::indexedCell::boundaryDualVertex
bool boundaryDualVertex() const
A dual vertex on the boundary will result from a Delaunay cell with.
Definition: indexedCellI.H:403
CGAL::indexedCell::featureEdgeDualVertex
bool featureEdgeDualVertex() const
A dual vertex on a feature edge will result from this Delaunay cell.
Definition: indexedCellI.H:488
CGAL::indexedCell::hasConstrainedPoint
bool hasConstrainedPoint() const
Definition: indexedCellI.H:258
CGAL::indexedCell::hasBoundaryPoint
bool hasBoundaryPoint() const
Definition: indexedCellI.H:245
CGAL::indexedCell::globallyOrderedCellVertices
Foam::FixedList< Foam::label, 4 > globallyOrderedCellVertices(const Foam::globalIndex &globalDelaunayVertexIndices) const
Using the globalIndex object, return a list of four vertices with.
Definition: indexedCellI.H:340
List.H
Foam::indexedCellEnum
Definition: indexedCellEnum.H:45
CGAL::indexedCell::featurePointDualVertex
bool featurePointDualVertex() const
A dual vertex on a feature point will result from this Delaunay cell.
Definition: indexedCellI.H:526
Foam::InfoProxy
A helper class for outputting values to Ostream.
Definition: InfoProxy.H:45
CGAL::indexedCell::unsortedVertexGlobalIndices
Foam::tetCell unsortedVertexGlobalIndices(const Foam::globalIndex &globalDelaunayVertexIndices) const
Same as globallyOrderedCellVertices but without sorting.
Definition: indexedCellI.H:30
typeInfo.H
indexedCellEnum.H
CGAL::indexedCell::Tds
Cb::Triangulation_data_structure Tds
Definition: indexedCell.H:115
CGAL::indexedCell::dual
const Foam::point dual()
Definition: indexedCellI.H:121
InfoProxy.H
globalIndex.H
CGAL::indexedCell::hasFarPoint
bool hasFarPoint() const
Does the Delaunay cell have a far point.
Definition: indexedCellI.H:180
CGAL::indexedCell::unassigned
bool unassigned() const
Definition: indexedCellI.H:137
CGAL::indexedCell::real
bool real() const
Is the Delaunay cell real, i.e. any real vertex.
Definition: indexedCellI.H:158
CGAL
Definition: indexedCell.H:54
CGAL::indexedCell::filterCount
int & filterCount()
Definition: indexedCellI.H:144
CGAL::indexedCell::filterCount_
int filterCount_
The number of times that this Delaunay cell has been limited.
Definition: indexedCell.H:101
CGAL::indexedCell::baffleSurfaceDualVertex
bool baffleSurfaceDualVertex() const
Definition: indexedCellI.H:446
CGAL::indexedCell::potentialCoplanarCell
bool potentialCoplanarCell() const
Definition: indexedCellI.H:552
CGAL::indexedCell::baffleEdgeDualVertex
bool baffleEdgeDualVertex() const
Definition: indexedCellI.H:467
Swap.H
Swap its arguments.
CGAL::indexedCell::hasFeaturePoint
bool hasFeaturePoint() const
Does the Delaunay cell have a feature point.
Definition: indexedCellI.H:206
CGAL::indexedCell::parallelDualVertex
bool parallelDualVertex() const
Does the Dual vertex form part of a processor patch.
Definition: indexedCellI.H:271
CGAL::indexedCell::featurePointExternalCell
bool featurePointExternalCell() const
Definition: indexedCellI.H:642
CGAL::indexedCell::featurePointInternalCell
bool featurePointInternalCell() const
Definition: indexedCellI.H:704
CGAL::indexedCell::cellIndex
Foam::label & cellIndex()
Definition: indexedCellI.H:97
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
CGAL::indexedCell::index_
Foam::label index_
The index for this Delaunay tetrahedral cell. Type information is.
Definition: indexedCell.H:97
CGAL::indexedCell::Rebind_TDS::Other
indexedCell< Gt, Cb2 > Other
Definition: indexedCell.H:123
CGAL::indexedCell::hasReferredPoint
bool hasReferredPoint() const
Does the Delaunay cell have a referred point.
Definition: indexedCellI.H:193
CGAL::indexedCell::Vertex_handle
Cb::Vertex_handle Vertex_handle
Definition: indexedCell.H:116
CGAL::indexedCell::nearProcBoundary
bool nearProcBoundary() const
Definition: indexedCellI.H:539
indexedCellI.H
Pstream.H
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::globalIndex
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Definition: globalIndex.H:63
CGAL::indexedCell::anyInternalOrBoundaryDualVertex
bool anyInternalOrBoundaryDualVertex() const
Is the Delaunay cell real or referred (or mixed), i.e. all vertices.
Definition: indexedCellI.H:386
CGAL::indexedCell
An indexed form of CGAL::Triangulation_cell_base_3<K> used to keep track of the Delaunay cells (tets)...
Definition: indexedCell.H:56
Foam::Vector< scalar >
indexedCell.C
Foam::FixedList
A 1D vector of objects of type <T> with a fixed size <Size>.
Definition: FixedList.H:53
CGAL::indexedCell::hasInternalPoint
bool hasInternalPoint() const
Definition: indexedCellI.H:232
Foam::tetCell
A tetrahedral cell primitive.
Definition: tetCell.H:58
CGAL::indexedCell::Rebind_TDS
Definition: indexedCell.H:120
CGAL::indexedCell::Cell_handle
Cb::Cell_handle Cell_handle
Definition: indexedCell.H:117
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
CGAL::indexedCell::info
Foam::InfoProxy< indexedCell< Gt, Cb > > info() const
Return info proxy.
Definition: indexedCell.H:243
CGAL::indexedCell::Rebind_TDS::Cb2
Cb::template Rebind_TDS< TDS2 >::Other Cb2
Definition: indexedCell.H:122
vectorTools.H
CGAL::indexedCell::hasSeedPoint
bool hasSeedPoint() const
Does the Delaunay cell have a seed point.
Definition: indexedCellI.H:219
CGAL::indexedCell::internalOrBoundaryDualVertex
bool internalOrBoundaryDualVertex() const
Is the Delaunay cell part of the final dual mesh, i.e. any vertex.
Definition: indexedCellI.H:373
CGAL::indexedCell::vertexGlobalIndices
Foam::tetCell vertexGlobalIndices(const Foam::globalIndex &globalDelaunayVertexIndices) const
Using the globalIndex object, return a list of four (sorted) global.
Definition: indexedCellI.H:313
CGAL::indexedCell::vertexLowestProc
Foam::label vertexLowestProc() const
Definition: indexedCellI.H:295
tetCell.H
CGAL::indexedCell::indexedCell
indexedCell()
Definition: indexedCellI.H:55