51 const bool triangulate
55 patchNames_(patchNames),
56 triangulate_(triangulate),
69 patchNames_(dict.
lookup(
"patches")),
85 if (patchIDs_.empty())
115 patchFaceLabels_.clear();
133 label patchI = patchIDs()[i];
136 if (isA<emptyPolyPatch>(pp))
139 <<
"Cannot sample an empty patch. Patch " << pp.
name()
148 patchIndex_.setSize(sz);
149 patchFaceLabels_.setSize(sz);
150 patchStart_.setSize(patchIDs().size());
157 label patchI = patchIDs()[i];
166 patchFaceLabels_[sz] = j;
167 meshFaceLabels[sz] = pp.
start()+j;
179 this->storedFaces() = allPatches.
localFaces();
188 MeshStorage::triangulate();
197 needsUpdate_ =
false;
203 void Foam::sampledPatch::remapFaces(
const labelUList& faceMap)
208 MeshStorage::remapFaces(faceMap);
219 if (patchIndex_.size() > 0)
221 patchStart_[patchIndex_[0]] = 0;
222 for (
label i = 1; i < patchIndex_.size(); i++)
224 if (patchIndex_[i] != patchIndex_[i-1])
226 patchStart_[patchIndex_[i]] = i;
239 return sampleField(vField);
248 return sampleField(vField);
257 return sampleField(vField);
266 return sampleField(vField);
275 return sampleField(vField);
284 return sampleField(sField);
293 return sampleField(sField);
302 return sampleField(sField);
311 return sampleField(sField);
320 return sampleField(sField);
329 return interpolateField(interpolator);
338 return interpolateField(interpolator);
347 return interpolateField(interpolator);
356 return interpolateField(interpolator);
365 return interpolateField(interpolator);
371 os <<
"sampledPatch: " <<
name() <<
" :" 373 <<
" faces:" << faces().
size()
A List with indirect addressing.
const pointField & points
const word & name() const
Return name.
wordList patchNames(nPatches)
An abstract class for surfaces with sampling.
word name(const complex &)
Return a string representation of a complex.
List< Key > sortedToc() const
Return the table of contents as a sorted list.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void size(const label)
Override size to be inconsistent with allocated storage.
errorManipArg< error, int > exit(error &err, const int errNo=1)
sampledPatch(const word &name, const polyMesh &mesh, const wordReList &patchNames, const bool triangulate=false)
Construct from components.
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
A list of keyword definitions, which are a keyword followed by any number of values (e...
A patch is a list of labels that address the faces in the global face list.
virtual bool update()
Update the surface as required.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
Ostream & endl(Ostream &os)
Add newline and flush stream.
A List with indirect addressing.
virtual void clearGeom() const
label size() const
Return the number of elements in the UList.
Macros for easy insertion into run-time selection tables.
virtual void print(Ostream &) const
Write.
virtual tmp< scalarField > sample(const volScalarField &) const
Sample field on surface.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
bool interpolate() const
Interpolation requested for surface.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
A list of faces which address into the list of points.
const labelList & patchIDs() const
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool usePatchGroups=true) const
Return the set of patch IDs corresponding to the given names.
label start() const
Return start label of this patch in the polyMesh face list.
Mesh consisting of general polyhedral cells.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
List< label > labelList
A List of labels.
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.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const List< Face > & localFaces() const
Return patch faces addressing into local point list.
virtual ~sampledPatch()
Destructor.
addNamedToRunTimeSelectionTable(GAMGProcAgglomeration, noneGAMGProcAgglomeration, GAMGAgglomeration, none)
virtual bool needsUpdate() const
Does the surface need an update?
A class for managing temporary objects.
defineTypeNameAndDebug(combustionModel, 0)
prefixOSstream Pout(cout,"Pout")