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")
287 if (prevTimeIndex_ == -1)
300 return updateGeometry();
310 return sampleField(vField);
320 return sampleField(vField);
330 return sampleField(vField);
340 return sampleField(vField);
350 return sampleField(vField);
360 return interpolateField(interpolator);
370 return interpolateField(interpolator);
379 return interpolateField(interpolator);
389 return interpolateField(interpolator);
399 return interpolateField(interpolator);
405 os <<
"isoSurface: " <<
name() <<
" :" 406 <<
" field:" << isoField_;
407 if (isoVals_.size() == 1)
409 os <<
" value:" << isoVals_[0];
413 os <<
" values:" << isoVals_;
415 os <<
" faces:" << faces().size()
416 <<
" 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.
static const NamedEnum< filterType, 3 > filterTypeNames_
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)
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.
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 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.