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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2012-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  CGAL::indexedCell
28 
29 Description
30  An indexed form of CGAL::Triangulation_cell_base_3<K> used to keep
31  track of the Delaunay cells (tets) in the tessellation.
32 
33 SourceFiles
34  indexedCellI.H
35  indexedCell.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef indexedCell_H
40 #define indexedCell_H
41 
42 #include "CGAL/Triangulation_3.h"
43 #include "CGAL/Delaunay_triangulation_cell_base_with_circumcenter_3.h"
44 #include "indexedVertex.H"
45 #include "List.H"
46 #include "globalIndex.H"
47 #include "Pstream.H"
48 #include "Swap.H"
49 #include "InfoProxy.H"
50 #include "tetCell.H"
51 #include "typeInfo.H"
52 #include "vectorTools.H"
53 #include "indexedCellEnum.H"
54 
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56 
57 namespace CGAL
58 {
59 template<class Gt, class Cb> class indexedCell;
60 }
61 
62 namespace Foam
63 {
64 class Ostream;
65 template<class Gt, class Cb> Ostream& operator<<
66 (
67  Ostream&,
69 );
70 }
71 
72 
73 namespace CGAL
74 {
75 
76 /*---------------------------------------------------------------------------*\
77  Class indexedCell Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 template
81 <
82  class Gt,
83  class Cb=CGAL::Delaunay_triangulation_cell_base_with_circumcenter_3<Gt>
84 >
85 class indexedCell
86 :
87  public Foam::indexedCellEnum,
88  public Cb
89 {
90  // Private data
91 
92  //- The index for this Delaunay tetrahedral cell. Type information is
93  // also carried:
94  // ctFar : the dual point of this cell does not form part of the
95  // internal or boundary of the dual mesh
96  // >=0 : the (local) index of an internal or boundary dual point,
97  // not on a processor face
98  // < 0 && > ctFar : the (global) index of a dual point on a processor
99  // face
100  Foam::label index_;
101 
102  //- The number of times that this Delaunay cell has been limited
103  // during filtering
104  int filterCount_;
105 
106 
107  // Private member functions
108 
109  //- Same as globallyOrderedCellVertices but without sorting
110  Foam::tetCell unsortedVertexGlobalIndices
111  (
112  const Foam::globalIndex& globalDelaunayVertexIndices
113  ) const;
114 
115 
116 public:
117 
118  typedef typename Cb::Triangulation_data_structure Tds;
120  typedef typename Cb::Cell_handle Cell_handle;
121 
122  template<class TDS2>
123  struct Rebind_TDS
124  {
125  typedef typename Cb::template Rebind_TDS<TDS2>::Other Cb2;
126  typedef indexedCell<Gt, Cb2> Other;
127  };
128 
129 
130  // Constructors
131 
132  inline indexedCell();
133 
134  inline indexedCell
135  (
136  Vertex_handle v0,
137  Vertex_handle v1,
138  Vertex_handle v2,
139  Vertex_handle v3
140  );
141 
142  inline indexedCell
143  (
144  Vertex_handle v0,
145  Vertex_handle v1,
146  Vertex_handle v2,
147  Vertex_handle v3,
148  Cell_handle n0,
149  Cell_handle n1,
150  Cell_handle n2,
151  Cell_handle n3
152  );
153 
154 
155  // Member Functions
156 
157  inline Foam::label& cellIndex();
158 
159  inline Foam::label cellIndex() const;
160 
161 #ifdef CGAL_INEXACT
162  inline const Foam::point& dual();
163 #else
164  inline const Foam::point dual();
165 #endif
166 
167  inline bool unassigned() const;
168 
169  inline int& filterCount();
170 
171  inline int filterCount() const;
172 
173  //- Is the Delaunay cell real, i.e. any real vertex
174  inline bool real() const;
175 
176  //- Does the Delaunay cell have a far point
177  inline bool hasFarPoint() const;
178 
179  //- Does the Delaunay cell have a referred point
180  inline bool hasReferredPoint() const;
181 
182  //- Does the Delaunay cell have a feature point
183  inline bool hasFeaturePoint() const;
184 
185  //- Does the Delaunay cell have a seed point
186  inline bool hasSeedPoint() const;
187 
188  inline bool hasInternalPoint() const;
189  inline bool hasBoundaryPoint() const;
190 
191  inline bool hasConstrainedPoint() const;
192 
193  //- Does the Dual vertex form part of a processor patch
194  inline bool parallelDualVertex() const;
195 
196  inline Foam::label vertexLowestProc() const;
197 
198  //- Using the globalIndex object, return a list of four (sorted) global
199  // Delaunay vertex indices that uniquely identify this tet in parallel
201  (
202  const Foam::globalIndex& globalDelaunayVertexIndices
203  ) const;
204 
205  //- Using the globalIndex object, return a list of four vertices with
206  // so that the cell has a consistent orientation in parallel.
208  (
209  const Foam::globalIndex& globalDelaunayVertexIndices
210  ) const;
211 
212  //- Is the Delaunay cell part of the final dual mesh, i.e. any vertex
213  // form part of the internal or boundary definition
214  inline bool internalOrBoundaryDualVertex() const;
215 
216  //- Is the Delaunay cell real or referred (or mixed), i.e. all vertices
217  // form part of the real or referred internal or boundary definition
218  inline bool anyInternalOrBoundaryDualVertex() const;
219 
220  //- A dual vertex on the boundary will result from a Delaunay cell with
221  // least one Delaunay vertex outside and at least one inside
222  inline bool boundaryDualVertex() const;
223 
224  inline bool baffleSurfaceDualVertex() const;
225 
226  inline bool baffleEdgeDualVertex() const;
227 
228  //- A dual vertex on a feature edge will result from this Delaunay cell
229  inline bool featureEdgeDualVertex() const;
230 
231  //- A dual vertex on a feature point will result from this Delaunay cell
232  inline bool featurePointDualVertex() const;
233 
234  inline bool nearProcBoundary() const;
235 
236  inline bool potentialCoplanarCell() const;
237 
238  inline bool featurePointExternalCell() const;
239  inline bool featurePointInternalCell() const;
240 
241 
242  // Info
243 
244  //- Return info proxy.
245  // Used to print indexedCell information to a stream
247  {
248  return *this;
249  }
250 
251  friend Foam::Ostream& Foam::operator<< <Gt, Cb>
252  (
253  Foam::Ostream&,
255  );
256 
257 };
258 
259 
260 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
261 
262 } // End namespace CGAL
263 
264 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
265 
266 #include "indexedCellI.H"
267 
268 #ifdef NoRepository
269  #include "indexedCell.C"
270 #endif
271 
272 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
273 
274 #endif
275 
276 // ************************************************************************* //
CGAL::indexedCell::boundaryDualVertex
bool boundaryDualVertex() const
A dual vertex on the boundary will result from a Delaunay cell with.
Definition: indexedCellI.H:404
CGAL::indexedCell::featureEdgeDualVertex
bool featureEdgeDualVertex() const
A dual vertex on a feature edge will result from this Delaunay cell.
Definition: indexedCellI.H:489
CGAL::indexedCell::hasConstrainedPoint
bool hasConstrainedPoint() const
Definition: indexedCellI.H:259
CGAL::indexedCell::hasBoundaryPoint
bool hasBoundaryPoint() const
Definition: indexedCellI.H:246
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:341
List.H
Foam::indexedCellEnum
Definition: indexedCellEnum.H:49
CGAL::indexedCell::featurePointDualVertex
bool featurePointDualVertex() const
A dual vertex on a feature point will result from this Delaunay cell.
Definition: indexedCellI.H:527
Foam::InfoProxy
A helper class for outputting values to Ostream.
Definition: InfoProxy.H:47
typeInfo.H
indexedCellEnum.H
CGAL::indexedCell::Tds
Cb::Triangulation_data_structure Tds
Definition: indexedCell.H:117
CGAL::indexedCell::dual
const Foam::point dual()
Definition: indexedCellI.H:122
InfoProxy.H
globalIndex.H
CGAL::indexedCell::hasFarPoint
bool hasFarPoint() const
Does the Delaunay cell have a far point.
Definition: indexedCellI.H:181
CGAL::indexedCell::unassigned
bool unassigned() const
Definition: indexedCellI.H:138
CGAL::indexedCell::real
bool real() const
Is the Delaunay cell real, i.e. any real vertex.
Definition: indexedCellI.H:159
CGAL
Definition: indexedCell.H:56
CGAL::indexedCell::filterCount
int & filterCount()
Definition: indexedCellI.H:145
CGAL::indexedCell::baffleSurfaceDualVertex
bool baffleSurfaceDualVertex() const
Definition: indexedCellI.H:447
CGAL::indexedCell::potentialCoplanarCell
bool potentialCoplanarCell() const
Definition: indexedCellI.H:553
CGAL::indexedCell::baffleEdgeDualVertex
bool baffleEdgeDualVertex() const
Definition: indexedCellI.H:468
Swap.H
Swap arguments as per std::swap, but in Foam namespace.
CGAL::indexedCell::hasFeaturePoint
bool hasFeaturePoint() const
Does the Delaunay cell have a feature point.
Definition: indexedCellI.H:207
CGAL::indexedCell::parallelDualVertex
bool parallelDualVertex() const
Does the Dual vertex form part of a processor patch.
Definition: indexedCellI.H:272
CGAL::indexedCell::featurePointExternalCell
bool featurePointExternalCell() const
Definition: indexedCellI.H:643
CGAL::indexedCell::featurePointInternalCell
bool featurePointInternalCell() const
Definition: indexedCellI.H:705
CGAL::indexedCell::cellIndex
Foam::label & cellIndex()
Definition: indexedCellI.H:98
CGAL::indexedCell::Rebind_TDS::Other
indexedCell< Gt, Cb2 > Other
Definition: indexedCell.H:125
CGAL::indexedCell::hasReferredPoint
bool hasReferredPoint() const
Does the Delaunay cell have a referred point.
Definition: indexedCellI.H:194
CGAL::indexedCell::Vertex_handle
Cb::Vertex_handle Vertex_handle
Definition: indexedCell.H:118
CGAL::indexedCell::nearProcBoundary
bool nearProcBoundary() const
Definition: indexedCellI.H:540
indexedCellI.H
Pstream.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::globalIndex
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Definition: globalIndex.H:68
CGAL::indexedCell::anyInternalOrBoundaryDualVertex
bool anyInternalOrBoundaryDualVertex() const
Is the Delaunay cell real or referred (or mixed), i.e. all vertices.
Definition: indexedCellI.H:387
CGAL::indexedCell
An indexed form of CGAL::Triangulation_cell_base_3<K> used to keep track of the Delaunay cells (tets)...
Definition: indexedCell.H:58
Foam::Vector< scalar >
indexedCell.C
Foam::FixedList
A 1D vector of objects of type <T> with a fixed length <N>.
Definition: HashTable.H:104
CGAL::indexedCell::hasInternalPoint
bool hasInternalPoint() const
Definition: indexedCellI.H:233
Foam::tetCell
A tetrahedral cell primitive.
Definition: tetCell.H:64
CGAL::indexedCell::Rebind_TDS
Definition: indexedCell.H:122
CGAL::indexedCell::Cell_handle
Cb::Cell_handle Cell_handle
Definition: indexedCell.H:119
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
CGAL::indexedCell::info
Foam::InfoProxy< indexedCell< Gt, Cb > > info() const
Return info proxy.
Definition: indexedCell.H:245
CGAL::indexedCell::Rebind_TDS::Cb2
Cb::template Rebind_TDS< TDS2 >::Other Cb2
Definition: indexedCell.H:124
vectorTools.H
CGAL::indexedCell::hasSeedPoint
bool hasSeedPoint() const
Does the Delaunay cell have a seed point.
Definition: indexedCellI.H:220
CGAL::indexedCell::internalOrBoundaryDualVertex
bool internalOrBoundaryDualVertex() const
Is the Delaunay cell part of the final dual mesh, i.e. any vertex.
Definition: indexedCellI.H:374
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:314
CGAL::indexedCell::vertexLowestProc
Foam::label vertexLowestProc() const
Definition: indexedCellI.H:296
tetCell.H
CGAL::indexedCell::indexedCell
indexedCell()
Definition: indexedCellI.H:56