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")),
156 if (!dict.
found(
"lowerLimit") && !dict.
found(
"upperLimit"))
159 <<
"require at least one of 'lowerLimit' or 'upperLimit'" <<
endl 184 if (prevTimeIndex_ == -1)
197 return updateGeometry();
207 return sampleField(vField);
217 return sampleField(vField);
227 return sampleField(vField);
237 return sampleField(vField);
247 return sampleField(vField);
257 return interpolateField(interpolator);
267 return interpolateField(interpolator);
276 return interpolateField(interpolator);
286 return interpolateField(interpolator);
296 return interpolateField(interpolator);
302 os <<
"thresholdCellFaces: " <<
name() <<
" :" 303 <<
" field:" << fieldName_
304 <<
" lowerLimit:" << lowerThreshold_
305 <<
" 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.
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 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...
virtual tmp< scalarField > sample(const volScalarField &) const
Sample field on surface.
addToRunTimeSelectionTable(sampledSurface, distanceSurface, word)
word name(const complex &)
Return a string representation of a complex.
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.
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.