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 -------------------------------------------------------------------------------
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 \*---------------------------------------------------------------------------*/
27 
28 #include "Pstream.H"
29 
30 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31 
32 template<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 
45 template<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 
58 template<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 
75 template<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 
92 template<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 
111 template<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 
130 template<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 
143 template<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 
158 template<class Gt, class Vb>
160 {
161  return index_;
162 }
163 
164 
165 template<class Gt, class Vb>
166 inline Foam::label CGAL::indexedVertex<Gt, Vb>::index() const
167 {
168  return index_;
169 }
170 
171 
172 template<class Gt, class Vb>
175 {
176  return type_;
177 }
178 
179 
180 template<class Gt, class Vb>
183 {
184  return type_;
185 }
186 
187 
188 template<class Gt, class Vb>
190 {
191  return alignment_;
192 }
193 
194 
195 template<class Gt, class Vb>
197 {
198  return alignment_;
199 }
200 
201 
202 template<class Gt, class Vb>
204 {
205  return targetCellSize_;
206 }
207 
208 
209 template<class Gt, class Vb>
211 {
212  return targetCellSize_;
213 }
214 
215 
216 template<class Gt, class Vb>
218 {
219  return type_ == vtFar;
220 }
221 
222 
223 template<class Gt, class Vb>
225 {
226  return type_ == vtInternal || type_ == vtInternalNearBoundary;
227 }
228 
229 
230 template<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 
243 template<class Gt, class Vb>
245 {
246  return (internalPoint() || boundaryPoint()) && !referred();
247 }
248 
249 
250 template<class Gt, class Vb>
252 {
253  return processor_;
254 }
255 
256 
257 template<class Gt, class Vb>
259 {
260  return processor_;
261 }
262 
263 
264 template<class Gt, class Vb>
266 {
267  type_ = vtInternal;
268 }
269 
270 
271 template<class Gt, class Vb>
273 {
274  return type_ == vtInternalNearBoundary;
275 }
276 
277 
278 template<class Gt, class Vb>
280 {
281  type_ = vtInternalNearBoundary;
282 }
283 
284 
285 template<class Gt, class Vb>
287 {
288  return type_ >= vtInternalSurface && !farPoint();
289 }
290 
291 
292 template<class Gt, class Vb>
294 {
295  return internalPoint() || internalBoundaryPoint();
296 }
297 
298 
299 template<class Gt, class Vb>
301 {
302  return boundaryPoint() || nearBoundary();
303 }
304 
305 
306 template<class Gt, class Vb>
308 {
309  return type_ >= vtInternalSurface && type_ <= vtInternalFeaturePoint;
310 }
311 
312 template<class Gt, class Vb>
314 {
315  return (type_ == vtInternalSurfaceBaffle);
316 }
317 
318 template<class Gt, class Vb>
320 {
321  return (type_ == vtInternalFeatureEdgeBaffle);
322 }
323 
324 template<class Gt, class Vb>
326 {
327  return type_ >= vtExternalSurface && type_ <= vtExternalFeaturePoint;
328 }
329 
330 template<class Gt, class Vb>
332 {
333  return (type_ == vtExternalSurfaceBaffle);
334 }
335 
336 template<class Gt, class Vb>
338 {
339  return (type_ == vtExternalFeatureEdgeBaffle);
340 }
341 
342 
343 template<class Gt, class Vb>
345 {
346  return type_ == vtConstrained;
347 }
348 
349 
350 template<class Gt, class Vb>
352 {
353  return type_ == vtInternalFeaturePoint || type_ == vtExternalFeaturePoint;
354 }
355 
356 
357 template<class Gt, class Vb>
359 {
360  return type_ == vtInternalFeatureEdge || type_ == vtExternalFeatureEdge;
361 }
362 
363 
364 template<class Gt, class Vb>
366 {
367  return type_ == vtInternalSurface || type_ == vtExternalSurface;
368 }
369 
370 
371 template<class Gt, class Vb>
373 {
374  return vertexFixed_;
375 }
376 
377 
378 template<class Gt, class Vb>
380 {
381  return vertexFixed_;
382 }
383 
384 
385 // * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
Foam::Tensor< scalar >
CGAL::indexedVertex::alignment
Foam::tensor & alignment()
Definition: indexedVertexI.H:189
CGAL::indexedVertex::nearOrOnBoundary
bool nearOrOnBoundary() const
Is point near the boundary or part of the boundary definition.
Definition: indexedVertexI.H:300
p
volScalarField & p
Definition: createFieldRefs.H:8
CGAL::indexedVertex::setNearBoundary
void setNearBoundary()
Set the point to be near the boundary.
Definition: indexedVertexI.H:279
Vb
CGAL::indexedVertex< K > Vb
Definition: CGALTriangulation3Ddefs.H:48
CGAL::indexedVertex::type
vertexType & type()
Definition: indexedVertexI.H:174
CGAL::indexedVertex::Point
Vb::Point Point
Definition: indexedVertex.H:135
CGAL::indexedVertex::featureEdgePoint
bool featureEdgePoint() const
Part of a feature edge.
Definition: indexedVertexI.H:358
CGAL::indexedVertex::internalBoundaryPoint
bool internalBoundaryPoint() const
Definition: indexedVertexI.H:307
CGAL::indexedVertex::featurePoint
bool featurePoint() const
Part of a feature point.
Definition: indexedVertexI.H:351
CGAL::indexedVertex
An indexed form of CGAL::Triangulation_vertex_base_3<K> used to keep track of the Delaunay vertices i...
Definition: indexedVertex.H:54
CGAL::indexedVertex::indexedVertex
indexedVertex()
Definition: indexedVertexI.H:33
CGAL::indexedVertex::internalBaffleEdgePoint
bool internalBaffleEdgePoint() const
Definition: indexedVertexI.H:319
Foam::indexedVertexEnum::vertexType
vertexType
Definition: indexedVertexEnum.H:52
CGAL::indexedVertex::setInternal
void setInternal()
Set the point to be internal.
Definition: indexedVertexI.H:265
CGAL::indexedVertex::farPoint
bool farPoint() const
Is point a far-point.
Definition: indexedVertexI.H:217
CGAL::indexedVertex::fixed
bool fixed() const
Is the vertex fixed or movable.
Definition: indexedVertexI.H:372
Foam::triad::unset
static const triad unset
Definition: triad.H:100
CGAL::indexedVertex::index
Foam::label & index()
Definition: indexedVertexI.H:159
CGAL::indexedVertex::surfacePoint
bool surfacePoint() const
Part of a surface point pair.
Definition: indexedVertexI.H:365
CGAL::indexedVertex::targetCellSize
Foam::scalar & targetCellSize()
Definition: indexedVertexI.H:203
Pstream.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
CGAL::indexedVertex::externalBaffleEdgePoint
bool externalBaffleEdgePoint() const
Definition: indexedVertexI.H:337
Foam::UPstream::myProcNo
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Definition: UPstream.H:445
CGAL::indexedVertex::nearBoundary
bool nearBoundary() const
Is point internal and near the boundary.
Definition: indexedVertexI.H:272
CGAL::indexedVertex::internalBaffleSurfacePoint
bool internalBaffleSurfacePoint() const
Definition: indexedVertexI.H:313
CGAL::indexedVertex::referred
bool referred() const
Is this a referred vertex.
Definition: indexedVertexI.H:231
CGAL::indexedVertex::procIndex
int procIndex() const
Definition: indexedVertexI.H:251
f
labelList f(nPoints)
Foam::Vector< scalar >
CGAL::indexedVertex::internalPoint
bool internalPoint() const
Is point internal, i.e. not on boundary.
Definition: indexedVertexI.H:224
CGAL::indexedVertex::Cell_handle
Tds::Cell_handle Cell_handle
Definition: indexedVertex.H:137
CGAL::indexedVertex::externalBaffleSurfacePoint
bool externalBaffleSurfacePoint() const
Definition: indexedVertexI.H:331
Foam::roots::type
type
Types of root.
Definition: Roots.H:54
CGAL::indexedVertex::internalOrBoundaryPoint
bool internalOrBoundaryPoint() const
Either original internal point or master of pointPair.
Definition: indexedVertexI.H:293
Point
CGAL::Point_3< K > Point
Definition: CGALIndexedPolyhedron.H:53
CGAL::indexedVertex::externalBoundaryPoint
bool externalBoundaryPoint() const
Definition: indexedVertexI.H:325
CGAL::indexedVertex::boundaryPoint
bool boundaryPoint() const
Either master or slave of pointPair.
Definition: indexedVertexI.H:286
CGAL::indexedVertex::constrained
bool constrained() const
Definition: indexedVertexI.H:344
CGAL::indexedVertex::real
bool real() const
Is this a "real" point on this processor, i.e. is internal or part.
Definition: indexedVertexI.H:244