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().timeName()
90 fvm.time().timeName(),
100 cellFldPtr = readFieldPtr_.operator->();
108 cellFld.primitiveField(),
114 const_cast<thresholdCellFaces&
> 118 meshCells_.transfer(surf.meshCells());
125 Pout<<
"thresholdCellFaces::updateGeometry() : constructed" 127 <<
" field : " << fieldName_ <<
nl 128 <<
" lowerLimit : " << lowerThreshold_ <<
nl 129 <<
" upperLimit : " << upperThreshold_ <<
nl 130 <<
" point : " <<
points().size() <<
nl 131 <<
" faces : " << faces().size() <<
nl 132 <<
" cut cells : " << meshCells_.size() <<
endl;
149 fieldName_(dict.
lookup(
"field")),
157 if (!dict.
found(
"lowerLimit") && !dict.
found(
"upperLimit"))
160 <<
"require at least one of 'lowerLimit' or 'upperLimit'" <<
endl 185 if (prevTimeIndex_ == -1)
198 return updateGeometry();
208 return sampleField(vField);
218 return sampleField(vField);
228 return sampleField(vField);
238 return sampleField(vField);
248 return sampleField(vField);
258 return interpolateField(interpolator);
268 return interpolateField(interpolator);
277 return interpolateField(interpolator);
287 return interpolateField(interpolator);
297 return interpolateField(interpolator);
303 os <<
"thresholdCellFaces: " <<
name() <<
" :" 304 <<
" field:" << fieldName_
305 <<
" lowerLimit:" << lowerThreshold_
306 <<
" upperLimit:" << upperThreshold_;
virtual bool update()
Update the surface as required.
Selects the mesh cell faces specified by a threshold value. Non-triangulated by default.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
thresholdCellFaces(const word &name, const polyMesh &, const dictionary &)
Construct from dictionary.
const word & name() const
Return the name of this functionObject.
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
An abstract class for surfaces with sampling.
defineTypeNameAndDebug(distanceSurface, 0)
bool interpolate() const
Interpolation requested for surface.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void transfer(MeshedSurface< face > &)
Transfer the contents of the argument and annul the argument.
const Time & time() const
Return the top-level database.
virtual bool needsUpdate() const
Does the surface need an update?
Macros for easy insertion into run-time selection tables.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
virtual tmp< scalarField > sample(const volScalarField &) const
Sample field on surface.
virtual void clearGeom() const
A class for handling words, derived from string.
errorManip< error > abort(error &err)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
addToRunTimeSelectionTable(sampledSurface, distanceSurface, word)
virtual bool expire()
Mark the surface as needing an update.
label timeIndex() const
Return current time index.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
prefixOSstream Pout(cout, "Pout")
virtual ~thresholdCellFaces()
Destructor.
Mesh data needed to do the Finite Volume discretisation.
Mesh consisting of general polyhedral cells.
A class for managing temporary objects.
static const keyType null
An empty keyType.
virtual void print(Ostream &) const
Write.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
#define InfoInFunction
Report an information message using Foam::Info.