Go to the documentation of this file.
54 const bool triangulate
59 triangulate_(triangulate),
73 triangulate_(
dict.lookupOrDefault(
"triangulate",
false)),
82 if (patchIDs_.empty())
108 patchFaceLabels_.clear();
124 for (
const label patchi : patchIDs())
128 if (isA<emptyPolyPatch>(pp))
131 <<
"Cannot sample an empty patch. Patch " << pp.
name()
140 patchIndex_.setSize(sz);
141 patchFaceLabels_.setSize(sz);
142 patchStart_.setSize(patchIDs().size());
149 const label patchi = patchIDs()[i];
158 patchFaceLabels_[sz] = j;
159 meshFaceLabels[sz] = pp.
start()+j;
171 this->storedFaces() = allPatches.
localFaces();
180 MeshStorage::triangulate();
189 needsUpdate_ =
false;
200 MeshStorage::remapFaces(
faceMap);
211 if (patchIndex_.size() > 0)
213 patchStart_[patchIndex_[0]] = 0;
214 for (
label i = 1; i < patchIndex_.size(); i++)
216 if (patchIndex_[i] != patchIndex_[i-1])
218 patchStart_[patchIndex_[i]] = i;
231 return sampleOnFaces(sampler);
240 return sampleOnFaces(sampler);
249 return sampleOnFaces(sampler);
258 return sampleOnFaces(sampler);
267 return sampleOnFaces(sampler);
282 return sampleOnFaces(sField);
291 return sampleOnFaces(sField);
300 return sampleOnFaces(sField);
309 return sampleOnFaces(sField);
318 return sampleOnFaces(sField);
327 return sampleOnPoints(interpolator);
336 return sampleOnPoints(interpolator);
345 return sampleOnPoints(interpolator);
354 return sampleOnPoints(interpolator);
363 return sampleOnPoints(interpolator);
369 os <<
"sampledPatch: " <<
name() <<
" :"
371 <<
" faces:" << faces().size()
372 <<
" 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)
A class for handling words, derived from Foam::string.
const labelList & patchIDs() const
A class for managing temporary objects.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
prefixOSstream Pout
An Ostream wrapper for parallel output to std::cout.
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.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
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.
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)
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.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
label start() const
Return start label of this patch in the polyMesh face list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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.
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.
A List of wordRe with additional matching capabilities.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool useGroups=true) const
Return the set of patch IDs corresponding to the given names.
virtual void clearGeom() const
Additional cleanup when clearing the geometry.
const List< Face > & localFaces() const
Return patch faces addressing into local point list.
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)
const word & name() const
Return the patch name.
A list of faces which address into the list of points.
UIndirectList< label > labelUIndList
UIndirectList of labels.