Go to the documentation of this file.
45 sampledIsoSurfaceCell,
53 bool Foam::sampledIsoSurfaceCell::updateGeometry()
const
55 const fvMesh& fvm =
static_cast<const fvMesh&
>(
mesh());
58 if (fvm.time().timeIndex() == prevTimeIndex_)
63 prevTimeIndex_ = fvm.time().timeIndex();
70 const auto* cellFldPtr = fvm.findObject<
volScalarField>(isoField_);
81 <<
"Reading " << isoField_
82 <<
" from time " << fvm.time().timeName()
88 autoPtr<volScalarField> fieldReadPtr;
99 fvm.time().timeName(),
110 (fieldReadPtr.valid() ? *fieldReadPtr : *cellFldPtr);
120 for (label pointi = 0; pointi < fvm.nPoints(); ++pointi)
122 const scalar& val = tpointFld().primitiveField()[pointi];
123 const labelList& pCells = fvm.pointCells(pointi);
125 for (
const label celli : pCells)
127 cellAvg[celli] += val;
128 ++nPointCells[celli];
133 cellAvg[celli] /= nPointCells[celli];
140 tpointFld().primitiveField(),
150 meshCells_.
transfer(surf.meshCells());
158 cellFld.primitiveField(),
159 tpointFld().primitiveField(),
169 meshCells_.
transfer(surf.meshCells());
175 Pout<<
"sampledIsoSurfaceCell::updateGeometry() : constructed iso:"
177 <<
" filter : " << Switch(
bool(filter_)) <<
nl
178 <<
" average : " << Switch(average_) <<
nl
179 <<
" isoField : " << isoField_ <<
nl
180 <<
" isoValue : " << isoVal_ <<
nl
181 <<
" bounds : " << bounds_ <<
nl
182 <<
" points : " <<
points().size() <<
nl
184 <<
" cut cells : " << meshCells_.size() <<
endl;
203 isoVal_(
dict.
get<scalar>(
"isoValue")),
241 if (prevTimeIndex_ == -1)
254 return updateGeometry();
264 return sampleOnFaces(sampler);
274 return sampleOnFaces(sampler);
284 return sampleOnFaces(sampler);
294 return sampleOnFaces(sampler);
304 return sampleOnFaces(sampler);
314 return sampleOnPoints(interpolator);
324 return sampleOnPoints(interpolator);
333 return sampleOnPoints(interpolator);
343 return sampleOnPoints(interpolator);
353 return sampleOnPoints(interpolator);
359 os <<
"sampledIsoSurfaceCell: " <<
name() <<
" :"
360 <<
" field:" << isoField_
361 <<
" value:" << isoVal_;
int debug
Static debugging option.
virtual bool expire()
Mark the surface as needing an update.
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
List< label > labelList
A List of labels.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
virtual void print(Ostream &) const
Write.
#define InfoInFunction
Report an information message using Foam::Info.
Remove points from pyramid edges and face-diagonals.
A class for handling words, derived from Foam::string.
A class for managing temporary objects.
static constexpr const zero Zero
Global zero (0)
static const boundBox invertedBox
A large inverted boundBox: min/max == +/- ROOTVGREAT.
virtual bool needsUpdate() const
Does the surface need an update?
static const volPointInterpolation & New(const fvMesh &mesh, Args &&... args)
Get existing or create a new MeshObject.
virtual tmp< scalarField > sample(const interpolation< scalar > &sampler) const
Sample volume field onto surface faces.
Ostream & endl(Ostream &os)
Add newline and flush stream.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
prefixOSstream Pout
An Ostream wrapper for parallel output to std::cout.
tmp< GeometricField< Type, pointPatchField, pointMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &) const
Interpolate volField using inverse distance weighting.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
void transfer(pointField &pointLst, List< face > &faceLst)
Transfer the components.
Field< label > labelField
Specialisation of Field<T> for label.
word name(const complex &c)
Return string representation of complex.
void transfer(List< T > &list)
addNamedToRunTimeSelectionTable(topoSetCellSource, badQualityToCell, word, badQuality)
virtual const pointField & points() const
Points of surface.
An abstract class for surfaces with sampling.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
virtual bool update()
Update the surface as required.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
Mesh data needed to do the Finite Volume discretisation.
MeshedSurface< face > meshedSurface
virtual ~sampledIsoSurfaceCell()
Destructor.
static filterType getFilterType(const dictionary &dict, const isoSurfaceBase::filterType deflt)
Get 'regularise' as bool or enumeration.
virtual void clearGeom() const
Additional cleanup when clearing the geometry.
const Time & time() const
Return the top-level database.
const polyMesh & mesh() const
Access to the underlying mesh.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
label timeIndex() const
Return current time index.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
label size() const
The surface size is the number of faces.
bool interpolate() const
Interpolation to nodes requested for surface.
defineTypeNameAndDebug(combustionModel, 0)
sampledIsoSurfaceCell(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.