Go to the documentation of this file.
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;
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_)
421 <<
" faces:" << faces().size()
422 <<
" points:" <<
points().size();
int debug
Static debugging option.
List< label > labelList
A List of labels.
virtual bool needsUpdate() const
Does the surface need an update?
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
const word & name() const
Return name.
A class for handling words, derived from Foam::string.
const labelList & patchIDs() const
The patches selected.
A class for managing temporary objects.
A List obtained as a section of another List.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
virtual tmp< scalarField > sample(const interpolation< scalar > &sampler) const
Sample boundary of volume field onto surface faces.
virtual void print(Ostream &) const
Write.
virtual bool withSurfaceFields() const
Can it sample surface-fields?
A patch is a list of labels that address the faces in the global face list.
word name(const complex &c)
Return string representation of complex.
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
sampledPatch(const word &name, const polyMesh &mesh, const UList< wordRe > &patchNames, const bool triangulate=false)
Construct from components.
addNamedToRunTimeSelectionTable(topoSetCellSource, badQualityToCell, word, badQuality)
A List with indirect addressing.
An abstract class for surfaces with sampling.
wordList patchNames(nPatches)
void resize(const label newSize)
Adjust allocated size of list.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
const List< face_type > & localFaces() const
Return patch faces addressing into local point list.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
label start() const
Return start label of this patch in the polyMesh face list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const Field< point_type > & localPoints() const
Return pointField of points in patch.
virtual bool update()
Update the surface as required.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const std::string patch
OpenFOAM patch number as a std::string.
Ostream & print(Ostream &os, UIntType value, char off='0', char on='1')
Print 0/1 bits in the (unsigned) integral type.
const Addr & addressing() const
The list addressing.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
virtual bool expire()
Mark the surface as needing an update.
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
A List of wordRe with additional matching capabilities.
virtual void clearGeom() const
Additional cleanup when clearing the geometry.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
const polyMesh & mesh() const
Access to the underlying mesh.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bool interpolate() const
Interpolation to nodes requested for surface.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
Report a warning using Foam::Warning.
A list of faces which address into the list of points.
UIndirectList< label > labelUIndList
UIndirectList of labels.