treeDataFace.C
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) 2011-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 "treeDataFace.H"
27 #include "polyMesh.H"
28 #include "triangleFuncs.H"
29 
30 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
31 
32 namespace Foam
33 {
34 defineTypeNameAndDebug(treeDataFace, 0);
35 
36 scalar treeDataFace::tolSqr = sqr(1e-6);
37 }
38 
39 
40 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
41 
43 {
44  const pointField& points = mesh_.points();
45 
46  const face& f = mesh_.faces()[faceI];
47 
48  treeBoundBox bb(points[f[0]], points[f[0]]);
49 
50  for (label fp = 1; fp < f.size(); fp++)
51  {
52  const point& p = points[f[fp]];
53 
54  bb.min() = min(bb.min(), p);
55  bb.max() = max(bb.max(), p);
56  }
57  return bb;
58 }
59 
60 
62 {
63  forAll(faceLabels_, i)
64  {
65  isTreeFace_.set(faceLabels_[i], 1);
66  }
67 
68  if (cacheBb_)
69  {
70  bbs_.setSize(faceLabels_.size());
71 
72  forAll(faceLabels_, i)
73  {
74  bbs_[i] = calcBb(faceLabels_[i]);
75  }
76  }
77 }
78 
79 
80 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
81 
83 (
84  const bool cacheBb,
85  const primitiveMesh& mesh,
86  const labelUList& faceLabels
87 )
88 :
89  mesh_(mesh),
90  faceLabels_(faceLabels),
91  isTreeFace_(mesh.nFaces(), 0),
92  cacheBb_(cacheBb)
93 {
94  update();
95 }
96 
97 
99 (
100  const bool cacheBb,
101  const primitiveMesh& mesh,
102  const Xfer<labelList>& faceLabels
103 )
104 :
105  mesh_(mesh),
106  faceLabels_(faceLabels),
107  isTreeFace_(mesh.nFaces(), 0),
108  cacheBb_(cacheBb)
109 {
110  update();
111 }
112 
113 
115 (
116  const bool cacheBb,
117  const primitiveMesh& mesh
118 )
119 :
120  mesh_(mesh),
121  faceLabels_(identity(mesh_.nFaces())),
122  isTreeFace_(mesh.nFaces(), 0),
123  cacheBb_(cacheBb)
124 {
125  update();
126 }
127 
128 
130 (
131  const bool cacheBb,
132  const polyPatch& patch
133 )
134 :
135  mesh_(patch.boundaryMesh().mesh()),
136  faceLabels_
137  (
138  identity(patch.size())
139  + patch.start()
140  ),
141  isTreeFace_(mesh_.nFaces(), 0),
142  cacheBb_(cacheBb)
143 {
144  update();
145 }
146 
147 
149 (
150  const indexedOctree<treeDataFace>& tree
151 )
152 :
153  tree_(tree)
154 {}
155 
156 
158 (
159  const indexedOctree<treeDataFace>& tree
160 )
161 :
162  tree_(tree)
163 {}
164 
165 
166 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
167 
169 {
170  pointField cc(faceLabels_.size());
171 
172  forAll(faceLabels_, i)
173  {
174  cc[i] = mesh_.faceCentres()[faceLabels_[i]];
175  }
176 
177  return cc;
178 }
179 
180 
181 //- Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
182 // Only makes sense for closed surfaces.
184 (
185  const indexedOctree<treeDataFace>& oc,
186  const point& sample
187 ) const
188 {
189  // Need to determine whether sample is 'inside' or 'outside'
190  // Done by finding nearest face. This gives back a face which is
191  // guaranteed to contain nearest point. This point can be
192  // - in interior of face: compare to face normal
193  // - on edge of face: compare to edge normal
194  // - on point of face: compare to point normal
195  // Unfortunately the octree does not give us back the intersection point
196  // or where on the face it has hit so we have to recreate all that
197  // information.
198 
199 
200  // Find nearest face to sample
201  pointIndexHit info = oc.findNearest(sample, sqr(GREAT));
202 
203  if (info.index() == -1)
204  {
206  << "Could not find " << sample << " in octree."
207  << abort(FatalError);
208  }
209 
210 
211  // Get actual intersection point on face
212  label faceI = faceLabels_[info.index()];
213 
214  if (debug & 2)
215  {
216  Pout<< "getSampleType : sample:" << sample
217  << " nearest face:" << faceI;
218  }
219 
220  const pointField& points = mesh_.points();
221 
222  // Retest to classify where on face info is. Note: could be improved. We
223  // already have point.
224 
225  const face& f = mesh_.faces()[faceI];
226  const vector& area = mesh_.faceAreas()[faceI];
227  const point& fc = mesh_.faceCentres()[faceI];
228 
229  pointHit curHit = f.nearestPoint(sample, points);
230  const point& curPt = curHit.rawPoint();
231 
232  //
233  // 1] Check whether sample is above face
234  //
235 
236  if (curHit.hit())
237  {
238  // Nearest point inside face. Compare to face normal.
239 
240  if (debug & 2)
241  {
242  Pout<< " -> face hit:" << curPt
243  << " comparing to face normal " << area << endl;
244  }
245  return indexedOctree<treeDataFace>::getSide(area, sample - curPt);
246  }
247 
248  if (debug & 2)
249  {
250  Pout<< " -> face miss:" << curPt;
251  }
252 
253  //
254  // 2] Check whether intersection is on one of the face vertices or
255  // face centre
256  //
257 
258  const scalar typDimSqr = mag(area) + VSMALL;
259 
260  forAll(f, fp)
261  {
262  if ((magSqr(points[f[fp]] - curPt)/typDimSqr) < tolSqr)
263  {
264  // Face intersection point equals face vertex fp
265 
266  // Calculate point normal (wrong: uses face normals instead of
267  // triangle normals)
268  const labelList& pFaces = mesh_.pointFaces()[f[fp]];
269 
270  vector pointNormal(vector::zero);
271 
272  forAll(pFaces, i)
273  {
274  if (isTreeFace_.get(pFaces[i]) == 1)
275  {
276  vector n = mesh_.faceAreas()[pFaces[i]];
277  n /= mag(n) + VSMALL;
278 
279  pointNormal += n;
280  }
281  }
282 
283  if (debug & 2)
284  {
285  Pout<< " -> face point hit :" << points[f[fp]]
286  << " point normal:" << pointNormal
287  << " distance:"
288  << magSqr(points[f[fp]] - curPt)/typDimSqr << endl;
289  }
291  (
292  pointNormal,
293  sample - curPt
294  );
295  }
296  }
297  if ((magSqr(fc - curPt)/typDimSqr) < tolSqr)
298  {
299  // Face intersection point equals face centre. Normal at face centre
300  // is already average of face normals
301 
302  if (debug & 2)
303  {
304  Pout<< " -> centre hit:" << fc
305  << " distance:" << magSqr(fc - curPt)/typDimSqr << endl;
306  }
307 
308  return indexedOctree<treeDataFace>::getSide(area, sample - curPt);
309  }
310 
311 
312 
313  //
314  // 3] Get the 'real' edge the face intersection is on
315  //
316 
317  const labelList& myEdges = mesh_.faceEdges()[faceI];
318 
319  forAll(myEdges, myEdgeI)
320  {
321  const edge& e = mesh_.edges()[myEdges[myEdgeI]];
322 
323  pointHit edgeHit =
325  (
326  points[e.start()],
327  points[e.end()]
328  ).nearestDist(sample);
329 
330 
331  if ((magSqr(edgeHit.rawPoint() - curPt)/typDimSqr) < tolSqr)
332  {
333  // Face intersection point lies on edge e
334 
335  // Calculate edge normal (wrong: uses face normals instead of
336  // triangle normals)
337  const labelList& eFaces = mesh_.edgeFaces()[myEdges[myEdgeI]];
338 
339  vector edgeNormal(vector::zero);
340 
341  forAll(eFaces, i)
342  {
343  if (isTreeFace_.get(eFaces[i]) == 1)
344  {
345  vector n = mesh_.faceAreas()[eFaces[i]];
346  n /= mag(n) + VSMALL;
347 
348  edgeNormal += n;
349  }
350  }
351 
352  if (debug & 2)
353  {
354  Pout<< " -> real edge hit point:" << edgeHit.rawPoint()
355  << " comparing to edge normal:" << edgeNormal
356  << endl;
357  }
358 
359  // Found face intersection point on this edge. Compare to edge
360  // normal
362  (
363  edgeNormal,
364  sample - curPt
365  );
366  }
367  }
368 
369 
370  //
371  // 4] Get the internal edge the face intersection is on
372  //
373 
374  forAll(f, fp)
375  {
377  (
378  points[f[fp]],
379  fc
380  ).nearestDist(sample);
381 
382  if ((magSqr(edgeHit.rawPoint() - curPt)/typDimSqr) < tolSqr)
383  {
384  // Face intersection point lies on edge between two face triangles
385 
386  // Calculate edge normal as average of the two triangle normals
387  vector e = points[f[fp]] - fc;
388  vector ePrev = points[f[f.rcIndex(fp)]] - fc;
389  vector eNext = points[f[f.fcIndex(fp)]] - fc;
390 
391  vector nLeft = ePrev ^ e;
392  nLeft /= mag(nLeft) + VSMALL;
393 
394  vector nRight = e ^ eNext;
395  nRight /= mag(nRight) + VSMALL;
396 
397  if (debug & 2)
398  {
399  Pout<< " -> internal edge hit point:" << edgeHit.rawPoint()
400  << " comparing to edge normal "
401  << 0.5*(nLeft + nRight)
402  << endl;
403  }
404 
405  // Found face intersection point on this edge. Compare to edge
406  // normal
408  (
409  0.5*(nLeft + nRight),
410  sample - curPt
411  );
412  }
413  }
414 
415  if (debug & 2)
416  {
417  Pout<< "Did not find sample " << sample
418  << " anywhere related to nearest face " << faceI << endl
419  << "Face:";
420 
421  forAll(f, fp)
422  {
423  Pout<< " vertex:" << f[fp] << " coord:" << points[f[fp]]
424  << endl;
425  }
426  }
427 
428  // Can't determine status of sample with respect to nearest face.
429  // Either
430  // - tolerances are wrong. (if e.g. face has zero area)
431  // - or (more likely) surface is not closed.
432 
433  return volumeType::UNKNOWN;
434 }
435 
436 
437 // Check if any point on shape is inside cubeBb.
439 (
440  const label index,
441  const treeBoundBox& cubeBb
442 ) const
443 {
444  // 1. Quick rejection: bb does not intersect face bb at all
445  if (cacheBb_)
446  {
447  if (!cubeBb.overlaps(bbs_[index]))
448  {
449  return false;
450  }
451  }
452  else
453  {
454  if (!cubeBb.overlaps(calcBb(faceLabels_[index])))
455  {
456  return false;
457  }
458  }
459 
460  const pointField& points = mesh_.points();
461 
462 
463  // 2. Check if one or more face points inside
464  label faceI = faceLabels_[index];
465 
466  const face& f = mesh_.faces()[faceI];
467  if (cubeBb.containsAny(points, f))
468  {
469  return true;
470  }
471 
472  // 3. Difficult case: all points are outside but connecting edges might
473  // go through cube. Use triangle-bounding box intersection.
474  const point& fc = mesh_.faceCentres()[faceI];
475 
476  forAll(f, fp)
477  {
478  bool triIntersects = triangleFuncs::intersectBb
479  (
480  points[f[fp]],
481  points[f[f.fcIndex(fp)]],
482  fc,
483  cubeBb
484  );
485 
486  if (triIntersects)
487  {
488  return true;
489  }
490  }
491  return false;
492 }
493 
494 
495 void Foam::treeDataFace::findNearestOp::operator()
496 (
497  const labelUList& indices,
498  const point& sample,
499 
500  scalar& nearestDistSqr,
501  label& minIndex,
502  point& nearestPoint
503 ) const
504 {
505  const treeDataFace& shape = tree_.shapes();
506 
507  forAll(indices, i)
508  {
509  const label index = indices[i];
510 
511  const face& f = shape.mesh().faces()[shape.faceLabels()[index]];
512 
513  pointHit nearHit = f.nearestPoint(sample, shape.mesh().points());
514  scalar distSqr = sqr(nearHit.distance());
515 
516  if (distSqr < nearestDistSqr)
517  {
518  nearestDistSqr = distSqr;
519  minIndex = index;
520  nearestPoint = nearHit.rawPoint();
521  }
522  }
523 }
524 
525 
526 void Foam::treeDataFace::findNearestOp::operator()
527 (
528  const labelUList& indices,
529  const linePointRef& ln,
530 
531  treeBoundBox& tightest,
532  label& minIndex,
533  point& linePoint,
534  point& nearestPoint
535 ) const
536 {
538 }
539 
540 
541 bool Foam::treeDataFace::findIntersectOp::operator()
542 (
543  const label index,
544  const point& start,
545  const point& end,
546  point& intersectionPoint
547 ) const
548 {
549  const treeDataFace& shape = tree_.shapes();
550 
551  // Do quick rejection test
552  if (shape.cacheBb_)
553  {
554  const treeBoundBox& faceBb = shape.bbs_[index];
555 
556  if ((faceBb.posBits(start) & faceBb.posBits(end)) != 0)
557  {
558  // start and end in same block outside of faceBb.
559  return false;
560  }
561  }
562 
563  const label faceI = shape.faceLabels_[index];
564 
565  const vector dir(end - start);
566 
567  pointHit inter = shape.mesh_.faces()[faceI].intersection
568  (
569  start,
570  dir,
571  shape.mesh_.faceCentres()[faceI],
572  shape.mesh_.points(),
574  );
575 
576  if (inter.hit() && inter.distance() <= 1)
577  {
578  // Note: no extra test on whether intersection is in front of us
579  // since using half_ray
580  intersectionPoint = inter.hitPoint();
581  return true;
582  }
583  else
584  {
585  return false;
586  }
587 }
588 
589 
590 // ************************************************************************* //
Foam::treeDataFace::update
void update()
Initialise all member data.
Definition: treeDataFace.C:61
Foam::PointIndexHit::index
label index() const
Return index.
Definition: PointIndexHit.H:111
Foam::Vector< scalar >::zero
static const Vector zero
Definition: Vector.H:80
Foam::PointHit::hit
bool hit() const
Is there a hit.
Definition: PointHit.H:120
p
p
Definition: pEqn.H:62
Foam::intersection::HALF_RAY
@ HALF_RAY
Definition: intersection.H:72
Foam::boundBox::max
const point & max() const
Maximum describing the bounding box.
Definition: boundBoxI.H:60
Foam::primitiveMesh::points
virtual const pointField & points() const =0
Return mesh points.
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::PointHit
This class describes the interaction of a face and a point. It carries the info of a successful hit a...
Definition: PointHit.H:51
Foam::primitiveMesh::faces
virtual const faceList & faces() const =0
Return faces.
Foam::treeDataFace::cacheBb_
const bool cacheBb_
Whether to precalculate and store face bounding box.
Definition: treeDataFace.H:78
Foam::PointHit::rawPoint
const Point & rawPoint() const
Return point with no checking.
Definition: PointHit.H:158
Foam::treeBoundBox
Standard boundBox + extra functionality for use in octree.
Definition: treeBoundBox.H:75
Foam::treeDataFace::getVolumeType
volumeType getVolumeType(const indexedOctree< treeDataFace > &, const point &) const
Get type (inside,outside,mixed,unknown) of point w.r.t. surface.
Definition: treeDataFace.C:184
Foam::edge
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Definition: edge.H:58
Foam::treeBoundBox::posBits
direction posBits(const point &) const
Position of point relative to bounding box.
Definition: treeBoundBox.C:469
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::treeDataFace::tolSqr
static scalar tolSqr
Tolerance on linear dimensions.
Definition: treeDataFace.H:63
Foam::treeDataFace::faceLabels
const labelList & faceLabels() const
Definition: treeDataFace.H:179
Foam::mag
dimensioned< scalar > mag(const dimensioned< Type > &)
polyMesh.H
Foam::treeDataFace::bbs_
treeBoundBoxList bbs_
Face bounding boxes (valid only if cacheBb_)
Definition: treeDataFace.H:81
Foam::treeDataFace::mesh
const primitiveMesh & mesh() const
Definition: treeDataFace.H:184
Foam::Xfer
A simple container for copying or transferring objects of type <T>.
Definition: Xfer.H:85
Foam::treeDataFace::calcBb
treeBoundBox calcBb(const label cellI) const
Calculate face bounding box.
Definition: treeDataFace.C:42
treeDataFace.H
pFaces
Info<< "Finished reading KIVA file"<< endl;cellShapeList cellShapes(nPoints);labelList cellZoning(nPoints, -1);const cellModel &hex=*(cellModeller::lookup("hex"));labelList hexLabels(8);label activeCells=0;labelList pointMap(nPoints);forAll(pointMap, i){ pointMap[i]=i;}for(label i=0;i< nPoints;i++){ if(f[i] > 0.0) { hexLabels[0]=i;hexLabels[1]=i1tab[i];hexLabels[2]=i3tab[i1tab[i]];hexLabels[3]=i3tab[i];hexLabels[4]=i8tab[i];hexLabels[5]=i1tab[i8tab[i]];hexLabels[6]=i3tab[i1tab[i8tab[i]]];hexLabels[7]=i3tab[i8tab[i]];cellShapes[activeCells]=cellShape(hex, hexLabels);edgeList edges=cellShapes[activeCells].edges();forAll(edges, ei) { if(edges[ei].mag(points)< SMALL) { label start=pointMap[edges[ei].start()];while(start !=pointMap[start]) { start=pointMap[start];} label end=pointMap[edges[ei].end()];while(end !=pointMap[end]) { end=pointMap[end];} label minLabel=min(start, end);pointMap[start]=pointMap[end]=minLabel;} } cellZoning[activeCells]=idreg[i];activeCells++;}}cellShapes.setSize(activeCells);cellZoning.setSize(activeCells);forAll(cellShapes, celli){ cellShape &cs=cellShapes[celli];forAll(cs, i) { cs[i]=pointMap[cs[i]];} cs.collapse();}label bcIDs[11]={-1, 0, 2, 4, -1, 5, -1, 6, 7, 8, 9};const label nBCs=12;const word *kivaPatchTypes[nBCs]={ &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &wallPolyPatch::typeName, &symmetryPolyPatch::typeName, &wedgePolyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &polyPatch::typeName, &symmetryPolyPatch::typeName, &oldCyclicPolyPatch::typeName};enum patchTypeNames{ PISTON, VALVE, LINER, CYLINDERHEAD, AXIS, WEDGE, INFLOW, OUTFLOW, PRESIN, PRESOUT, SYMMETRYPLANE, CYCLIC};const char *kivaPatchNames[nBCs]={ "piston", "valve", "liner", "cylinderHead", "axis", "wedge", "inflow", "outflow", "presin", "presout", "symmetryPlane", "cyclic"};List< SLList< face > > pFaces[nBCs]
Definition: readKivaGrid.H:235
Foam::triangleFuncs::intersectBb
static bool intersectBb(const point &p0, const point &p1, const point &p2, const treeBoundBox &cubeBb)
Does triangle intersect bounding box.
Definition: triangleFuncs.C:172
n
label n
Definition: TABSMDCalcMethod2.H:31
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:365
Foam::PointIndexHit
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
Definition: PointIndexHit.H:53
Foam::PointHit::distance
scalar distance() const
Return distance to hit.
Definition: PointHit.H:139
Foam::label
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
Foam::volumeType
Definition: volumeType.H:54
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::polyPatch::boundaryMesh
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
Definition: polyPatch.C:302
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Foam::indexedOctree
Non-pointer based hierarchical recursive searching.
Definition: treeDataTriSurface.H:47
Foam::boundBox::containsAny
bool containsAny(const UList< point > &) const
Contains any of the points? (inside or on edge)
Definition: boundBox.C:261
Foam::polyBoundaryMesh::mesh
const polyMesh & mesh() const
Return the mesh reference.
Definition: polyBoundaryMesh.H:140
Foam::boundBox::min
const point & min() const
Minimum describing the bounding box.
Definition: boundBoxI.H:54
Foam::identity
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
Definition: ListOps.C:104
Foam::FatalError
error FatalError
Foam::treeDataFace::faceLabels_
const labelList faceLabels_
Subset of faces to work on.
Definition: treeDataFace.H:72
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:131
triangleFuncs.H
Foam::e
const double e
Elementary charge.
Definition: doubleFloat.H:94
Foam::polyPatch::start
label start() const
Return start label of this patch in the polyMesh face list.
Definition: polyPatch.H:312
Foam::max
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::treeDataFace::treeDataFace
treeDataFace(const bool cacheBb, const primitiveMesh &, const labelUList &)
Construct from mesh and subset of faces.
Definition: treeDataFace.C:83
Foam::treeDataFace::shapePoints
pointField shapePoints() const
Get representative point cloud for all shapes inside.
Definition: treeDataFace.C:168
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:318
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:49
Foam::primitiveMesh::nFaces
label nFaces() const
Definition: primitiveMeshI.H:58
Foam::Pout
prefixOSstream Pout(cout, "Pout")
Definition: IOstreams.H:53
Foam::treeDataFace::overlaps
bool overlaps(const label index, const treeBoundBox &sampleBb) const
Does (bb of) shape at index overlap bb.
Definition: treeDataFace.C:439
f
labelList f(nPoints)
Foam::Vector< scalar >
Foam::indexedOctree::getSide
static volumeType getSide(const vector &outsideNormal, const vector &vec)
Helper function to return the side. Returns outside if.
Definition: indexedOctree.C:487
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::treeDataFace
Encapsulation of data needed to search for faces.
Definition: treeDataFace.H:58
Foam::primitiveMesh::faceCentres
const vectorField & faceCentres() const
Definition: primitiveMeshFaceCentresAndAreas.C:130
Foam::UList
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::line
A line primitive.
Definition: line.H:56
Foam::ln
bool ln(const fileName &src, const fileName &dst)
Create a softlink. dst should not exist. Returns true if successful.
Definition: POSIX.C:854
Foam::indexedOctree::findNearest
void findNearest(const label nodeI, const linePointRef &ln, treeBoundBox &tightest, label &nearestShapeI, point &linePoint, point &nearestPoint, const FindNearestOp &fnOp) const
Find nearest point to line.
Definition: indexedOctree.C:590
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75
Foam::treeBoundBox::overlaps
bool overlaps(const boundBox &) const
Overlaps other bounding box?
Definition: boundBoxI.H:120
Foam::treeDataFace::mesh_
const primitiveMesh & mesh_
Definition: treeDataFace.H:69
Foam::treeDataFace::findNearestOp::findNearestOp
findNearestOp(const indexedOctree< treeDataFace > &tree)
Definition: treeDataFace.C:149
Foam::line::nearestDist
PointHit< Point > nearestDist(const Point &p) const
Return nearest distance to line from a given point.
Definition: lineI.H:95
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::min
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::volumeType::UNKNOWN
@ UNKNOWN
Definition: volumeType.H:61
Foam::PointHit::hitPoint
const Point & hitPoint() const
Return hit point.
Definition: PointHit.H:126
Foam::magSqr
dimensioned< scalar > magSqr(const dimensioned< Type > &)
Foam::treeDataFace::findIntersectOp::findIntersectOp
findIntersectOp(const indexedOctree< treeDataFace > &tree)
Definition: treeDataFace.C:158
Foam::primitiveMesh
Cell-face mesh analysis engine.
Definition: primitiveMesh.H:79