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