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_;
90 <<
"Reading " << isoField_
91 <<
" 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().primitiveField()[pointi];
136 nPointCells[celli]++;
142 cellAvg[celli] /= nPointCells[celli];
145 const isoSurfaceCell iso
149 pointFld().primitiveField(),
154 const_cast<sampledIsoSurfaceCell&
> 158 meshCells_ = iso.meshCells();
163 const isoSurfaceCell iso
166 cellFld.primitiveField(),
167 pointFld().primitiveField(),
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")),
242 if (prevTimeIndex_ == -1)
255 return updateGeometry();
265 return sampleField(vField);
275 return sampleField(vField);
285 return sampleField(vField);
295 return sampleField(vField);
305 return sampleField(vField);
315 return interpolateField(interpolator);
325 return interpolateField(interpolator);
334 return interpolateField(interpolator);
344 return interpolateField(interpolator);
354 return interpolateField(interpolator);
360 os <<
"sampledIsoSurfaceCell: " <<
name() <<
" :" 361 <<
" field:" << isoField_
362 <<
" value:" << isoVal_;
label timeIndex() const
Return current time index.
virtual bool needsUpdate() const
Does the surface need an update?
Field< label > labelField
Specialisation of Field<T> for label.
virtual void clearGeom() const
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
virtual tmp< scalarField > sample(const volScalarField &) const
Sample field on surface.
friend Ostream & operator(Ostream &, const UList< T > &)
A list of keyword definitions, which are a keyword followed by any number of values (e...
An abstract class for surfaces with sampling.
bool interpolate(const vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool update()
Update the surface as required.
Macros for easy insertion into run-time selection tables.
static const volPointInterpolation & New(const fvMesh &mesh)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual ~sampledIsoSurfaceCell()
Destructor.
List< label > labelList
A List of labels.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
prefixOSstream Pout(cout,"Pout")
defineTypeNameAndDebug(combustionModel, 0)
label size() const
Return the number of elements in the UList.
word name(const complex &)
Return a string representation of a complex.
addNamedToRunTimeSelectionTable(GAMGProcAgglomeration, noneGAMGProcAgglomeration, GAMGAgglomeration, none)
bool interpolate() const
Interpolation requested for surface.
sampledIsoSurfaceCell(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
Mesh data needed to do the Finite Volume discretisation.
virtual void print(Ostream &) const
Write.
virtual bool expire()
Mark the surface as needing an update.
Mesh consisting of general polyhedral cells.
A class for managing temporary objects.
static const keyType null
An empty keyType.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
const Time & time() const
Return the top-level database.
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.