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())
112 patchIndices_.clear();
114 patchFaceLabels_.clear();
135 if (isA<emptyPolyPatch>(pp))
138 <<
"Cannot sample an empty patch. Patch " << pp.
name()
147 patchIndex_.setSize(sz);
148 patchFaceLabels_.setSize(sz);
149 patchStart_.setSize(patchIndices().size());
165 patchFaceLabels_[sz] = j;
166 meshFaceLabels[sz] = pp.
start()+j;
178 this->storedFaces() = allPatches.
localFaces();
196 needsUpdate_ =
false;
218 if (patchIndex_.size() > 0)
220 patchStart_[patchIndex_[0]] = 0;
221 for (
label i = 1; i < patchIndex_.size(); i++)
223 if (patchIndex_[i] != patchIndex_[i-1])
225 patchStart_[patchIndex_[i]] = i;
238 return sampleField(vField);
247 return sampleField(vField);
256 return sampleField(vField);
265 return sampleField(vField);
274 return sampleField(vField);
283 return sampleField(sField);
292 return sampleField(sField);
301 return sampleField(sField);
310 return sampleField(sField);
319 return sampleField(sField);
328 return interpolateField(interpolator);
337 return interpolateField(interpolator);
346 return interpolateField(interpolator);
355 return interpolateField(interpolator);
364 return interpolateField(interpolator);
370 os <<
"patch: " <<
name() <<
" :"
372 <<
" faces:" << faces().size()
373 <<
" 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.
List< Key > sortedToc() const
Return the table of contents as a sorted list.
A List with indirect addressing.
virtual label triangulate()
Triangulate in-place, returning the number of triangles added.
virtual void remapFaces(const labelUList &faceMap)
Set new zones from faceMap.
virtual void clear()
Clear all storage.
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Abstract base class for interpolation.
const word & name() const
Return name.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool usePatchGroups=true) const
Return the patch set corresponding to the given names.
Mesh consisting of general polyhedral cells.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
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.
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.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#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.
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)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
prefixOSstream Pout(cout, "Pout")
SurfaceField< sphericalTensor > surfaceSphericalTensorField
SurfaceField< symmTensor > surfaceSymmTensorField
wordList patchNames(nPatches)