Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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
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#include "stringListOps.H" // For stringListOps::findMatching()
38
39// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
40
41const Foam::Enum
42<
44>
45Foam::sampledMeshedSurface::samplingSourceNames_
46({
47 { samplingSource::cells, "cells" },
48 { samplingSource::insideCells, "insideCells" },
49 { samplingSource::boundaryFaces, "boundaryFaces" },
50});
51
52
53namespace Foam
54{
55 defineTypeNameAndDebug(sampledMeshedSurface, 0);
56 // Use shorter name only
58 (
61 word,
63 );
64 // Compatibility name (1912)
66 (
69 word,
70 sampledTriSurfaceMesh
71 );
72
73} // End namespace Foam
74
76// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
77
78namespace Foam
79{
80
81// The IOobject for reading
82inline static IOobject selectReadIO(const word& name, const Time& runTime)
83{
84 return IOobject
85 (
86 name,
87 runTime.constant(), // instance
88 "triSurface", // local
89 runTime, // registry
93 );
94}
95
96} // End namespace Foam
97
98
99// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
100
101void Foam::sampledMeshedSurface::setZoneMap()
102{
103 // Populate zoneIds_ based on surfZone information
104
105 const meshedSurface& s = static_cast<const meshedSurface&>(*this);
106
107 const auto& zones = s.surfZones();
108
109 zoneIds_.resize(s.size());
110
111 // Trivial case
112 if (zoneIds_.empty() || zones.size() <= 1)
113 {
114 zoneIds_ = 0;
115 return;
116 }
117
118
119 label beg = 0;
120
121 forAll(zones, zonei)
122 {
123 const label len = min(zones[zonei].size(), zoneIds_.size() - beg);
124
125 // Assign sub-zone Ids
126 SubList<label>(zoneIds_, len, beg) = zonei;
127
128 beg += len;
129 }
130
131 // Anything remaining? Should not happen
132 {
133 const label len = (zoneIds_.size() - beg);
134
135 if (len > 0)
136 {
137 SubList<label>(zoneIds_, len, beg) = max(0, zones.size()-1);
138 }
139 }
140}
141
142
143// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
144
145bool Foam::sampledMeshedSurface::update(const meshSearch& meshSearcher)
146{
147 // Global numbering for cells/faces
148 // - only used to uniquely identify local elements
149 globalIndex globalCells(onBoundary() ? mesh().nFaces() : mesh().nCells());
150
151 // Find the cells the triangles of the surface are in.
152 // Does approximation by looking at the face centres only
153 const pointField& fc = surface_.faceCentres();
154
155 // sqr(distance), global index
156 typedef Tuple2<scalar, label> nearInfo;
157 List<nearInfo> nearest(fc.size(), nearInfo(Foam::sqr(GREAT), labelMax));
158
159 if (sampleSource_ == samplingSource::cells)
160 {
161 // Search for nearest cell
162
163 const auto& cellTree = meshSearcher.cellTree();
164 const auto& treeData = cellTree.shapes();
165
166 forAll(fc, facei)
167 {
168 const point& pt = fc[facei];
169 auto& near = nearest[facei];
170
171 pointIndexHit info = cellTree.findNearest(pt, Foam::sqr(GREAT));
172
173 if (info.hit())
174 {
175 const label objectIndex = treeData.objectIndex(info.index());
176
177 near.first() = info.point().distSqr(pt);
178 near.second() = globalCells.toGlobal(objectIndex);
179 }
180 }
181 }
182 else if (sampleSource_ == samplingSource::insideCells)
183 {
184 // Search for cell containing point
185
186 const auto& cellTree = meshSearcher.cellTree();
187 const auto& treeData = cellTree.shapes();
188
189 forAll(fc, facei)
190 {
191 const point& pt = fc[facei];
192 auto& near = nearest[facei];
193
194 if (cellTree.bb().contains(pt))
195 {
196 const label index = cellTree.findInside(pt);
197
198 if (index != -1)
199 {
200 const label objectIndex = treeData.objectIndex(index);
201
202 near.first() = 0;
203 near.second() = globalCells.toGlobal(objectIndex);
204 }
205 }
206 }
207 }
208 else // samplingSource::boundaryFaces
209 {
210 // Search for nearest boundary face
211 // on all non-coupled boundary faces
212
213 const auto& bndTree = meshSearcher.nonCoupledBoundaryTree();
214 const auto& treeData = bndTree.shapes();
215
216 forAll(fc, facei)
217 {
218 const point& pt = fc[facei];
219 auto& near = nearest[facei];
220
221 pointIndexHit info = bndTree.findNearest(pt, sqr(GREAT));
222
223 if (info.hit())
224 {
225 const label objectIndex = treeData.objectIndex(info.index());
226
227 near.first() = info.point().distSqr(pt);
228 near.second() = globalCells.toGlobal(objectIndex);
229 }
230 }
231 }
232
233
234 // See which processor has the nearest. Mark and subset
235 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
236
238
239 labelList cellOrFaceLabels(fc.size(), -1);
240
241 bitSet facesToSubset(fc.size());
242
243 forAll(nearest, facei)
244 {
245 const auto& near = nearest[facei];
246
247 const label index = near.second();
248
249 if (index == labelMax)
250 {
251 // Not found on any processor, or simply too far.
252 // How to map?
253 }
254 else if (globalCells.isLocal(index))
255 {
256 facesToSubset.set(facei);
257
258 // Mark as special if too far away
259 cellOrFaceLabels[facei] =
260 (
261 (near.first() < maxDistanceSqr_)
262 ? globalCells.toLocal(index)
263 : -1
264 );
265 }
266 }
267
268
269 if (debug)
270 {
271 Pout<< "Local out of faces:" << cellOrFaceLabels.size()
272 << " keeping:" << facesToSubset.count() << endl;
273 }
274
275
276 // Subset the surface
277 meshedSurface& s = static_cast<meshedSurface&>(*this);
278
279 labelList pointMap;
281
282 s = surface_.subsetMesh(facesToSubset, pointMap, faceMap);
283
284
285 // Ensure zoneIds_ are indeed correct
286 setZoneMap();
287
288
289 // Subset cellOrFaceLabels (for compact faces)
290 cellOrFaceLabels = labelUIndList(cellOrFaceLabels, faceMap)();
291
292
293 // Collect the samplePoints and sampleElements
294 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
295
297 {
298 // With point interpolation
299
300 samplePoints_ = points();
301 sampleElements_.resize(pointMap.size(), -1);
302
303 // Store any face per point (without using pointFaces())
304 labelList pointToFace(std::move(pointMap));
305
306 forAll(s, facei)
307 {
308 const face& f = s[facei];
309
310 for (const label labi : f)
311 {
312 pointToFace[labi] = facei;
313 }
314 }
315
316
317 if (sampleSource_ == samplingSource::cells)
318 {
319 // sampleElements_ : per surface point, the cell
320 // samplePoints_ : per surface point, a location inside the cell
321
322 forAll(samplePoints_, pointi)
323 {
324 // Use _copy_ of point
325 const point pt = samplePoints_[pointi];
326
327 const label celli = cellOrFaceLabels[pointToFace[pointi]];
328
329 sampleElements_[pointi] = celli;
330
331 if
332 (
333 celli >= 0
334 && !mesh().pointInCell(pt, celli, meshSearcher.decompMode())
335 )
336 {
337 // Point not inside cell
338 // Find nearest point on faces of cell
339
340 scalar minDistSqr = VGREAT;
341
342 for (const label facei : mesh().cells()[celli])
343 {
344 const face& f = mesh().faces()[facei];
345
346 pointHit info =
347 f.nearestPoint
348 (
349 pt,
350 mesh().points()
351 );
352
353 if (info.distance() < minDistSqr)
354 {
355 minDistSqr = info.distance();
356 samplePoints_[pointi] = info.point();
357 }
358 }
359 }
360 }
361 }
362 else if (sampleSource_ == samplingSource::insideCells)
363 {
364 // sampleElements_ : per surface point the cell
365 // samplePoints_ : per surface point a location inside the cell
366
367 forAll(samplePoints_, pointi)
368 {
369 const label celli = cellOrFaceLabels[pointToFace[pointi]];
370
371 sampleElements_[pointi] = celli;
372 }
373 }
374 else // samplingSource::boundaryFaces
375 {
376 // sampleElements_ : per surface point, the boundary face containing
377 // the location
378 // samplePoints_ : per surface point, a location on the boundary
379
380 forAll(samplePoints_, pointi)
381 {
382 const point& pt = samplePoints_[pointi];
383
384 const label facei = cellOrFaceLabels[pointToFace[pointi]];
385
386 sampleElements_[pointi] = facei;
387
388 if (facei >= 0)
389 {
390 samplePoints_[pointi] =
391 mesh().faces()[facei].nearestPoint
392 (
393 pt,
394 mesh().points()
395 ).point();
396 }
397 }
398 }
399 }
400 else
401 {
402 // if sampleSource_ == cells:
403 // sampleElements_ : per surface face, the cell
404 // samplePoints_ : n/a
405 // if sampleSource_ == insideCells:
406 // sampleElements_ : -1 or per surface face, the cell
407 // samplePoints_ : n/a
408 // if sampleSource_ == boundaryFaces:
409 // sampleElements_ : per surface face, the boundary face
410 // samplePoints_ : n/a
411
412 sampleElements_.transfer(cellOrFaceLabels);
413 samplePoints_.clear();
414 }
415
416
417 if (debug)
418 {
419 this->clearOut();
420 OFstream str(mesh().time().path()/"surfaceToMesh.obj");
421 Info<< "Dumping correspondence from local surface (points or faces)"
422 << " to mesh (cells or faces) to " << str.name() << endl;
423
424 const vectorField& centres =
425 (
426 onBoundary()
427 ? mesh().faceCentres()
428 : mesh().cellCentres()
429 );
430
432 {
433 label vertI = 0;
434 forAll(samplePoints_, pointi)
435 {
436 meshTools::writeOBJ(str, points()[pointi]);
437 ++vertI;
438
439 meshTools::writeOBJ(str, samplePoints_[pointi]);
440 ++vertI;
441
442 label elemi = sampleElements_[pointi];
443 meshTools::writeOBJ(str, centres[elemi]);
444 ++vertI;
445 str << "l " << vertI-2 << ' ' << vertI-1 << ' ' << vertI << nl;
446 }
447 }
448 else
449 {
450 label vertI = 0;
451 forAll(sampleElements_, triI)
452 {
453 meshTools::writeOBJ(str, faceCentres()[triI]);
454 ++vertI;
455
456 label elemi = sampleElements_[triI];
457 meshTools::writeOBJ(str, centres[elemi]);
458 ++vertI;
459 str << "l " << vertI-1 << ' ' << vertI << nl;
460 }
461 }
462 }
463
464 needsUpdate_ = false;
465 return true;
466}
467
468
469// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
470
472(
473 const word& name,
474 const polyMesh& mesh,
475 const word& surfaceName,
476 const samplingSource sampleSource
477)
478:
481 surfaceName_(surfaceName),
482 surface_
483 (
484 selectReadIO(surfaceName, mesh.time()),
485 dictionary::null
486 ),
487 sampleSource_(sampleSource),
488 needsUpdate_(true),
489 keepIds_(true),
490 zoneIds_(),
491 sampleElements_(),
492 samplePoints_(),
493 maxDistanceSqr_(Foam::sqr(GREAT)),
494 defaultValues_()
495{}
496
497
499(
500 const word& name,
501 const polyMesh& mesh,
502 const dictionary& dict
503)
504:
507 surfaceName_
508 (
509 meshedSurface::findFile
510 (
511 selectReadIO(dict.get<word>("surface"), mesh.time()),
512 dict
513 ).name()
514 ),
515 surface_
516 (
517 selectReadIO(dict.get<word>("surface"), mesh.time()),
518 dict
519 ),
520 sampleSource_(samplingSourceNames_.get("source", dict)),
521 needsUpdate_(true),
522 keepIds_(dict.getOrDefault("keepIds", true)),
523 zoneIds_(),
524 sampleElements_(),
525 samplePoints_(),
526 maxDistanceSqr_(Foam::sqr(GREAT)),
527 defaultValues_(dict.subOrEmptyDict("defaultValue"))
528{
529 if (dict.readIfPresent("maxDistance", maxDistanceSqr_))
530 {
531 // Info<< "Limit to maxDistance " << maxDistanceSqr_ << nl;
532 // if (defaultValues_.empty())
533 // {
534 // Info<< "defaultValues = zero" << nl;
535 // }
536 // else
537 // {
538 // defaultValues_.writeEntry(Info);
539 // }
540
541 maxDistanceSqr_ = Foam::sqr(maxDistanceSqr_);
542 }
543
544 wordRes includePatches;
545 dict.readIfPresent("patches", includePatches);
546 includePatches.uniq();
547
548 // Could also shift this to the reader itself,
549 // but not yet necessary.
550
551 if (!includePatches.empty())
552 {
553 Info<< "Subsetting surface " << surfaceName_
554 << " to patches: " << flatOutput(includePatches) << nl;
555
556 const surfZoneList& zones = surface_.surfZones();
557
558 const labelList zoneIndices
559 (
560 stringListOps::findMatching
561 (
562 zones,
563 includePatches,
564 wordRes(),
565 nameOp<surfZone>()
566 )
567 );
568
569 // Faces to subset
570 bitSet includeMap(surface_.size());
571
572 for (const label zonei : zoneIndices)
573 {
574 const surfZone& zn = zones[zonei];
575 includeMap.set(zn.range());
576 }
577
578 if (includeMap.none())
579 {
580 WarningInFunction
581 << "Patch selection results in an empty surface"
582 << " - ignoring" << nl;
583 }
584 else if (!includeMap.all())
585 {
586 meshedSurface subSurf(surface_.subsetMesh(includeMap));
587
588 if (subSurf.empty())
589 {
590 WarningInFunction
591 << "Bad surface subset (empty)"
592 << " - skip and hope for the best" << nl;
593 }
594 else
595 {
596 // Replace
597 surface_.transfer(subSurf);
598 }
600 }
601}
602
603
604// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
607{
608 return needsUpdate_;
609}
610
611
613{
614 // already marked as expired
615 if (needsUpdate_)
616 {
617 return false;
618 }
619
622 zoneIds_.clear();
623
624 sampleElements_.clear();
625 samplePoints_.clear();
626
627 needsUpdate_ = true;
628 return true;
629}
630
631
633{
634 if (!needsUpdate_)
635 {
636 return false;
637 }
638
639 // Calculate surface and mesh overlap bounding box
640 treeBoundBox bb(surface_.points(), surface_.meshPoints());
641
642 // Restrict surface to (global!) mesh bound box
643 bb &= mesh().bounds();
644
645 if (bb.good())
646 {
647 // Extend a bit
648 bb.grow(0.5*bb.span());
649 bb.inflate(1e-6);
650 }
651 else
652 {
653 // Surface and mesh do not overlap at all. Guarantee a valid
654 // bounding box so we don't get any 'invalid bounding box' errors.
655
657 << "Surface " << surfaceName_
658 << " does not overlap bounding box of mesh " << mesh().bounds()
659 << endl;
660
661 bb.reset(mesh().bounds().centre());
662 bb.grow(1e-6*mesh().bounds().span());
663 }
664
665 // Mesh search engine, no triangulation of faces.
666 meshSearch meshSearcher(mesh(), bb, polyMesh::FACE_PLANES);
667
668 return update(meshSearcher);
669}
670
671
673{
674 if (!needsUpdate_)
675 {
676 return false;
677 }
678
679 // Mesh search engine on subset, no triangulation of faces.
680 meshSearch meshSearcher(mesh(), bb, polyMesh::FACE_PLANES);
681
682 return update(meshSearcher);
683}
684
685
687(
689) const
690{
691 return sampleOnFaces(sampler);
692}
693
694
696(
698) const
699{
700 return sampleOnFaces(sampler);
701}
702
703
705(
707) const
708{
709 return sampleOnFaces(sampler);
710}
711
712
714(
716) const
717{
718 return sampleOnFaces(sampler);
719}
720
721
723(
725) const
726{
727 return sampleOnFaces(sampler);
728}
729
730
732(
733 const interpolation<scalar>& interpolator
734) const
735{
736 return sampleOnPoints(interpolator);
737}
738
739
742 const interpolation<vector>& interpolator
743) const
744{
745 return sampleOnPoints(interpolator);
746}
747
749(
751) const
752{
753 return sampleOnPoints(interpolator);
754}
755
756
758(
759 const interpolation<symmTensor>& interpolator
760) const
761{
762 return sampleOnPoints(interpolator);
763}
764
765
767(
768 const interpolation<tensor>& interpolator
769) const
770{
771 return sampleOnPoints(interpolator);
772}
773
774
775void Foam::sampledMeshedSurface::print(Ostream& os, int level) const
776{
777 os << "meshedSurface: " << name() << " :"
778 << " surface:" << surfaceName_;
779
780 if (level)
781 {
782 os << " faces:" << faces().size()
783 << " points:" << points().size()
784 << " zoneids:" << zoneIds().size();
785 }
786}
787
788
789// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addNamedToRunTimeSelectionTable(baseType, thisType, argNames, lookupName)
Add to construction table with 'lookupName' as the key.
if(patchID !=-1)
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition Enum.H:57
@ NO_REGISTER
Do not request registration (bool: false).
@ MUST_READ
Reading required.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
void resize(const label len)
Adjust allocated size of list.
Definition ListI.H:153
static const List< face > & null() noexcept
Definition List.H:138
const surfZoneList & surfZones() const
Const access to the surface zones.
Output to file stream as an OSstream, normally using std::ofstream for the actual output.
Definition OFstream.H:75
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
static void listCombineReduce(UList< T > &values, CombineOp cop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Forwards to Pstream::listReduce with an in-place cop.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Definition Tuple2.H:51
bool empty() const noexcept
True if List is empty (ie, size() is zero).
Definition UList.H:701
bool get(const label i) const
Definition UList.H:868
void size(const label n)
Older name for setAddressableSize.
Definition UList.H:118
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition bitSet.H:61
void grow(const scalar delta)
Expand box by adjusting min/max by specified amount in each dimension.
Definition boundBoxI.H:367
bool good() const
Bounding box is non-inverted.
Definition boundBoxI.H:156
void reset()
Reset to an inverted box.
Definition boundBoxI.H:295
void inflate(const scalar factor)
Expand box by factor*mag(span) in all dimensions.
Definition boundBoxI.H:381
vector span() const
The bounding box span (from minimum to maximum).
Definition boundBoxI.H:192
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
A face is a list of labels corresponding to mesh vertices.
Definition face.H:71
static fileName findFile(const IOobject &io, const bool isGlobal=true)
Use IOobject information to resolve file to load from, or empty if the file does not exist.
Calculates a non-overlapping list of offsets based on an input size (eg, number of cells) from differ...
Definition globalIndex.H:77
Abstract base class for volume field interpolation.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Definition meshSearch.H:57
A topoSetFaceSource to select faces with any point or any edge within a given pointSet(s).
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
virtual const faceList & faces() const
Return raw faces.
Definition polyMesh.C:1088
const boundBox & bounds() const noexcept
Return mesh bounding box.
Definition polyMesh.H:617
const vectorField & faceCentres() const
const vectorField & cellCentres() const
A sampledSurface from a meshed surface. It samples on the points/faces of the meshed surface.
sampledMeshedSurface(const word &name, const polyMesh &mesh, const word &surfaceName, const samplingSource sampleSource)
Construct from components.
virtual void print(Ostream &os, int level=0) const
Print information.
virtual tmp< scalarField > sample(const interpolation< scalar > &sampler) const
Sample volume field onto surface faces.
virtual const faceList & faces() const
Faces of surface.
virtual const labelList & zoneIds() const
Per-face zone/region information.
virtual bool expire()
Mark the surface as needing an update.
virtual bool needsUpdate() const
Does the surface need an update?
virtual bool update()
Update the surface as required.
samplingSource
Types of sampling regions.
An abstract class for surfaces with sampling.
bool isPointData() const noexcept
Using interpolation to surface points.
sampledSurface(const word &name, std::nullptr_t)
Construct null.
const word & name() const noexcept
Name of surface.
virtual void clearGeom() const
Additional cleanup when clearing the geometry.
const polyMesh & mesh() const noexcept
Access to the underlying mesh.
bool interpolate() const noexcept
Same as isPointData().
A class for managing temporary objects.
Definition tmp.H:75
Standard boundBox with extra functionality for use in octree.
A List of wordRe with additional matching capabilities.
Definition wordRes.H:56
A class for handling words, derived from Foam::string.
Definition word.H:66
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
mesh update()
dynamicFvMesh & mesh
engineTime & runTime
OBJstream os(runTime.globalPath()/outputName)
auto & name
const pointField & points
const cellShapeList & cells
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))
#define WarningInFunction
Report a warning using Foam::Warning.
Namespace for bounding specifications. At the moment, mostly for tables.
Namespace for handling debugging switches.
Definition debug.C:45
void writeOBJ(Ostream &os, const point &pt)
Write obj representation of a point.
Definition meshTools.C:196
Namespace for OpenFOAM.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition hashSets.C:40
PointHit< point > pointHit
A PointHit with a 3D point.
Definition pointHit.H:51
List< label > labelList
A List of labels.
Definition List.H:62
dimensionedSymmTensor sqr(const dimensionedVector &dv)
UIndirectList< label > labelUIndList
UIndirectList of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere).
constexpr label labelMax
Definition label.H:55
static IOobject selectReadIO(const word &name, const Time &runTime)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition Ostream.H:519
MeshedSurface< face > meshedSurface
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition hashSets.C:26
Field< vector > vectorField
Specialisation of Field<T> for vector.
vector point
Point is a vector.
Definition point.H:37
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
vectorField pointField
pointField is a vectorField.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
constexpr char nl
The newline '\n' character (0x0a).
Definition Ostream.H:50
labelList f(nPoints)
dictionary dict
volScalarField & e
#define forAll(list, i)
Loop across all elements in list.
Definition stdFoam.H:299
Operations on lists of strings.
Assign tuple-like container to use the one with the smaller value of first.
Definition Tuple2.H:257