34 namespace sampledSurfaces
44 bool Foam::sampledSurfaces::isoSurface::updateGeometry()
const 46 const fvMesh& fvm =
static_cast<const fvMesh&
>(
mesh());
49 if (fvm.time().timeIndex() == prevTimeIndex_)
54 prevTimeIndex_ = fvm.time().timeIndex();
60 autoPtr<volScalarField> readFieldPtr_;
81 <<
"Reading " << isoField_
82 <<
" from time " <<fvm.time().timeName()
93 fvm.time().timeName(),
103 cellFldPtr = readFieldPtr_.operator->();
107 tmp<pointScalarField> pointFld
112 PtrList<Foam::isoSurface> isos(isoVals_.size());
121 cellFld.primitiveField(),
122 pointFld().primitiveField(),
131 if (isos.size() == 1)
134 const_cast<isoSurface&
> 138 meshCells_ = isos[0].meshCells();
146 nFaces += isos[isoi].size();
147 nPoints += isos[isoi].points().size();
160 SubList<face> subAll(allFaces, iso.
size(), nFaces);
174 SubList<label>(allMeshCells, iso.
size(), nFaces) = iso.
meshCells();
175 nFaces += iso.
size();
179 nPoints += pts.
size();
182 isos.set(isoi,
nullptr);
185 if (nFaces != allFaces.size() || nPoints != allPoints.size())
193 allZones[0] = surfZone
202 const_cast<isoSurface&
> 211 meshCells_.transfer(allMeshCells);
215 Pout<<
"sampledSurfaces::isoSurface::updateGeometry() : " 218 <<
" regularise : " << regularise_ << nl
219 <<
" isoField : " << isoField_ <<
nl;
220 if (isoVals_.size() == 1)
222 Pout<<
" isoValue : " << isoVals_[0] <<
nl;
226 Pout<<
" isoValues : " << isoVals_ <<
nl;
229 <<
" faces : " << faces().size() << nl
230 <<
" cut cells : " << meshCells_.size() <<
endl;
247 isoField_(dict.
lookup(
"isoField")),
250 dict.
found(
"isoValues")
284 if (prevTimeIndex_ == -1)
297 return updateGeometry();
307 return sampleField(vField);
317 return sampleField(vField);
327 return sampleField(vField);
337 return sampleField(vField);
347 return sampleField(vField);
357 return interpolateField(interpolator);
367 return interpolateField(interpolator);
376 return interpolateField(interpolator);
386 return interpolateField(interpolator);
396 return interpolateField(interpolator);
402 os <<
"isoSurface: " <<
name() <<
" :" 403 <<
" field:" << isoField_;
404 if (isoVals_.size() == 1)
406 os <<
" value:" << isoVals_[0];
410 os <<
" values:" << isoVals_;
412 os <<
" faces:" << faces().size()
413 <<
" points:" <<
points().size();
virtual tmp< scalarField > sample(const volScalarField &) const
Sample field on surface.
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#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 ~isoSurface()
Destructor.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const word & name() const
Return the name of this functionObject.
virtual void print(Ostream &) const
Write.
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 vector &p1, const vector &p2, const vector &o, vector &n, scalar l)
void size(const label)
Override size to be inconsistent with allocated storage.
bool interpolate() const
Interpolation requested for surface.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool needsUpdate() const
Does the surface need an update?
void transfer(MeshedSurface< face > &)
Transfer the contents of the argument and annul the argument.
const Time & time() const
Return the top-level database.
isoSurface(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
const labelList & meshCells() const
For every face original cell in mesh.
virtual bool expire()
Mark the surface as needing an update.
Macros for easy insertion into run-time selection tables.
static const volPointInterpolation & New(const fvMesh &mesh)
GeometricField< scalar, fvPatchField, volMesh > volScalarField
vectorField pointField
pointField is a vectorField.
virtual void clearGeom() const
A class for handling words, derived from string.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const Field< PointType > & points() const
Return reference to global points.
List< label > labelList
A List of labels.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
virtual void reset(pointField &&points, List< face > &&faces, surfZoneList &&zones)
Reset primitive data (points, faces and zones)
addToRunTimeSelectionTable(sampledSurface, distanceSurface, word)
List< surfZone > surfZoneList
label timeIndex() const
Return current time index.
label size() const
The surface size is the number of faces.
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
prefixOSstream Pout(cout, "Pout")
Mesh data needed to do the Finite Volume discretisation.
virtual bool update()
Update the surface as required.
Mesh consisting of general polyhedral cells.
Marching tet iso surface algorithm with optional filtering to keep only points originating from mesh ...
A class for managing temporary objects.
static const keyType null
An empty keyType.
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.