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