34 namespace sampledSurfaces
49 const bool triangulate
54 triangulate_(triangulate),
67 patchNames_(
dict.lookup(
"patches")),
68 triangulate_(
dict.lookupOrDefault(
"triangulate", false)),
83 if (patchIndices_.empty())
85 patchIndices_ = mesh().boundaryMesh().patchSet
111 patchIndices_.clear();
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(patchIndices().size());
164 patchFaceLabels_[sz] = j;
165 meshFaceLabels[sz] = pp.
start()+j;
177 this->storedFaces() = allPatches.
localFaces();
186 MeshStorage::triangulate();
195 needsUpdate_ =
false;
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();
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
A List with indirect addressing.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const List< FaceType > & localFaces() const
Return patch faces addressing into local point list.
const Field< PointType > & localPoints() const
Return pointField of points in patch.
A List with indirect addressing.
label size() const
Return the number of elements in the UList.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Abstract base class for interpolation.
const word & name() const
Return name.
Mesh consisting of general polyhedral cells.
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.
const polyBoundaryMesh & boundaryMesh() const
Return boundaryMesh reference.
An abstract class for surfaces with sampling.
virtual void clearGeom() const
bool interpolate() const
Interpolation requested for surface.
A sampledSurface on patches. Non-triangulated by default.
const labelList & patchIndices() const
virtual ~patch()
Destructor.
virtual tmp< scalarField > sample(const volScalarField &) const
Sample field on surface.
virtual bool expire()
Mark the surface as needing an update.
virtual bool needsUpdate() const
Does the surface need an update?
virtual bool update()
Update the surface as required.
virtual void print(Ostream &) const
Write.
patch(const word &name, const polyMesh &mesh, const wordReList &patchNames, const bool triangulate=false)
Construct from components.
A class for managing temporary objects.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
defineTypeNameAndDebug(cutPlane, 0)
addToRunTimeSelectionTable(sampledSurface, cutPlane, word)
errorManipArg< error, int > exit(error &err, const int errNo=1)
SurfaceField< tensor > surfaceTensorField
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
bool notNull(const T &t)
Return true if t is not a reference to the nullObject of type T.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
prefixOSstream Pout(cout, "Pout")
SurfaceField< sphericalTensor > surfaceSphericalTensorField
SurfaceField< symmTensor > surfaceSymmTensorField
wordList patchNames(nPatches)