34 namespace sampledSurfaces
49 const bool triangulate
53 patchNames_(patchNames),
54 triangulate_(triangulate),
67 patchNames_(dict.
lookup(
"patches")),
83 if (patchIDs_.empty())
85 patchIDs_ =
mesh().boundaryMesh().patchSet
113 patchFaceLabels_.clear();
134 if (isA<emptyPolyPatch>(pp))
137 <<
"Cannot sample an empty patch. Patch " << pp.
name()
146 patchIndex_.setSize(sz);
147 patchFaceLabels_.setSize(sz);
148 patchStart_.setSize(patchIDs().size());
164 patchFaceLabels_[sz] = j;
165 meshFaceLabels[sz] = pp.
start()+j;
177 this->storedFaces() = allPatches.
localFaces();
186 MeshStorage::triangulate();
195 needsUpdate_ =
false;
201 void Foam::sampledSurfaces::patch::remapFaces(
const labelUList& faceMap)
206 MeshStorage::remapFaces(faceMap);
217 if (patchIndex_.size() > 0)
219 patchStart_[patchIndex_[0]] = 0;
220 for (
label i = 1; i < patchIndex_.size(); i++)
222 if (patchIndex_[i] != patchIndex_[i-1])
224 patchStart_[patchIndex_[i]] = i;
237 return sampleField(vField);
246 return sampleField(vField);
255 return sampleField(vField);
264 return sampleField(vField);
273 return sampleField(vField);
282 return sampleField(sField);
291 return sampleField(sField);
300 return sampleField(sField);
309 return sampleField(sField);
318 return sampleField(sField);
327 return interpolateField(interpolator);
336 return interpolateField(interpolator);
345 return interpolateField(interpolator);
354 return interpolateField(interpolator);
363 return interpolateField(interpolator);
369 os <<
"patch: " <<
name() <<
" :" 371 <<
" faces:" << faces().size()
372 <<
" points:" <<
points().size();
virtual void print(Ostream &) const
Write.
#define forAll(list, i)
Loop across all elements in list.
virtual bool expire()
Mark the surface as needing an update.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const word & name() const
Return name.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const labelList & patchIDs() const
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
An abstract class for surfaces with sampling.
defineTypeNameAndDebug(distanceSurface, 0)
virtual ~patch()
Destructor.
bool interpolate() const
Interpolation requested for surface.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool needsUpdate() const
Does the surface need an update?
const Field< PointType > & localPoints() const
Return pointField of points in patch.
patch(const word &name, const polyMesh &mesh, const wordReList &patchNames, const bool triangulate=false)
Construct from components.
Macros for easy insertion into run-time selection tables.
A list of faces which address into the list of points.
virtual void clearGeom() const
A class for handling words, derived from string.
wordList patchNames(nPatches)
List< label > labelList
A List of labels.
virtual tmp< scalarField > sample(const volScalarField &) const
Sample field on surface.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
virtual bool update()
Update the surface as required.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
addToRunTimeSelectionTable(sampledSurface, distanceSurface, word)
word name(const complex &)
Return a string representation of a complex.
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
prefixOSstream Pout(cout, "Pout")
const List< FaceType > & localFaces() const
Return patch faces addressing into local point list.
A List with indirect addressing.
label start() const
Return start label of this patch in the polyMesh face list.
Mesh consisting of general polyhedral cells.
A class for managing temporary objects.
A patch is a list of labels that address the faces in the global face list.
label size() const
Return the number of elements in the UList.
A List with indirect addressing.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.