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);
96Foam::bitSet Foam::sampledPlane::cellSelection(
const bool warn)
const
115 const plane& planeDesc,
117 const bool triangulate
124 triangulate_(triangulate),
129 if (!zoneNames_.
empty())
133 if (-1 ==
mesh.cellZones().findIndex(zoneNames_))
135 Info<<
" not found!";
154 triangulate_(
dict.getOrDefault(
"triangulate", true)),
157 if (!
dict.readIfPresent(
"zones", zoneNames_) &&
dict.found(
"zone"))
159 zoneNames_.resize(1);
160 dict.readEntry(
"zone", zoneNames_.first());
167 <<
" normal:" <<
normal();
171 Info<<
" bounds:" << bounds_;
174 if (!zoneNames_.empty())
178 if (-1 ==
mesh.cellZones().findIndex(zoneNames_))
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()
if(maxValue - minValue< SMALL)
Macros for easy insertion into run-time selection tables.
#define addNamedToRunTimeSelectionTable(baseType, thisType, argNames, lookupName)
Add to construction table with 'lookupName' as the key.
static const List< face > & null() noexcept
virtual label triangulate()
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bool empty() const noexcept
True if List is empty (ie, size() is zero).
void size(const label n)
Older name for setAddressableSize.
A bounding box defined in terms of min/max extrema points.
Constructs cutting plane through a mesh.
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.
virtual void performCut(const primitiveMesh &mesh, const bool triangulate, bitSet &&cellIdLabels)
Cut mesh, restricted to a list of cells.
cuttingPlane(const plane &pln)
Construct from a plane description without any cutting.
const plane & planeDesc() const
The plane used.
static int debug
Debug information.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Abstract base class for volume field interpolation.
Geometric class that creates a 3D plane and can return the intersection point between a line and the ...
plane()
Construct zero-initialised.
const point & origin() const noexcept
The plane base point.
const vector & normal() const noexcept
The plane unit normal.
Mesh consisting of general polyhedral cells.
A sampledSurface defined by a plane which cuts the mesh using the cuttingPlane alorithm....
virtual void print(Ostream &os, int level=0) const
Print information.
virtual tmp< scalarField > sample(const interpolation< scalar > &sampler) const
Sample volume field onto surface faces.
virtual const faceList & faces() const
Faces of 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.
sampledPlane(const word &name, const polyMesh &mesh, const plane &planeDesc, const wordRes &zones=wordRes(), const bool triangulate=true)
Construct from components.
An abstract class for surfaces with sampling.
sampledSurface(const word &name, std::nullptr_t)
Construct null.
const word & name() const noexcept
Name of surface.
virtual void clearGeom() const
Additional cleanup when clearing the geometry.
const polyMesh & mesh() const noexcept
Access to the underlying mesh.
bool interpolate() const noexcept
Same as isPointData().
A class for managing temporary objects.
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
OBJstream os(runTime.globalPath()/outputName)
#define DebugInfo
Report an information message using Foam::Info.
Namespace for handling debugging switches.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
vector point
Point is a vector.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.