34 namespace sampledSurfaces
49 const bool triangulate
54 triangulate_(triangulate),
68 triangulate_(
dict.lookupOrDefault(
"triangulate", false)),
83 if (patchIndices_.empty())
86 mesh().
boundary().patchSet(patchNames_,
false).sortedToc();
111 if (isA<emptyPolyPatch>(pp))
114 <<
"Cannot sample an empty patch. Patch " << pp.
name()
123 patchIndex_.setSize(sz);
124 patchFaceLabels_.setSize(sz);
125 patchStart_.setSize(patchIndices().size());
141 patchFaceLabels_[sz] = j;
142 meshFaceLabels[sz] = pp.
start()+j;
154 this->storedFaces() = allPatches.
localFaces();
172 needsUpdate_ =
false;
194 if (patchIndex_.size() > 0)
196 patchStart_[patchIndex_[0]] = 0;
197 for (
label i = 1; i < patchIndex_.size(); i++)
199 if (patchIndex_[i] != patchIndex_[i-1])
201 patchStart_[patchIndex_[i]] = i;
209 #define IMPLEMENT_SAMPLE(Type, nullArg) \
210 Foam::tmp<Foam::Field<Foam::Type>> \
211 Foam::sampledSurfaces::patch::sample \
213 const VolField<Type>& vField \
216 return sampleField(vField); \
219 Foam::tmp<Foam::Field<Foam::Type>> \
220 Foam::sampledSurfaces::patch::sample \
222 const SurfaceField<Type>& vField \
225 return sampleField(vField); \
228 #undef IMPLEMENT_SAMPLE
231 #define IMPLEMENT_INTERPOLATE(Type, nullArg) \
232 Foam::tmp<Foam::Field<Foam::Type>> \
233 Foam::sampledSurfaces::patch::interpolate \
235 const interpolation<Type>& interpolator \
238 return interpolateField(interpolator); \
241 #undef IMPLEMENT_INTERPOLATE
249 patchIndices_.clear();
251 patchFaceLabels_.clear();
278 os <<
"patch: " <<
name() <<
" :"
280 <<
" faces:" << faces().size()
281 <<
" points:" <<
points().size();
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
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.
const fvBoundaryMesh & boundary() const
Return reference to boundary mesh.
const word & name() const
Return name.
Class containing mesh-to-mesh mapping information after a mesh distribution where we send parts of me...
Class containing mesh-to-mesh mapping information.
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.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
An abstract class for surfaces with sampling.
virtual void clearGeom() const
A sampledSurface on patches. Non-triangulated by default.
const labelList & patchIndices() const
virtual ~patch()
Destructor.
virtual void topoChange(const polyTopoChangeMap &)
Update topology using the given map.
virtual void distribute(const polyDistributionMap &)
Redistribute or update using the given distribution map.
virtual void movePoints()
Update for mesh point-motion.
virtual void mapMesh(const polyMeshMap &)
Update from another mesh using the given map.
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 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)
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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.
FOR_ALL_FIELD_TYPES(makeDimensionedPointFieldFunctions)
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")
wordList patchNames(nPatches)
#define IMPLEMENT_INTERPOLATE(Type, nullArg)
#define IMPLEMENT_SAMPLE(Type, nullArg)