56 const dictionary&
dict 64 auto csysPtr = coordinateSystem::NewIfPresent(
mesh,
dict);
68 csysPtr = coordinateSystem::NewIfPresent(
dict,
"transform");
74 coordSystem::cartesian cs(csysPtr());
76 const point orig = cs.globalPosition(pln.origin());
77 const vector norm = cs.globalVector(pln.normal());
81 <<
" origin:" << pln.origin()
82 <<
" normal:" << pln.normal()
89 pln =
plane(orig, norm);
96 Foam::bitSet Foam::sampledPlane::cellSelection(
const bool warn)
const 115 const plane& planeDesc,
117 const bool triangulate
124 triangulate_(triangulate),
129 if (!zoneNames_.
empty())
135 Info<<
" not found!";
146 const polyMesh&
mesh,
147 const dictionary&
dict 151 cuttingPlane(definePlane(
mesh,
dict)),
153 bounds_(
dict.getOrDefault(
"bounds", boundBox::null())),
154 triangulate_(
dict.getOrDefault(
"triangulate", true)),
157 if (!
dict.readIfPresent(
"zones", zoneNames_) &&
dict.found(
"zone"))
160 dict.readEntry(
"zone", zoneNames_.
first());
167 <<
" normal:" <<
normal();
171 Info<<
" bounds:" << bounds_;
174 if (!zoneNames_.
empty())
180 Info<<
" not found!";
220 performCut(
mesh(), triangulate_, cellSelection(
true));
228 needsUpdate_ =
false;
238 return sampleOnFaces(sampler);
247 return sampleOnFaces(sampler);
256 return sampleOnFaces(sampler);
265 return sampleOnFaces(sampler);
274 return sampleOnFaces(sampler);
283 return sampleOnPoints(interpolator);
292 return sampleOnPoints(interpolator);
300 return sampleOnPoints(interpolator);
309 return sampleOnPoints(interpolator);
318 return sampleOnPoints(interpolator);
324 os <<
"sampledPlane: " <<
name() <<
" :" 327 <<
" triangulate:" << triangulate_;
331 os <<
" faces:" << faces().size()
void size(const label n)
Older name for setAddressableSize.
bool interpolate() const noexcept
Same as isPointData()
virtual void print(Ostream &os, int level=0) const
Print information.
void resize(const label len)
Adjust allocated size of list.
const polyMesh & mesh() const noexcept
Access to the underlying mesh.
An abstract class for surfaces with sampling.
label findIndex(const wordRe &key) const
Zone index for the first match, return -1 if not found.
Ostream & print(Ostream &os, UIntType value, char off='0', char on='1')
Print 0/1 bits in the (unsigned) integral type.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
T & first()
Access first element of the list, position [0].
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual tmp< scalarField > sample(const interpolation< scalar > &sampler) const
Sample volume field onto surface faces.
Geometric class that creates a 3D plane and can return the intersection point between a line and the ...
virtual bool expire()
Mark the surface as needing an update.
Macros for easy insertion into run-time selection tables.
addNamedToRunTimeSelectionTable(topoSetCellSource, badQualityToCell, word, badQuality)
const word & name() const noexcept
Name of surface.
virtual bool needsUpdate() const
Does the surface need an update?
const point & origin() const noexcept
The plane base point.
Constructs cutting plane through a mesh.
virtual void clearGeom() const
Additional cleanup when clearing the geometry.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
bool valid() const
Bounding box is non-inverted - same as good().
A class for handling words, derived from Foam::string.
sampledPlane(const word &name, const polyMesh &mesh, const plane &planeDesc, const wordRes &zones=wordRes(), const bool triangulate=true)
Construct from components.
A List of wordRe with additional matching capabilities.
virtual bool update()
Update the surface as required.
#define DebugInfo
Report an information message using Foam::Info.
plane()
Construct zero-initialised.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
static int debug
Debug information.
int debug
Static debugging option.
OBJstream os(runTime.globalPath()/outputName)
defineTypeNameAndDebug(combustionModel, 0)
vector point
Point is a vector.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
const cellZoneMesh & cellZones() const noexcept
Return cell zone mesh.
messageStream Info
Information stream (stdout output on master, null elsewhere)
bitSet cellSelection(const polyMesh &mesh, const boundBox &userBounds, const wordRes &zoneNames, const word callerName, const bool warn) const
Define cell selection from bounding-box and zones.
Mesh consisting of general polyhedral cells.
A class for managing temporary objects.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
const vector & normal() const noexcept
The plane unit normal.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.