55 const bool triangulate
60 triangulate_(triangulate),
74 triangulate_(
dict.getOrDefault(
"triangulate", false)),
83 if (patchIDs_.empty())
91 for (
const label patchi : selected)
95 if (isA<emptyPolyPatch>(pp))
103 label nGood = (selected.
size() - bad.
size());
107 os <<
"Cannot sample an empty patch" <<
nl;
109 for (
const label patchi : bad)
117 os <<
"No non-empty patches selected" <<
endl
122 os <<
"Selected " << nGood <<
" non-empty patches" <<
nl;
125 patchIDs_.resize(nGood);
127 for (
const label patchi : selected)
129 if (!bad.found(patchi))
131 patchIDs_[nGood] = patchi;
138 patchIDs_ = std::move(selected);
167 patchFaceLabels_.clear();
183 for (
const label patchi : patchIDs())
186 numFaces += pp.size();
189 patchStart_.resize(patchIDs().size());
192 patchIndex_.resize(numFaces);
193 patchFaceLabels_.resize(numFaces);
197 meshFaceIds.
resize(numFaces);
203 const label patchi = patchIDs()[idx];
205 const label len = pp.size();
207 patchStart_[idx] = numFaces;
222 this->storedFaces() = allPatches.
localFaces();
240 needsUpdate_ =
false;
261 if (patchIndex_.size())
263 patchStart_[patchIndex_[0]] = 0;
264 for (label i = 1; i < patchIndex_.size(); ++i)
266 if (patchIndex_[i] != patchIndex_[i-1])
268 patchStart_[patchIndex_[i]] = i;
281 return sampleOnFaces(sampler);
290 return sampleOnFaces(sampler);
299 return sampleOnFaces(sampler);
308 return sampleOnFaces(sampler);
317 return sampleOnFaces(sampler);
332 return sampleOnFaces(sField);
341 return sampleOnFaces(sField);
350 return sampleOnFaces(sField);
359 return sampleOnFaces(sField);
368 return sampleOnFaces(sField);
377 return sampleOnPoints(interpolator);
386 return sampleOnPoints(interpolator);
395 return sampleOnPoints(interpolator);
404 return sampleOnPoints(interpolator);
413 return sampleOnPoints(interpolator);
419 os <<
"sampledPatch: " <<
name() <<
" :"
420 <<
" patches:" <<
flatOutput(selectionNames_);
424 os <<
" faces:" << faces().size()
Macros for easy insertion into run-time selection tables.
#define addNamedToRunTimeSelectionTable(baseType, thisType, argNames, lookupName)
Add to construction table with 'lookupName' as the key.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
Minimal example by using system/controlDict.functions:
const word & name() const noexcept
Return the object name.
A List with indirect addressing.
const Addr & addressing() const noexcept
The list addressing.
void resize(const label len)
Adjust allocated size of list.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of faces which address into the list of points.
const Field< point_type > & localPoints() const
Return pointField of points in patch.
const List< face_type > & localFaces() const
Return patch faces addressing into local point list.
A List obtained as a section of another List.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void size(const label n)
Older name for setAddressableSize.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Abstract base class for volume field interpolation.
scalar print()
Print to screen.
Mesh consisting of general polyhedral cells.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
A patch is a list of labels that address the faces in the global face list.
label start() const
Return start label of this patch in the polyMesh face list.
A sampledSurface on patches. Non-triangulated by default.
const labelList & patchIDs() const
The patches selected.
virtual bool expire()
Mark the surface as needing an update.
virtual bool needsUpdate() const
Does the surface need an update?
virtual bool withSurfaceFields() const
Can it sample surface-fields?
virtual bool update()
Update the surface as required.
An abstract class for surfaces with sampling.
virtual void clearGeom() const
Additional cleanup when clearing the geometry.
bool interpolate() const noexcept
Same as isPointData()
A class for managing temporary objects.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
List< label > labelList
A List of labels.
Ostream & endl(Ostream &os)
Add newline and flush stream.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
errorManipArg< error, int > exit(error &err, const int errNo=1)
UIndirectList< label > labelUIndList
UIndirectList of labels.
constexpr char nl
The newline '\n' character (0x0a)
wordList patchNames(nPatches)
#define forAll(list, i)
Loop across all elements in list.