sampledMeshedSurface.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2016-2022 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "sampledMeshedSurface.H"
30 #include "meshSearch.H"
31 #include "Tuple2.H"
32 #include "globalIndex.H"
33 #include "treeDataCell.H"
34 #include "treeDataFace.H"
35 #include "meshTools.H"
37 
38 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
39 
40 const Foam::Enum
41 <
43 >
44 Foam::sampledMeshedSurface::samplingSourceNames_
45 ({
46  { samplingSource::cells, "cells" },
47  { samplingSource::insideCells, "insideCells" },
48  { samplingSource::boundaryFaces, "boundaryFaces" },
49 });
50 
51 
52 namespace Foam
53 {
54  defineTypeNameAndDebug(sampledMeshedSurface, 0);
55  // Use shorter name only
57  (
58  sampledSurface,
59  sampledMeshedSurface,
60  word,
62  );
63  // Compatibility name (1912)
65  (
66  sampledSurface,
67  sampledMeshedSurface,
68  word,
69  sampledTriSurfaceMesh
70  );
71 
72 } // End namespace Foam
73 
74 
75 // * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 
80 // The IOobject for reading
81 inline static IOobject selectReadIO(const word& name, const Time& runTime)
82 {
83  return IOobject
84  (
85  name,
86  runTime.constant(), // instance
87  "triSurface", // local
88  runTime, // registry
92  );
93 }
94 
95 } // End namespace Foam
96 
97 
98 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
99 
100 void Foam::sampledMeshedSurface::setZoneMap()
101 {
102  // Populate zoneIds_ based on surfZone information
103 
104  const meshedSurface& s = static_cast<const meshedSurface&>(*this);
105 
106  const auto& zones = s.surfZones();
107 
108  zoneIds_.resize(s.size());
109 
110  // Trivial case
111  if (zoneIds_.empty() || zones.size() <= 1)
112  {
113  zoneIds_ = 0;
114  return;
115  }
116 
117 
118  label beg = 0;
119 
120  forAll(zones, zonei)
121  {
122  const label len = min(zones[zonei].size(), zoneIds_.size() - beg);
123 
124  // Assign sub-zone Ids
125  SubList<label>(zoneIds_, len, beg) = zonei;
126 
127  beg += len;
128  }
129 
130  // Anything remaining? Should not happen
131  {
132  const label len = (zoneIds_.size() - beg);
133 
134  if (len > 0)
135  {
136  SubList<label>(zoneIds_, len, beg) = max(0, zones.size()-1);
137  }
138  }
139 }
140 
141 
142 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
143 
144 bool Foam::sampledMeshedSurface::update(const meshSearch& meshSearcher)
145 {
146  // Global numbering for cells/faces
147  // - only used to uniquely identify local elements
148  globalIndex globalCells(onBoundary() ? mesh().nFaces() : mesh().nCells());
149 
150  // Find the cells the triangles of the surface are in.
151  // Does approximation by looking at the face centres only
152  const pointField& fc = surface_.faceCentres();
153 
154  // sqr(distance), global index
155  typedef Tuple2<scalar, label> nearInfo;
156  List<nearInfo> nearest(fc.size(), nearInfo(Foam::sqr(GREAT), labelMax));
157 
158  if (sampleSource_ == samplingSource::cells)
159  {
160  // Search for nearest cell
161 
162  const auto& cellTree = meshSearcher.cellTree();
163  const auto& treeData = cellTree.shapes();
164 
165  forAll(fc, facei)
166  {
167  const point& pt = fc[facei];
168  auto& near = nearest[facei];
169 
170  pointIndexHit info = cellTree.findNearest(pt, Foam::sqr(GREAT));
171 
172  if (info.hit())
173  {
174  const label objectIndex = treeData.objectIndex(info.index());
175 
176  near.first() = info.point().distSqr(pt);
177  near.second() = globalCells.toGlobal(objectIndex);
178  }
179  }
180  }
181  else if (sampleSource_ == samplingSource::insideCells)
182  {
183  // Search for cell containing point
184 
185  const auto& cellTree = meshSearcher.cellTree();
186  const auto& treeData = cellTree.shapes();
187 
188  forAll(fc, facei)
189  {
190  const point& pt = fc[facei];
191  auto& near = nearest[facei];
192 
193  if (cellTree.bb().contains(pt))
194  {
195  const label index = cellTree.findInside(pt);
196 
197  if (index != -1)
198  {
199  const label objectIndex = treeData.objectIndex(index);
200 
201  near.first() = 0;
202  near.second() = globalCells.toGlobal(objectIndex);
203  }
204  }
205  }
206  }
207  else // samplingSource::boundaryFaces
208  {
209  // Search for nearest boundary face
210  // on all non-coupled boundary faces
211 
212  const auto& bndTree = meshSearcher.nonCoupledBoundaryTree();
213  const auto& treeData = bndTree.shapes();
214 
215  forAll(fc, facei)
216  {
217  const point& pt = fc[facei];
218  auto& near = nearest[facei];
219 
220  pointIndexHit info = bndTree.findNearest(pt, sqr(GREAT));
221 
222  if (info.hit())
223  {
224  const label objectIndex = treeData.objectIndex(info.index());
225 
226  near.first() = info.point().distSqr(pt);
227  near.second() = globalCells.toGlobal(objectIndex);
228  }
229  }
230  }
231 
232 
233  // See which processor has the nearest. Mark and subset
234  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
235 
236  Pstream::listCombineReduce(nearest, minFirstEqOp<scalar>{});
237 
238  labelList cellOrFaceLabels(fc.size(), -1);
239 
240  bitSet facesToSubset(fc.size());
241 
242  forAll(nearest, facei)
243  {
244  const auto& near = nearest[facei];
245 
246  const label index = near.second();
247 
248  if (index == labelMax)
249  {
250  // Not found on any processor, or simply too far.
251  // How to map?
252  }
253  else if (globalCells.isLocal(index))
254  {
255  facesToSubset.set(facei);
256 
257  // Mark as special if too far away
258  cellOrFaceLabels[facei] =
259  (
260  (near.first() < maxDistanceSqr_)
261  ? globalCells.toLocal(index)
262  : -1
263  );
264  }
265  }
266 
267 
268  if (debug)
269  {
270  Pout<< "Local out of faces:" << cellOrFaceLabels.size()
271  << " keeping:" << facesToSubset.count() << endl;
272  }
273 
274 
275  // Subset the surface
276  meshedSurface& s = static_cast<meshedSurface&>(*this);
277 
278  labelList pointMap;
280 
281  s = surface_.subsetMesh(facesToSubset, pointMap, faceMap);
282 
283 
284  // Ensure zoneIds_ are indeed correct
285  setZoneMap();
286 
287 
288  // Subset cellOrFaceLabels (for compact faces)
289  cellOrFaceLabels = labelUIndList(cellOrFaceLabels, faceMap)();
290 
291 
292  // Collect the samplePoints and sampleElements
293  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
294 
296  {
297  // With point interpolation
298 
299  samplePoints_ = points();
300  sampleElements_.resize(pointMap.size(), -1);
301 
302  // Store any face per point (without using pointFaces())
303  labelList pointToFace(std::move(pointMap));
304 
305  forAll(s, facei)
306  {
307  const face& f = s[facei];
308 
309  for (const label labi : f)
310  {
311  pointToFace[labi] = facei;
312  }
313  }
314 
315 
316  if (sampleSource_ == samplingSource::cells)
317  {
318  // sampleElements_ : per surface point, the cell
319  // samplePoints_ : per surface point, a location inside the cell
320 
321  forAll(samplePoints_, pointi)
322  {
323  // Use _copy_ of point
324  const point pt = samplePoints_[pointi];
325 
326  const label celli = cellOrFaceLabels[pointToFace[pointi]];
327 
328  sampleElements_[pointi] = celli;
329 
330  if
331  (
332  celli >= 0
333  && !mesh().pointInCell(pt, celli, meshSearcher.decompMode())
334  )
335  {
336  // Point not inside cell
337  // Find nearest point on faces of cell
338 
339  scalar minDistSqr = VGREAT;
340 
341  for (const label facei : mesh().cells()[celli])
342  {
343  const face& f = mesh().faces()[facei];
344 
345  pointHit info =
346  f.nearestPoint
347  (
348  pt,
349  mesh().points()
350  );
351 
352  if (info.distance() < minDistSqr)
353  {
354  minDistSqr = info.distance();
355  samplePoints_[pointi] = info.point();
356  }
357  }
358  }
359  }
360  }
361  else if (sampleSource_ == samplingSource::insideCells)
362  {
363  // sampleElements_ : per surface point the cell
364  // samplePoints_ : per surface point a location inside the cell
365 
366  forAll(samplePoints_, pointi)
367  {
368  const label celli = cellOrFaceLabels[pointToFace[pointi]];
369 
370  sampleElements_[pointi] = celli;
371  }
372  }
373  else // samplingSource::boundaryFaces
374  {
375  // sampleElements_ : per surface point, the boundary face containing
376  // the location
377  // samplePoints_ : per surface point, a location on the boundary
378 
379  forAll(samplePoints_, pointi)
380  {
381  const point& pt = samplePoints_[pointi];
382 
383  const label facei = cellOrFaceLabels[pointToFace[pointi]];
384 
385  sampleElements_[pointi] = facei;
386 
387  if (facei >= 0)
388  {
389  samplePoints_[pointi] =
390  mesh().faces()[facei].nearestPoint
391  (
392  pt,
393  mesh().points()
394  ).point();
395  }
396  }
397  }
398  }
399  else
400  {
401  // if sampleSource_ == cells:
402  // sampleElements_ : per surface face, the cell
403  // samplePoints_ : n/a
404  // if sampleSource_ == insideCells:
405  // sampleElements_ : -1 or per surface face, the cell
406  // samplePoints_ : n/a
407  // if sampleSource_ == boundaryFaces:
408  // sampleElements_ : per surface face, the boundary face
409  // samplePoints_ : n/a
410 
411  sampleElements_.transfer(cellOrFaceLabels);
412  samplePoints_.clear();
413  }
414 
415 
416  if (debug)
417  {
418  this->clearOut();
419  OFstream str(mesh().time().path()/"surfaceToMesh.obj");
420  Info<< "Dumping correspondence from local surface (points or faces)"
421  << " to mesh (cells or faces) to " << str.name() << endl;
422 
423  const vectorField& centres =
424  (
425  onBoundary()
426  ? mesh().faceCentres()
427  : mesh().cellCentres()
428  );
429 
431  {
432  label vertI = 0;
433  forAll(samplePoints_, pointi)
434  {
435  meshTools::writeOBJ(str, points()[pointi]);
436  ++vertI;
437 
438  meshTools::writeOBJ(str, samplePoints_[pointi]);
439  ++vertI;
440 
441  label elemi = sampleElements_[pointi];
442  meshTools::writeOBJ(str, centres[elemi]);
443  ++vertI;
444  str << "l " << vertI-2 << ' ' << vertI-1 << ' ' << vertI << nl;
445  }
446  }
447  else
448  {
449  label vertI = 0;
450  forAll(sampleElements_, triI)
451  {
452  meshTools::writeOBJ(str, faceCentres()[triI]);
453  ++vertI;
454 
455  label elemi = sampleElements_[triI];
456  meshTools::writeOBJ(str, centres[elemi]);
457  ++vertI;
458  str << "l " << vertI-1 << ' ' << vertI << nl;
459  }
460  }
461  }
462 
463  needsUpdate_ = false;
464  return true;
465 }
466 
467 
468 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
469 
471 (
472  const word& name,
473  const polyMesh& mesh,
474  const word& surfaceName,
475  const samplingSource sampleSource
476 )
477 :
479  meshedSurface(),
480  surfaceName_(surfaceName),
481  surface_
482  (
483  selectReadIO(surfaceName, mesh.time()),
484  dictionary::null
485  ),
486  sampleSource_(sampleSource),
487  needsUpdate_(true),
488  keepIds_(true),
489  zoneIds_(),
490  sampleElements_(),
491  samplePoints_(),
492  maxDistanceSqr_(Foam::sqr(GREAT)),
493  defaultValues_()
494 {}
495 
496 
498 (
499  const word& name,
500  const polyMesh& mesh,
501  const dictionary& dict
502 )
503 :
505  meshedSurface(),
506  surfaceName_
507  (
508  meshedSurface::findFile
509  (
510  selectReadIO(dict.get<word>("surface"), mesh.time()),
511  dict
512  ).name()
513  ),
514  surface_
515  (
516  selectReadIO(dict.get<word>("surface"), mesh.time()),
517  dict
518  ),
519  sampleSource_(samplingSourceNames_.get("source", dict)),
520  needsUpdate_(true),
521  keepIds_(dict.getOrDefault("keepIds", true)),
522  zoneIds_(),
523  sampleElements_(),
524  samplePoints_(),
525  maxDistanceSqr_(Foam::sqr(GREAT)),
526  defaultValues_(dict.subOrEmptyDict("defaultValue"))
527 {
528  if (dict.readIfPresent("maxDistance", maxDistanceSqr_))
529  {
530  // Info<< "Limit to maxDistance " << maxDistanceSqr_ << nl;
531  // if (defaultValues_.empty())
532  // {
533  // Info<< "defaultValues = zero" << nl;
534  // }
535  // else
536  // {
537  // defaultValues_.writeEntry(Info);
538  // }
539 
540  maxDistanceSqr_ = Foam::sqr(maxDistanceSqr_);
541  }
542 
543  wordRes includePatches;
544  dict.readIfPresent("patches", includePatches);
545  includePatches.uniq();
546 
547  // Could also shift this to the reader itself,
548  // but not yet necessary.
549 
550  if (!includePatches.empty())
551  {
552  Info<< "Subsetting surface " << surfaceName_
553  << " to patches: " << flatOutput(includePatches) << nl;
554 
555  const surfZoneList& zones = surface_.surfZones();
556 
557  const labelList zoneIndices
558  (
560  (
561  zones,
562  includePatches,
563  wordRes(),
564  nameOp<surfZone>()
565  )
566  );
567 
568  // Faces to subset
569  bitSet includeMap(surface_.size());
570 
571  for (const label zonei : zoneIndices)
572  {
573  const surfZone& zn = zones[zonei];
574  includeMap.set(zn.range());
575  }
576 
577  if (includeMap.none())
578  {
580  << "Patch selection results in an empty surface"
581  << " - ignoring" << nl;
582  }
583  else if (!includeMap.all())
584  {
585  meshedSurface subSurf(surface_.subsetMesh(includeMap));
586 
587  if (subSurf.empty())
588  {
590  << "Bad surface subset (empty)"
591  << " - skip and hope for the best" << nl;
592  }
593  else
594  {
595  // Replace
596  surface_.transfer(subSurf);
597  }
598  }
599  }
600 }
601 
602 
603 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
606 {
607  return needsUpdate_;
608 }
609 
610 
612 {
613  // already marked as expired
614  if (needsUpdate_)
615  {
616  return false;
617  }
618 
621  zoneIds_.clear();
622 
623  sampleElements_.clear();
624  samplePoints_.clear();
625 
626  needsUpdate_ = true;
627  return true;
628 }
629 
630 
632 {
633  if (!needsUpdate_)
634  {
635  return false;
636  }
637 
638  // Calculate surface and mesh overlap bounding box
639  treeBoundBox bb(surface_.points(), surface_.meshPoints());
640 
641  // Restrict surface to (global!) mesh bound box
642  bb &= mesh().bounds();
643 
644  if (bb.good())
645  {
646  // Extend a bit
647  bb.grow(0.5*bb.span());
648  bb.inflate(1e-6);
649  }
650  else
651  {
652  // Surface and mesh do not overlap at all. Guarantee a valid
653  // bounding box so we don't get any 'invalid bounding box' errors.
654 
656  << "Surface " << surfaceName_
657  << " does not overlap bounding box of mesh " << mesh().bounds()
658  << endl;
659 
660  bb.reset(mesh().bounds().centre());
661  bb.grow(1e-6*mesh().bounds().span());
662  }
663 
664  // Mesh search engine, no triangulation of faces.
665  meshSearch meshSearcher(mesh(), bb, polyMesh::FACE_PLANES);
666 
667  return update(meshSearcher);
668 }
669 
670 
672 {
673  if (!needsUpdate_)
674  {
675  return false;
676  }
677 
678  // Mesh search engine on subset, no triangulation of faces.
679  meshSearch meshSearcher(mesh(), bb, polyMesh::FACE_PLANES);
680 
681  return update(meshSearcher);
682 }
683 
684 
686 (
687  const interpolation<scalar>& sampler
688 ) const
689 {
690  return sampleOnFaces(sampler);
691 }
692 
693 
695 (
696  const interpolation<vector>& sampler
697 ) const
698 {
699  return sampleOnFaces(sampler);
700 }
701 
702 
704 (
705  const interpolation<sphericalTensor>& sampler
706 ) const
707 {
708  return sampleOnFaces(sampler);
709 }
710 
711 
713 (
714  const interpolation<symmTensor>& sampler
715 ) const
716 {
717  return sampleOnFaces(sampler);
718 }
719 
720 
722 (
723  const interpolation<tensor>& sampler
724 ) const
725 {
726  return sampleOnFaces(sampler);
727 }
728 
729 
731 (
732  const interpolation<scalar>& interpolator
733 ) const
734 {
735  return sampleOnPoints(interpolator);
736 }
737 
738 
740 (
741  const interpolation<vector>& interpolator
742 ) const
743 {
744  return sampleOnPoints(interpolator);
745 }
746 
748 (
749  const interpolation<sphericalTensor>& interpolator
750 ) const
751 {
752  return sampleOnPoints(interpolator);
753 }
754 
755 
757 (
758  const interpolation<symmTensor>& interpolator
759 ) const
760 {
761  return sampleOnPoints(interpolator);
762 }
763 
764 
766 (
767  const interpolation<tensor>& interpolator
768 ) const
769 {
770  return sampleOnPoints(interpolator);
771 }
772 
773 
774 void Foam::sampledMeshedSurface::print(Ostream& os, int level) const
775 {
776  os << "meshedSurface: " << name() << " :"
777  << " surface:" << surfaceName_;
778 
779  if (level)
780  {
781  os << " faces:" << faces().size()
782  << " points:" << points().size()
783  << " zoneids:" << zoneIds().size();
784  }
785 }
786 
787 
788 // ************************************************************************* //
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
Definition: meshSearch.H:56
dictionary dict
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:116
bool interpolate() const noexcept
Same as isPointData()
void resize(const label len)
Adjust allocated size of list.
Definition: ListI.H:160
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
Definition: List.C:326
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
An abstract class for surfaces with sampling.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:40
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline &#39;\n&#39; character (0x0a)
Definition: Ostream.H:50
bool empty() const noexcept
True if List is empty (ie, size() is zero)
Definition: UList.H:666
UIndirectList< label > labelUIndList
UIndirectList of labels.
Definition: IndirectList.H:65
virtual void clear()
Clear all storage.
engineTime & runTime
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:531
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
Definition: pointIndexHit.H:58
const cellList & cells() const
void writeOBJ(Ostream &os, const point &pt)
Write obj representation of a point.
Definition: meshTools.C:196
Ignore writing from objectRegistry::writeObject()
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
virtual bool expire()
Mark the surface as needing an update.
Macros for easy insertion into run-time selection tables.
virtual tmp< scalarField > sample(const interpolation< scalar > &sampler) const
Sample volume field onto surface faces.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
addNamedToRunTimeSelectionTable(topoSetCellSource, badQualityToCell, word, badQuality)
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:421
static IOobject selectReadIO(const word &name, const Time &runTime)
samplingSource
Types of sampling regions.
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:38
const dimensionedScalar e
Elementary charge.
Definition: createFields.H:11
dynamicFvMesh & mesh
virtual void clearGeom() const
Additional cleanup when clearing the geometry.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition: exprTraits.C:127
const cellShapeList & cells
const pointField & points
A class for handling words, derived from Foam::string.
Definition: word.H:63
MeshedSurface< face > meshedSurface
virtual void print(Ostream &os, int level=0) const
Print information.
labelList findMatching(const StringListType &input, const wordRes::filter &pred, AccessOp aop=identityOp())
Return ids for items with matching names.
MeshedSurface subsetMesh(const UList< bool > &include, labelList &pointMap, labelList &faceMap) const
Return a new surface subsetted on the selected faces.
virtual const faceList & faces() const
Return raw faces.
Definition: polyMesh.C:1103
sampledMeshedSurface(const word &name, const polyMesh &mesh, const word &surfaceName, const samplingSource sampleSource)
Construct from components.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:26
const vectorField & cellCentres() const
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:56
const word & constant() const noexcept
Return constant name.
Definition: TimePathsI.H:112
virtual bool needsUpdate() const
Does the surface need an update?
int debug
Static debugging option.
OBJstream os(runTime.globalPath()/outputName)
mesh update()
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
defineTypeNameAndDebug(combustionModel, 0)
labelList f(nPoints)
const vectorField & faceCentres() const
label size() const
The surface size is the number of faces.
vector point
Point is a vector.
Definition: point.H:37
#define WarningInFunction
Report a warning using Foam::Warning.
virtual bool update()
Update the surface as required.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: error.H:64
List< surfZone > surfZoneList
List of surfZone.
Definition: surfZoneList.H:32
void transfer(pointField &pointLst, List< Face > &faceLst)
Transfer the components.
Standard boundBox with extra functionality for use in octree.
Definition: treeBoundBox.H:90
messageStream Info
Information stream (stdout output on master, null elsewhere)
constexpr label labelMax
Definition: label.H:55
const boundBox & bounds() const noexcept
Return mesh bounding box.
Definition: polyMesh.H:616
Field< vector > vectorField
Specialisation of Field<T> for vector.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
List< label > labelList
A List of labels.
Definition: List.H:62
A class for managing temporary objects.
Definition: HashPtrTable.H:50
const surfZoneList & surfZones() const
Const access to the surface zones.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.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))
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:172
void grow(const scalar delta)
Expand box by adjusting min/max by specified amount in each dimension.
Definition: boundBoxI.H:367
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Do not request registration (bool: false)
PointHit< point > pointHit
A PointHit with a 3D point.
Definition: pointHit.H:43
Namespace for OpenFOAM.
bool isPointData() const noexcept
Using interpolation to surface points.
static void listCombineReduce(List< T > &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
After completion all processors have the same data.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
Definition: FlatOutput.H:225