34 namespace sampledSurfaces
44 bool Foam::sampledSurfaces::thresholdCellFaces::updateGeometry()
const
46 const fvMesh& fvm =
static_cast<const fvMesh&
>(
mesh());
49 if (fvm.time().timeIndex() == prevTimeIndex_)
54 prevTimeIndex_ = fvm.time().timeIndex();
57 autoPtr<volScalarField> readFieldPtr_;
78 <<
"Reading " << fieldName_
79 <<
" from time " << fvm.time().name()
100 cellFldPtr = readFieldPtr_.operator->();
108 cellFld.primitiveField(),
118 meshCells_.
transfer(surf.meshCells());
125 Pout<<
"thresholdCellFaces::updateGeometry() : constructed"
127 <<
" field : " << fieldName_ <<
nl
128 <<
" lowerLimit : " << lowerThreshold_ <<
nl
129 <<
" upperLimit : " << upperThreshold_ <<
nl
132 <<
" cut cells : " << meshCells_.
size() <<
endl;
149 fieldName_(
dict.lookup(
"field")),
150 lowerThreshold_(
dict.lookupOrDefault<scalar>(
"lowerLimit", -vGreat)),
151 upperThreshold_(
dict.lookupOrDefault<scalar>(
"upperLimit", vGreat)),
152 triangulate_(
dict.lookupOrDefault(
"triangulate", false)),
156 if (!
dict.found(
"lowerLimit") && !
dict.found(
"upperLimit"))
159 <<
"require at least one of 'lowerLimit' or 'upperLimit'" <<
endl
190 if (prevTimeIndex_ == -1)
203 return updateGeometry();
213 return sampleField(vField);
223 return sampleField(vField);
233 return sampleField(vField);
243 return sampleField(vField);
253 return sampleField(vField);
263 return interpolateField(interpolator);
273 return interpolateField(interpolator);
282 return interpolateField(interpolator);
292 return interpolateField(interpolator);
302 return interpolateField(interpolator);
308 os <<
"thresholdCellFaces: " <<
name() <<
" :"
309 <<
" field:" << fieldName_
310 <<
" lowerLimit:" << lowerThreshold_
311 <<
" upperLimit:" << upperThreshold_;
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
void size(const label)
Override size to be inconsistent with allocated storage.
void transfer(MeshedSurface< face > &)
Transfer the contents of the argument and annul the argument.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
label timeIndex() const
Return current time index.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Mesh data needed to do the Finite Volume discretisation.
const Time & time() const
Return the top-level database.
Abstract base class for interpolation.
Mesh consisting of general polyhedral cells.
An abstract class for surfaces with sampling.
virtual void clearGeom() const
bool interpolate() const
Interpolation requested for surface.
const polyMesh & mesh() const
Access to the underlying mesh.
A sampledSurface defined by the cell faces corresponding to a threshold value.
thresholdCellFaces(const word &name, const polyMesh &, const dictionary &)
Construct from dictionary.
virtual wordList fields() const
Return the list of fields required.
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.
virtual const faceList & faces() const
Faces of surface.
virtual ~thresholdCellFaces()
Destructor.
virtual const pointField & points() const
Points of surface.
Selects the mesh cell faces specified by a threshold value. Non-triangulated by default.
A class for managing temporary objects.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define InfoInFunction
Report an information message using Foam::Info.
defineTypeNameAndDebug(cutPlane, 0)
addToRunTimeSelectionTable(sampledSurface, cutPlane, word)
List< word > wordList
A List of words.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
errorManip< error > abort(error &err)
VolField< scalar > volScalarField
prefixOSstream Pout(cout, "Pout")