42 sampledIsoSurfaceCell,
50 bool Foam::sampledIsoSurfaceCell::updateGeometry()
const 52 const fvMesh& fvm =
static_cast<const fvMesh&
>(
mesh());
55 if (fvm.time().timeIndex() == prevTimeIndex_)
60 prevTimeIndex_ = fvm.time().timeIndex();
69 autoPtr<volScalarField> readFieldPtr_;
78 Info<<
"sampledIsoSurfaceCell::updateGeometry() : lookup " 90 Info<<
"sampledIsoSurfaceCell::updateGeometry() : reading " 91 << isoField_ <<
" from time " <<fvm.time().timeName()
102 fvm.time().timeName(),
112 cellFldPtr = readFieldPtr_.operator->();
116 tmp<pointScalarField> pointFld
127 for (
label pointI = 0; pointI < fvm.nPoints(); pointI++)
129 const labelList& pCells = fvm.pointCells(pointI);
133 label cellI = pCells[i];
135 cellAvg[cellI] += pointFld().internalField()[pointI];
136 nPointCells[cellI]++;
142 cellAvg[cellI] /= nPointCells[cellI];
145 const isoSurfaceCell iso
154 const_cast<sampledIsoSurfaceCell&
> 158 meshCells_ = iso.meshCells();
163 const isoSurfaceCell iso
166 cellFld.internalField(),
167 pointFld().internalField(),
172 const_cast<sampledIsoSurfaceCell&
> 176 meshCells_ = iso.meshCells();
182 Pout<<
"sampledIsoSurfaceCell::updateGeometry() : constructed iso:" 184 <<
" regularise : " << regularise_ <<
nl 185 <<
" average : " << average_ <<
nl 186 <<
" isoField : " << isoField_ <<
nl 187 <<
" isoValue : " << isoVal_ <<
nl 190 <<
" cut cells : " << meshCells_.size() <<
endl;
207 isoField_(dict.
lookup(
"isoField")),
250 if (prevTimeIndex_ == -1)
263 return updateGeometry();
273 return sampleField(vField);
283 return sampleField(vField);
293 return sampleField(vField);
303 return sampleField(vField);
313 return sampleField(vField);
323 return interpolateField(interpolator);
333 return interpolateField(interpolator);
342 return interpolateField(interpolator);
352 return interpolateField(interpolator);
362 return interpolateField(interpolator);
368 os <<
"sampledIsoSurfaceCell: " <<
name() <<
" :" 369 <<
" field:" << isoField_
370 <<
" value:" << isoVal_;
virtual bool update()
Update the surface as required.
const pointField & points
Mesh data needed to do the Finite Volume discretisation.
An abstract class for surfaces with sampling.
word name(const complex &)
Return a string representation of a complex.
static const volPointInterpolation & New(const fvMesh &mesh)
Field< label > labelField
Specialisation of Field<T> for label.
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void size(const label)
Override size to be inconsistent with allocated storage.
friend Ostream & operator(Ostream &, const UList< T > &)
A list of keyword definitions, which are a keyword followed by any number of values (e...
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const Time & time() const
Return the top-level database.
Ostream & endl(Ostream &os)
Add newline and flush stream.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
label timeIndex() const
Return current time index.
static const keyType null
An empty keyType.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
virtual void clearGeom() const
Macros for easy insertion into run-time selection tables.
sampledIsoSurfaceCell(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
bool interpolate() const
Interpolation requested for surface.
virtual ~sampledIsoSurfaceCell()
Destructor.
Mesh consisting of general polyhedral cells.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
virtual bool expire()
Mark the surface as needing an update.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
List< label > labelList
A List of labels.
label size() const
Return the number of elements in the UList.
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.
addNamedToRunTimeSelectionTable(GAMGProcAgglomeration, noneGAMGProcAgglomeration, GAMGAgglomeration, none)
A class for managing temporary objects.
virtual void print(Ostream &) const
Write.
conserve internalField()+
defineTypeNameAndDebug(combustionModel, 0)
prefixOSstream Pout(cout,"Pout")
virtual bool needsUpdate() const
Does the surface need an update?