indexedVertexI.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-2015 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
26\*---------------------------------------------------------------------------*/
27
28#include "Pstream.H"
29
30// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31
32template<class Gt, class Vb>
34:
35 Vb(),
36 type_(vtUnassigned),
37 index_(-1),
38 processor_(Foam::Pstream::myProcNo()),
39 alignment_(Foam::triad::unset),
40 targetCellSize_(0.0),
41 vertexFixed_(false)
42{}
43
44
45template<class Gt, class Vb>
47:
48 Vb(p),
49 type_(vtUnassigned),
50 index_(-1),
51 processor_(Foam::Pstream::myProcNo()),
52 alignment_(Foam::triad::unset),
53 targetCellSize_(0.0),
54 vertexFixed_(false)
55{}
56
57
58template<class Gt, class Vb>
60(
61 const Point& p,
62 vertexType type
63)
64:
65 Vb(p),
66 type_(type),
67 index_(-1),
68 processor_(Foam::Pstream::myProcNo()),
69 alignment_(Foam::triad::unset),
70 targetCellSize_(0.0),
71 vertexFixed_(false)
72{}
73
74
75template<class Gt, class Vb>
77(
78 const Foam::point& p,
79 vertexType type
80)
81:
82 Vb(Point(p.x(), p.y(), p.z())),
83 type_(type),
84 index_(-1),
85 processor_(Foam::Pstream::myProcNo()),
86 alignment_(Foam::triad::unset),
87 targetCellSize_(0.0),
88 vertexFixed_(false)
89{}
90
91
92template<class Gt, class Vb>
94(
95 const Point& p,
96 Foam::label index,
97 vertexType type,
98 int processor
99)
100:
101 Vb(p),
102 type_(type),
103 index_(index),
104 processor_(processor),
105 alignment_(Foam::triad::unset),
106 targetCellSize_(0.0),
107 vertexFixed_(false)
108{}
109
110
111template<class Gt, class Vb>
113(
114 const Foam::point& p,
115 Foam::label index,
116 vertexType type,
117 int processor
118)
119:
120 Vb(Point(p.x(), p.y(), p.z())),
121 type_(type),
122 index_(index),
123 processor_(processor),
124 alignment_(Foam::triad::unset),
125 targetCellSize_(0.0),
126 vertexFixed_(false)
127{}
128
129
130template<class Gt, class Vb>
132:
133 Vb(f, p),
134 type_(vtUnassigned),
135 index_(-1),
136 processor_(Foam::Pstream::myProcNo()),
137 alignment_(Foam::triad::unset),
138 targetCellSize_(0.0),
139 vertexFixed_(false)
140{}
141
142
143template<class Gt, class Vb>
145:
146 Vb(f),
147 type_(vtUnassigned),
148 index_(-1),
149 processor_(Foam::Pstream::myProcNo()),
150 alignment_(Foam::triad::unset),
151 targetCellSize_(0.0),
152 vertexFixed_(false)
153{}
154
155
156// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
157
158template<class Gt, class Vb>
160{
161 return index_;
162}
163
164
165template<class Gt, class Vb>
166inline Foam::label CGAL::indexedVertex<Gt, Vb>::index() const
167{
168 return index_;
169}
170
171
172template<class Gt, class Vb>
175{
176 return type_;
177}
178
179
180template<class Gt, class Vb>
183{
184 return type_;
185}
186
187
188template<class Gt, class Vb>
190{
191 return alignment_;
192}
193
194
195template<class Gt, class Vb>
197{
198 return alignment_;
199}
200
201
202template<class Gt, class Vb>
204{
205 return targetCellSize_;
206}
207
208
209template<class Gt, class Vb>
211{
212 return targetCellSize_;
213}
214
215
216template<class Gt, class Vb>
218{
219 return type_ == vtFar;
220}
221
222
223template<class Gt, class Vb>
225{
226 return type_ == vtInternal || type_ == vtInternalNearBoundary;
227}
228
229
230template<class Gt, class Vb>
232{
233 // Can't be zero as the first few points are far points which won't be
234 // referred
235 //return index_ < 0;
236
237 // processor_ will be take the value of the processor that this vertex is
238 // from, so it cannot be on this processor.
239 return processor_ != Foam::Pstream::myProcNo();
240}
241
242
243template<class Gt, class Vb>
245{
246 return (internalPoint() || boundaryPoint()) && !referred();
247}
248
249
250template<class Gt, class Vb>
252{
253 return processor_;
254}
255
256
257template<class Gt, class Vb>
259{
260 return processor_;
261}
262
263
264template<class Gt, class Vb>
266{
267 type_ = vtInternal;
268}
269
270
271template<class Gt, class Vb>
273{
274 return type_ == vtInternalNearBoundary;
275}
276
277
278template<class Gt, class Vb>
280{
281 type_ = vtInternalNearBoundary;
282}
283
284
285template<class Gt, class Vb>
287{
288 return type_ >= vtInternalSurface && !farPoint();
289}
290
291
292template<class Gt, class Vb>
294{
295 return internalPoint() || internalBoundaryPoint();
296}
297
298
299template<class Gt, class Vb>
301{
302 return boundaryPoint() || nearBoundary();
303}
304
305
306template<class Gt, class Vb>
308{
309 return type_ >= vtInternalSurface && type_ <= vtInternalFeaturePoint;
310}
311
312template<class Gt, class Vb>
314{
315 return (type_ == vtInternalSurfaceBaffle);
316}
317
318template<class Gt, class Vb>
320{
321 return (type_ == vtInternalFeatureEdgeBaffle);
322}
323
324template<class Gt, class Vb>
326{
327 return type_ >= vtExternalSurface && type_ <= vtExternalFeaturePoint;
328}
329
330template<class Gt, class Vb>
332{
333 return (type_ == vtExternalSurfaceBaffle);
334}
335
336template<class Gt, class Vb>
338{
339 return (type_ == vtExternalFeatureEdgeBaffle);
340}
341
342
343template<class Gt, class Vb>
345{
346 return type_ == vtConstrained;
347}
348
349
350template<class Gt, class Vb>
352{
353 return type_ == vtInternalFeaturePoint || type_ == vtExternalFeaturePoint;
354}
355
356
357template<class Gt, class Vb>
359{
360 return type_ == vtInternalFeatureEdge || type_ == vtExternalFeatureEdge;
361}
362
363
364template<class Gt, class Vb>
366{
367 return type_ == vtInternalSurface || type_ == vtExternalSurface;
368}
369
370
371template<class Gt, class Vb>
373{
374 return vertexFixed_;
375}
376
377
378template<class Gt, class Vb>
380{
381 return vertexFixed_;
382}
383
384
385// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
scalar y
An indexed form of CGAL::Triangulation_vertex_base_3<K> used to keep track of the Delaunay vertices i...
Definition: indexedVertex.H:88
Foam::scalar & targetCellSize()
bool featureEdgePoint() const
Part of a feature edge.
vertexType & type()
bool internalBaffleEdgePoint() const
bool externalBoundaryPoint() const
bool fixed() const
Is the vertex fixed or movable.
bool constrained() const
bool boundaryPoint() const
Either master or slave of pointPair.
void setInternal()
Set the point to be internal.
bool featurePoint() const
Part of a feature point.
bool externalBaffleEdgePoint() const
bool nearBoundary() const
Is point internal and near the boundary.
void setNearBoundary()
Set the point to be near the boundary.
bool referred() const
Is this a referred vertex.
bool farPoint() const
Is point a far-point.
Tds::Cell_handle Cell_handle
bool internalOrBoundaryPoint() const
Either original internal point or master of pointPair.
bool nearOrOnBoundary() const
Is point near the boundary or part of the boundary definition.
Foam::label & index()
bool externalBaffleSurfacePoint() const
bool internalPoint() const
Is point internal, i.e. not on boundary.
bool internalBoundaryPoint() const
bool surfacePoint() const
Part of a surface point pair.
bool internalBaffleSurfacePoint() const
Foam::tensor & alignment()
bool real() const
Is this a "real" point on this processor, i.e. is internal or part.
int myProcNo() const noexcept
Return processor number.
volScalarField & p
Namespace for OpenFOAM.
labelList f(nPoints)