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")
292 if (prevTimeIndex_ == -1)
305 return updateGeometry();
315 return sampleField(vField);
325 return sampleField(vField);
335 return sampleField(vField);
345 return sampleField(vField);
355 return sampleField(vField);
365 return interpolateField(interpolator);
375 return interpolateField(interpolator);
384 return interpolateField(interpolator);
394 return interpolateField(interpolator);
404 return interpolateField(interpolator);
410 os <<
"isoSurface: " <<
name() <<
" :" 411 <<
" field:" << isoField_;
412 if (isoVals_.size() == 1)
414 os <<
" value:" << isoVals_[0];
418 os <<
" values:" << isoVals_;
420 os <<
" faces:" << faces().size()
421 <<
" 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.
FvWallInfoData< WallInfo, label > 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.
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.
virtual wordList fields() const
Return the list of fields required.
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
List< word > wordList
A List of words.
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.