Go to the documentation of this file.
55 const bool triangulate
60 triangulate_(triangulate),
74 triangulate_(
dict.getOrDefault(
"triangulate", false)),
83 if (patchIDs_.empty())
91 for (
const label patchi : selected)
95 if (isA<emptyPolyPatch>(pp))
103 label nGood = (selected.size() - bad.size());
107 os <<
"Cannot sample an empty patch" <<
nl;
109 for (
const label patchi : bad)
117 os <<
"No non-empty patches selected" <<
endl
122 os <<
"Selected " << nGood <<
" non-empty patches" <<
nl;
127 for (
const label patchi : selected)
129 if (!bad.found(patchi))
131 patchIDs_[nGood] = patchi;
138 patchIDs_ = std::move(selected);
167 patchFaceLabels_.clear();
183 for (
const label patchi : patchIDs())
186 numFaces += pp.size();
189 patchStart_.
resize(patchIDs().size());
192 patchIndex_.resize(numFaces);
193 patchFaceLabels_.resize(numFaces);
195 IndirectList<face> selectedFaces(
mesh().faces(),
labelList());
196 labelList& meshFaceIds = selectedFaces.addressing();
197 meshFaceIds.
resize(numFaces);
203 const label patchi = patchIDs()[idx];
205 const label len = pp.size();
207 patchStart_[idx] = numFaces;
209 SubList<label>(patchIndex_, len, numFaces) = idx;
211 SubList<label>(patchFaceLabels_, len, numFaces) =
identity(len);
213 SubList<label>(meshFaceIds, len, numFaces) =
identity(len, pp.start());
221 this->storedPoints() = allPatches.localPoints();
222 this->storedFaces() = allPatches.localFaces();
240 needsUpdate_ =
false;
261 if (patchIndex_.size())
263 patchStart_[patchIndex_[0]] = 0;
264 for (label i = 1; i < patchIndex_.size(); ++i)
266 if (patchIndex_[i] != patchIndex_[i-1])
268 patchStart_[patchIndex_[i]] = i;
278 const interpolation<scalar>& sampler
281 return sampleOnFaces(sampler);
290 return sampleOnFaces(sampler);
299 return sampleOnFaces(sampler);
308 return sampleOnFaces(sampler);
317 return sampleOnFaces(sampler);
332 return sampleOnFaces(sField);
341 return sampleOnFaces(sField);
350 return sampleOnFaces(sField);
359 return sampleOnFaces(sField);
368 return sampleOnFaces(sField);
377 return sampleOnPoints(interpolator);
386 return sampleOnPoints(interpolator);
395 return sampleOnPoints(interpolator);
404 return sampleOnPoints(interpolator);
413 return sampleOnPoints(interpolator);
419 os <<
"sampledPatch: " <<
name() <<
" :"
420 <<
" patches:" <<
flatOutput(selectionNames_);
424 os <<
" faces:" << faces().size()
425 <<
" points:" <<
points().size();
List< label > labelList
A List of labels.
virtual bool needsUpdate() const
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
A class for handling words, derived from Foam::string.
const labelList & patchIDs() const
void resize(const label len)
A class for managing temporary objects.
const Addr & addressing() const noexcept
GeometricField< tensor, fvsPatchField, surfaceMesh > surfaceTensorField
A List obtained as a section of another List.
const polyBoundaryMesh & boundaryMesh() const
Ostream & endl(Ostream &os)
Mesh consisting of general polyhedral cells.
virtual tmp< scalarField > sample(const interpolation< scalar > &sampler) const
bool interpolate() const noexcept
virtual bool withSurfaceFields() const
A patch is a list of labels that address the faces in the global face list.
DynamicList< T, SizeMin > & append(const T &val)
sampledPatch(const word &name, const polyMesh &mesh, const UList< wordRe > &patchNames, const bool triangulate=false)
addNamedToRunTimeSelectionTable(topoSetCellSource, badQualityToCell, word, badQuality)
A List with indirect addressing.
An abstract class for surfaces with sampling.
wordList patchNames(nPatches)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Macros for easy insertion into run-time selection tables.
const List< face_type > & localFaces() const
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
errorManipArg< error, int > exit(error &err, const int errNo=1)
const Field< point_type > & localPoints() const
void resize(const label newLen)
const word & name() const noexcept
#define FatalErrorInFunction
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const polyMesh & mesh() const noexcept
Ostream & print(Ostream &os, UIntType value, char off='0', char on='1')
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
labelList identity(const label len, label start=0)
A List of wordRe with additional matching capabilities.
virtual void clearGeom() const
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
word name(const expressions::valueTypeCode typeCode)
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
virtual void print(Ostream &os, int level=0) const
PrimitivePatch< UIndirectList< face >, const pointField & > uindirectPrimitivePatch
A PrimitivePatch with UIndirectList for the faces, const reference for the point field.
GeometricField< sphericalTensor, fvsPatchField, surfaceMesh > surfaceSphericalTensorField
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
UList< label > labelUList
A UList of labels.
GeometricField< symmTensor, fvsPatchField, surfaceMesh > surfaceSymmTensorField
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Generic GeometricField class.
defineTypeNameAndDebug(combustionModel, 0)
#define WarningInFunction
A list of faces which address into the list of points.
A sampledSurface on patches. Non-triangulated by default.
UIndirectList< label > labelUIndList
UIndirectList of labels.