33 namespace sampledSurfaces
43 bool Foam::sampledSurfaces::isoSurface::updateGeometry()
const 45 const fvMesh& fvm =
static_cast<const fvMesh&
>(
mesh());
48 if (fvm.time().timeIndex() == prevTimeIndex_)
53 prevTimeIndex_ = fvm.time().timeIndex();
59 autoPtr<volScalarField> readFieldPtr_;
80 <<
"Reading " << isoField_
81 <<
" from time " <<fvm.time().timeName()
92 fvm.time().timeName(),
102 cellFldPtr = readFieldPtr_.operator->();
106 tmp<pointScalarField> pointFld
111 PtrList<Foam::isoSurface> isos(isoVals_.size());
120 cellFld.primitiveField(),
121 pointFld().primitiveField(),
128 if (isos.size() == 1)
131 const_cast<isoSurface&
> 135 meshCells_ = isos[0].meshCells();
143 nFaces += isos[isoi].size();
144 nPoints += isos[isoi].points().size();
157 SubList<face> subAll(allFaces, iso.
size(), nFaces);
171 SubList<label>(allMeshCells, iso.
size(), nFaces) = iso.
meshCells();
172 nFaces += iso.
size();
176 nPoints += pts.
size();
179 isos.set(isoi,
nullptr);
182 if (nFaces != allFaces.size() || nPoints != allPoints.size())
190 allZones[0] = surfZone
199 const_cast<isoSurface&
> 208 meshCells_.transfer(allMeshCells);
212 Pout<<
"sampledSurfaces::isoSurface::updateGeometry() : " 217 <<
" isoField : " << isoField_ <<
nl;
218 if (isoVals_.size() == 1)
220 Pout<<
" isoValue : " << isoVals_[0] <<
nl;
224 Pout<<
" isoValues : " << isoVals_ <<
nl;
227 <<
" faces : " << faces().size() << nl
228 <<
" cut cells : " << meshCells_.size() <<
endl;
245 isoField_(dict.
lookup(
"isoField")),
248 dict.
found(
"isoValues")
254 dict.
found(
"filtering")
286 if (prevTimeIndex_ == -1)
299 return updateGeometry();
309 return sampleField(vField);
319 return sampleField(vField);
329 return sampleField(vField);
339 return sampleField(vField);
349 return sampleField(vField);
359 return interpolateField(interpolator);
369 return interpolateField(interpolator);
378 return interpolateField(interpolator);
388 return interpolateField(interpolator);
398 return interpolateField(interpolator);
404 os <<
"isoSurface: " <<
name() <<
" :" 405 <<
" field:" << isoField_;
406 if (isoVals_.size() == 1)
408 os <<
" value:" << isoVals_[0];
412 os <<
" values:" << isoVals_;
414 os <<
" faces:" << faces().size()
415 <<
" points:" <<
points().size();
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)
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)
static const NamedEnum< filterType, 4 > filterTypeNames_
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.
virtual tmp< scalarField > sample(const volScalarField &) const
Sample field on surface.
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.
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)
static volPointInterpolation & New(fvMesh &mesh)
addToRunTimeSelectionTable(sampledSurface, distanceSurface, word)
word name(const complex &)
Return a string representation of a complex.
List< surfZone > surfZoneList
label timeIndex() const
Return current time index.
label size() const
The surface size is the number of faces.
prefixOSstream Pout(cout, "Pout")
Mesh data needed to do the Finite Volume discretisation.
Enum read(Istream &) const
Read a word from Istream and return the corresponding.
virtual bool update()
Update the surface as required.
Mesh consisting of general polyhedral cells.
Marching tet iso surface algorithm with filtering to remove unnecessary topology. ...
A class for managing temporary objects.
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.