triSurfaceMesh.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-2016 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 "triSurfaceMesh.H"
27 #include "Random.H"
29 #include "EdgeMap.H"
30 #include "triSurfaceFields.H"
31 #include "Time.H"
32 #include "PatchTools.H"
33 
34 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
35 
36 namespace Foam
37 {
38 
39 defineTypeNameAndDebug(triSurfaceMesh, 0);
40 addToRunTimeSelectionTable(searchableSurface, triSurfaceMesh, dict);
41 
42 }
43 
44 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
45 
48 //Foam::word Foam::triSurfaceMesh::findRawInstance
49 //(
50 // const Time& runTime,
51 // const fileName& dir,
52 // const word& name
53 //)
54 //{
55 // // Check current time first
56 // if (isFile(runTime.path()/runTime.timeName()/dir/name))
57 // {
58 // return runTime.timeName();
59 // }
60 // instantList ts = runTime.times();
61 // label instanceI;
62 //
63 // for (instanceI = ts.size()-1; instanceI >= 0; --instanceI)
64 // {
65 // if (ts[instanceI].value() <= runTime.timeOutputValue())
66 // {
67 // break;
68 // }
69 // }
70 //
71 // // continue searching from here
72 // for (; instanceI >= 0; --instanceI)
73 // {
74 // if (isFile(runTime.path()/ts[instanceI].name()/dir/name))
75 // {
76 // return ts[instanceI].name();
77 // }
78 // }
79 //
80 //
81 // // not in any of the time directories, try constant
82 //
83 // // Note. This needs to be a hard-coded constant, rather than the
84 // // constant function of the time, because the latter points to
85 // // the case constant directory in parallel cases
86 //
87 // if (isFile(runTime.path()/runTime.constant()/dir/name))
88 // {
89 // return runTime.constant();
90 // }
91 //
92 // FatalErrorInFunction
93 // << "Cannot find file \"" << name << "\" in directory "
94 // << runTime.constant()/dir
95 // << exit(FatalError);
96 //
97 // return runTime.constant();
98 //}
99 
100 
101 const Foam::fileName& Foam::triSurfaceMesh::checkFile
102 (
103  const fileName& fName,
104  const fileName& objectName
105 )
106 {
107  if (fName.empty())
108  {
110  << "Cannot find triSurfaceMesh starting from "
111  << objectName << exit(FatalError);
112  }
113  return fName;
114 }
115 
116 
117 bool Foam::triSurfaceMesh::addFaceToEdge
118 (
119  const edge& e,
120  EdgeMap<label>& facesPerEdge
121 )
122 {
123  EdgeMap<label>::iterator eFnd = facesPerEdge.find(e);
124  if (eFnd != facesPerEdge.end())
125  {
126  if (eFnd() == 2)
127  {
128  return false;
129  }
130  eFnd()++;
131  }
132  else
133  {
134  facesPerEdge.insert(e, 1);
135  }
136  return true;
137 }
138 
139 
140 bool Foam::triSurfaceMesh::isSurfaceClosed() const
141 {
142  const pointField& pts = triSurface::points();
143 
144  // Construct pointFaces. Let's hope surface has compact point
145  // numbering ...
146  labelListList pointFaces;
147  invertManyToMany(pts.size(), *this, pointFaces);
148 
149  // Loop over all faces surrounding point. Count edges emanating from point.
150  // Every edge should be used by two faces exactly.
151  // To prevent doing work twice per edge only look at edges to higher
152  // point
153  EdgeMap<label> facesPerEdge(100);
154  forAll(pointFaces, pointi)
155  {
156  const labelList& pFaces = pointFaces[pointi];
157 
158  facesPerEdge.clear();
159  forAll(pFaces, i)
160  {
161  const triSurface::FaceType& f = triSurface::operator[](pFaces[i]);
162  label fp = findIndex(f, pointi);
163 
164  // Something weird: if I expand the code of addFaceToEdge in both
165  // below instances it gives a segmentation violation on some
166  // surfaces. Compiler (4.3.2) problem?
167 
168 
169  // Forward edge
170  label nextPointi = f[f.fcIndex(fp)];
171 
172  if (nextPointi > pointi)
173  {
174  bool okFace = addFaceToEdge
175  (
176  edge(pointi, nextPointi),
177  facesPerEdge
178  );
179 
180  if (!okFace)
181  {
182  return false;
183  }
184  }
185  // Reverse edge
186  label prevPointi = f[f.rcIndex(fp)];
187 
188  if (prevPointi > pointi)
189  {
190  bool okFace = addFaceToEdge
191  (
192  edge(pointi, prevPointi),
193  facesPerEdge
194  );
195 
196  if (!okFace)
197  {
198  return false;
199  }
200  }
201  }
202 
203  // Check for any edges used only once.
204  forAllConstIter(EdgeMap<label>, facesPerEdge, iter)
205  {
206  if (iter() != 2)
207  {
208  return false;
209  }
210  }
211  }
212 
213  return true;
214 }
215 
216 
217 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
218 
219 Foam::triSurfaceMesh::triSurfaceMesh(const IOobject& io, const triSurface& s)
220 :
221  searchableSurface(io),
223  (
224  IOobject
225  (
226  io.name(),
227  io.instance(),
228  io.local(),
229  io.db(),
230  io.readOpt(),
231  io.writeOpt(),
232  false // searchableSurface already registered under name
233  )
234  ),
235  triSurface(s),
237  minQuality_(-1),
238  surfaceClosed_(-1)
239 {
240  const pointField& pts = triSurface::points();
241 
242  bounds() = boundBox(pts);
243 }
244 
245 
246 Foam::triSurfaceMesh::triSurfaceMesh(const IOobject& io)
247 :
248  // Find instance for triSurfaceMesh
249  searchableSurface(io),
250  //(
251  // IOobject
252  // (
253  // io.name(),
254  // io.time().findInstance(io.local(), word::null),
255  // io.local(),
256  // io.db(),
257  // io.readOpt(),
258  // io.writeOpt(),
259  // io.registerObject()
260  // )
261  //),
262  // Reused found instance in objectRegistry
264  (
265  IOobject
266  (
267  io.name(),
268  static_cast<const searchableSurface&>(*this).instance(),
269  io.local(),
270  io.db(),
271  io.readOpt(),
272  io.writeOpt(),
273  false // searchableSurface already registered under name
274  )
275  ),
276  triSurface
277  (
278  checkFile
279  (
282  )
283  ),
284  triSurfaceRegionSearch(static_cast<const triSurface&>(*this)),
285  minQuality_(-1),
286  surfaceClosed_(-1)
287 {
288  const pointField& pts = triSurface::points();
289 
290  bounds() = boundBox(pts);
291 }
292 
293 
294 Foam::triSurfaceMesh::triSurfaceMesh
295 (
296  const IOobject& io,
297  const dictionary& dict
298 )
299 :
300  searchableSurface(io),
301  //(
302  // IOobject
303  // (
304  // io.name(),
305  // io.time().findInstance(io.local(), word::null),
306  // io.local(),
307  // io.db(),
308  // io.readOpt(),
309  // io.writeOpt(),
310  // io.registerObject()
311  // )
312  //),
313  // Reused found instance in objectRegistry
315  (
316  IOobject
317  (
318  io.name(),
319  static_cast<const searchableSurface&>(*this).instance(),
320  io.local(),
321  io.db(),
322  io.readOpt(),
323  io.writeOpt(),
324  false // searchableSurface already registered under name
325  )
326  ),
327  triSurface
328  (
329  checkFile
330  (
333  )
334  ),
335  triSurfaceRegionSearch(static_cast<const triSurface&>(*this), dict),
336  minQuality_(-1),
337  surfaceClosed_(-1)
338 {
339  scalar scaleFactor = 0;
340 
341  // allow rescaling of the surface points
342  // eg, CAD geometries are often done in millimeters
343  if (dict.readIfPresent("scale", scaleFactor) && scaleFactor > 0)
344  {
345  Info<< searchableSurface::name() << " : using scale " << scaleFactor
346  << endl;
347  triSurface::scalePoints(scaleFactor);
348  }
349 
350  const pointField& pts = triSurface::points();
351 
352  bounds() = boundBox(pts);
353 
354  // Have optional minimum quality for normal calculation
355  if (dict.readIfPresent("minQuality", minQuality_) && minQuality_ > 0)
356  {
358  << " : ignoring triangles with quality < "
359  << minQuality_ << " for normals calculation." << endl;
360  }
361 }
362 
363 
364 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
365 
367 {
368  clearOut();
369 }
370 
371 
373 {
375  edgeTree_.clear();
377 }
378 
379 
380 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
381 
383 {
384  tmp<pointField> tPts(new pointField(8));
385  pointField& pt = tPts.ref();
386 
387  // Use copy to calculate face centres so they don't get stored
389  (
392  ).faceCentres();
393 
394  return tPts;
395 }
396 
397 
399 (
400  pointField& centres,
401  scalarField& radiusSqr
402 ) const
403 {
404  centres = coordinates();
405  radiusSqr.setSize(size());
406  radiusSqr = 0.0;
407 
408  const pointField& pts = triSurface::points();
409 
410  forAll(*this, facei)
411  {
412  const labelledTri& f = triSurface::operator[](facei);
413  const point& fc = centres[facei];
414  forAll(f, fp)
415  {
416  const point& pt = pts[f[fp]];
417  radiusSqr[facei] = max(radiusSqr[facei], Foam::magSqr(fc-pt));
418  }
419  }
420 
421  // Add a bit to make sure all points are tested inside
422  radiusSqr += Foam::sqr(SMALL);
423 }
424 
425 
427 {
428  return triSurface::points();
429 }
430 
431 
433 {
434  const indexedOctree<treeDataTriSurface>& octree = tree();
435 
436  labelList indices = octree.findBox(treeBoundBox(bb));
437 
438  return !indices.empty();
439 }
440 
441 
443 {
445  edgeTree_.clear();
446  triSurface::movePoints(newPoints);
447 }
448 
449 
452 {
453  if (edgeTree_.empty())
454  {
455  // Boundary edges
456  labelList bEdges
457  (
458  identity
459  (
460  nEdges()
461  -nInternalEdges()
462  )
463  + nInternalEdges()
464  );
465 
466  treeBoundBox bb(Zero, Zero);
467 
468  if (bEdges.size())
469  {
470  label nPoints;
472  (
473  static_cast<const triSurface&>(*this),
474  bb,
475  nPoints
476  );
477 
478  // Random number generator. Bit dodgy since not exactly random ;-)
479  Random rndGen(65431);
480 
481  // Slightly extended bb. Slightly off-centred just so on symmetric
482  // geometry there are less face/edge aligned items.
483 
484  bb = bb.extend(rndGen, 1e-4);
485  bb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
486  bb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
487  }
488 
489  scalar oldTol = indexedOctree<treeDataEdge>::perturbTol();
491 
492  edgeTree_.reset
493  (
495  (
497  (
498  false, // cachebb
499  edges(), // edges
500  localPoints(), // points
501  bEdges // selected edges
502  ),
503  bb, // bb
504  maxTreeDepth(), // maxLevel
505  10, // leafsize
506  3.0 // duplicity
507  )
508  );
509 
511  }
512  return edgeTree_();
513 }
514 
515 
517 {
518  if (regions_.empty())
519  {
520  regions_.setSize(patches().size());
521  forAll(regions_, regionI)
522  {
523  regions_[regionI] = patches()[regionI].name();
524  }
525  }
526  return regions_;
527 }
528 
529 
530 // Find out if surface is closed.
532 {
533  if (surfaceClosed_ == -1)
534  {
535  if (isSurfaceClosed())
536  {
537  surfaceClosed_ = 1;
538  }
539  else
540  {
541  surfaceClosed_ = 0;
542  }
543  }
544 
545  return surfaceClosed_ == 1;
546 }
547 
548 
550 (
551  const pointField& samples,
552  const scalarField& nearestDistSqr,
553  List<pointIndexHit>& info
554 ) const
555 {
556  triSurfaceSearch::findNearest(samples, nearestDistSqr, info);
557 }
558 
559 
561 (
562  const pointField& samples,
563  const scalarField& nearestDistSqr,
564  const labelList& regionIndices,
565  List<pointIndexHit>& info
566 ) const
567 {
569  (
570  samples,
571  nearestDistSqr,
572  regionIndices,
573  info
574  );
575 }
576 
577 
579 (
580  const pointField& start,
581  const pointField& end,
582  List<pointIndexHit>& info
583 ) const
584 {
585  triSurfaceSearch::findLine(start, end, info);
586 }
587 
588 
590 (
591  const pointField& start,
592  const pointField& end,
593  List<pointIndexHit>& info
594 ) const
595 {
596  triSurfaceSearch::findLineAny(start, end, info);
597 }
598 
599 
601 (
602  const pointField& start,
603  const pointField& end,
605 ) const
606 {
607  triSurfaceSearch::findLineAll(start, end, info);
608 }
609 
610 
612 (
613  const List<pointIndexHit>& info,
614  labelList& region
615 ) const
616 {
617  region.setSize(info.size());
618  forAll(info, i)
619  {
620  if (info[i].hit())
621  {
622  region[i] = triSurface::operator[](info[i].index()).region();
623  }
624  else
625  {
626  region[i] = -1;
627  }
628  }
629 }
630 
631 
633 (
634  const List<pointIndexHit>& info,
635  vectorField& normal
636 ) const
637 {
638  const triSurface& s = static_cast<const triSurface&>(*this);
639  const pointField& pts = s.points();
640 
641  normal.setSize(info.size());
642 
643  if (minQuality_ >= 0)
644  {
645  // Make sure we don't use triangles with low quality since
646  // normal is not reliable.
647 
648  const labelListList& faceFaces = s.faceFaces();
649 
650  forAll(info, i)
651  {
652  if (info[i].hit())
653  {
654  label facei = info[i].index();
655  normal[i] = s[facei].normal(pts);
656 
657  scalar qual = s[facei].tri(pts).quality();
658 
659  if (qual < minQuality_)
660  {
661  // Search neighbouring triangles
662  const labelList& fFaces = faceFaces[facei];
663 
664  forAll(fFaces, j)
665  {
666  label nbrI = fFaces[j];
667  scalar nbrQual = s[nbrI].tri(pts).quality();
668  if (nbrQual > qual)
669  {
670  qual = nbrQual;
671  normal[i] = s[nbrI].normal(pts);
672  }
673  }
674  }
675 
676  normal[i] /= mag(normal[i]) + VSMALL;
677  }
678  else
679  {
680  // Set to what?
681  normal[i] = Zero;
682  }
683  }
684  }
685  else
686  {
687  forAll(info, i)
688  {
689  if (info[i].hit())
690  {
691  label facei = info[i].index();
692  // Cached:
693  //normal[i] = faceNormals()[facei];
694 
695  // Uncached
696  normal[i] = s[facei].normal(pts);
697  normal[i] /= mag(normal[i]) + VSMALL;
698  }
699  else
700  {
701  // Set to what?
702  normal[i] = Zero;
703  }
704  }
705  }
706 }
707 
708 
710 {
712  (
714  (
715  IOobject
716  (
717  "values",
718  objectRegistry::time().timeName(), // instance
719  "triSurface", // local
720  *this,
723  ),
724  *this,
725  dimless,
726  labelField(values)
727  )
728  );
729 
730  // Store field on triMesh
731  fldPtr.ptr()->store();
732 }
733 
734 
736 (
737  const List<pointIndexHit>& info,
738  labelList& values
739 ) const
740 {
741  if (foundObject<triSurfaceLabelField>("values"))
742  {
743  values.setSize(info.size());
744 
745  const triSurfaceLabelField& fld = lookupObject<triSurfaceLabelField>
746  (
747  "values"
748  );
749 
750  forAll(info, i)
751  {
752  if (info[i].hit())
753  {
754  values[i] = fld[info[i].index()];
755  }
756  }
757  }
758 }
759 
760 
762 (
763  const pointField& points,
764  List<volumeType>& volType
765 ) const
766 {
767  volType.setSize(points.size());
768 
771 
772  forAll(points, pointi)
773  {
774  const point& pt = points[pointi];
775 
776  if (!tree().bb().contains(pt))
777  {
778  // Have to calculate directly as outside the octree
779  volType[pointi] = tree().shapes().getVolumeType(tree(), pt);
780  }
781  else
782  {
783  // - use cached volume type per each tree node
784  volType[pointi] = tree().getVolumeType(pt);
785  }
786  }
787 
789 }
790 
791 
793 (
797 ) const
798 {
800 
801  if (!mkDir(fullPath.path()))
802  {
803  return false;
804  }
805 
806  triSurface::write(fullPath);
807 
808  if (!isFile(fullPath))
809  {
810  return false;
811  }
812 
813  return true;
814 }
815 
816 
817 // ************************************************************************* //
cachedRandom rndGen(label(0),-1)
const Time & time() const
Return time.
virtual void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit >> &) const
Get all intersections in order from start to end.
List< labelList > labelListList
A List of labelList.
Definition: labelList.H:57
label nPoints() const
Return number of points supporting patch faces.
Field< label > labelField
Specialisation of Field<T> for label.
Definition: labelField.H:49
fileName objectPath() const
Return complete path + object name.
Definition: IOobject.H:363
virtual void boundingSpheres(pointField &centres, scalarField &radiusSqr) const
Get bounding spheres (centre and radius squared). Any point.
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:428
void findNearest(const pointField &samples, const scalarField &nearestDistSqr, const labelList &regionIndices, List< pointIndexHit > &info) const
Find the nearest point on the surface out of the regions.
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
A class for handling file names.
Definition: fileName.H:69
const boundBox & bounds() const
Return const reference to boundBox.
const objectRegistry & db() const
Return the local objectRegistry.
Definition: IOobject.C:221
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
void clearOut()
Clear storage.
const point & min() const
Minimum describing the bounding box.
Definition: boundBoxI.H:54
error FatalError
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
T & operator[](const label)
Return element of UList.
Definition: UListI.H:167
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
bool empty() const
Return true if the UList is empty (ie, size() is zero)
Definition: UListI.H:313
virtual void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Find first intersection on segment from start to end.
Fields for triSurface.
virtual ~triSurfaceMesh()
Destructor.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void findLineAny(const pointField &start, const pointField &end, List< pointIndexHit > &info) const
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:76
virtual tmp< pointField > points() const
Get the points that define the surface.
virtual label size() const
Range of local indices that can be returned.
bool isFile(const fileName &, const bool checkGzip=true)
Does the name exist as a FILE in the file system?
Definition: POSIX.C:492
treeBoundBox extend(Random &, const scalar s) const
Return slightly wider bounding box.
virtual void setField(const labelList &values)
WIP. Store element-wise field.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:253
static scalar & perturbTol()
Get the perturbation tolerance.
const Field< point > & points() const
Return reference to global points.
Helper class to search on triSurface. Creates an octree for each region of the surface and only searc...
Holds data for octree to work on an edges subset.
Definition: treeDataEdge.H:53
virtual void findLineAny(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Return any intersection on segment from start to end.
const point & max() const
Maximum describing the bounding box.
Definition: boundBoxI.H:60
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
Definition: ListOps.C:104
virtual void findNearest(const pointField &sample, const scalarField &nearestDistSqr, List< pointIndexHit > &) const
A bounding box defined in terms of the points at its extremities.
Definition: boundBox.H:58
const indexedOctree< treeDataTriSurface > & tree() const
Demand driven construction of the octree.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines. WIP.
virtual void scalePoints(const scalar)
Scale points. A non-positive factor is ignored.
Definition: triSurface.C:801
T * ptr()
Return object pointer for reuse.
Definition: autoPtrI.H:90
writeOption writeOpt() const
Definition: IOobject.H:314
Macros for easy insertion into run-time selection tables.
label maxTreeDepth() const
Return max tree depth of octree.
virtual void movePoints(const pointField &)
Move points.
Definition: triSurface.C:788
void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit >> &info) const
Calculate all intersections from start to end.
A list of faces which address into the list of points.
void findNearest(const pointField &samples, const scalarField &nearestDistSqr, List< pointIndexHit > &info) const
A List obtained as a section of another List.
Definition: SubList.H:53
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:42
virtual bool writeObject(IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp) const
Write using given format, version and compression.
scalar tolerance() const
Return tolerance to use in searches.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
fileName filePath() const
Return complete path + object name if the file exists.
Definition: IOobject.C:299
virtual const wordList & regions() const
Names of regions.
void clear()
Clear the list, i.e. set size to zero.
Definition: List.C:356
virtual void getRegion(const List< pointIndexHit > &, labelList &region) const
From a set of points and indices get the region.
const geometricSurfacePatchList & patches() const
Definition: triSurface.H:314
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
const edgeList & edges() const
Return list of edges, address into LOCAL point list.
streamFormat
Enumeration for the format of data in the stream.
Definition: IOstream.H:86
static void calcBounds(const PrimitivePatch< Face, FaceList, PointField, PointType > &p, boundBox &bb, label &nPoints)
word timeName
Definition: getTimeIndex.H:3
List< label > labelList
A List of labels.
Definition: labelList.H:56
const fileName & local() const
Definition: IOobject.H:347
static const zero Zero
Definition: zero.H:91
virtual void getNormal(const List< pointIndexHit > &, vectorField &normal) const
From a set of points and indices get the normal.
Triangle with additional region number.
Definition: labelledTri.H:57
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:29
virtual bool hasVolumeType() const
Whether supports volume type below. I.e. whether is closed.
Simple random number generator.
Definition: Random.H:49
compressionType
Enumeration for the format of data in the stream.
Definition: IOstream.H:193
dimensioned< scalar > magSqr(const dimensioned< Type > &)
virtual bool overlaps(const boundBox &bb) const
Does any part of the surface overlap the supplied bound box?
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
const Field< point > & faceCentres() const
Return face centres for patch.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
Definition: POSIX.C:295
label size() const
Return the number of elements in the UList.
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
const labelListList & faceFaces() const
Return face-face addressing.
label nEdges() const
Return number of edges in patch.
void setSize(const label)
Reset size of List.
Definition: List.C:295
triSurface()
Construct null.
Definition: triSurface.C:594
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
vector point
Point is a vector.
Definition: point.H:41
Non-pointer based hierarchical recursive searching.
Definition: treeDataEdge.H:47
virtual void movePoints(const pointField &)
Move points.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
readOption readOpt() const
Definition: IOobject.H:304
void invertManyToMany(const label len, const UList< InList > &, List< OutList > &)
Invert many-to-many.
void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &info) const
Version number type.
Definition: IOstream.H:96
Standard boundBox + extra functionality for use in octree.
Definition: treeBoundBox.H:87
messageStream Info
dimensioned< scalar > mag(const dimensioned< Type > &)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
virtual void getVolumeType(const pointField &, List< volumeType > &) const
Determine type (inside/outside/mixed) for point. unknown if.
A class for managing temporary objects.
Definition: PtrList.H:54
Registry of regIOobjects.
friend class iterator
Declare friendship with the iterator.
Definition: HashTable.H:189
Triangulated surface description with patch information.
Definition: triSurface.H:65
T & ref() const
Return non-const reference or generate a fatal error.
Definition: tmpI.H:174
virtual tmp< pointField > coordinates() const
Get representative set of element coordinates.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
fileName path() const
Return directory path name (part before last /)
Definition: fileName.C:249
const fileName & instance() const
Definition: IOobject.H:337
const Field< point > & localPoints() const
Return pointField of points in patch.
const indexedOctree< treeDataEdge > & edgeTree() const
Demand driven construction of octree for boundary edges.
const word & name() const
Return name.
Definition: IOobject.H:260
virtual void getField(const List< pointIndexHit > &, labelList &) const
WIP. From a set of hits (points and.
Namespace for OpenFOAM.