Public Member Functions | Private Member Functions | Private Attributes
sampledIsoSurface Class Reference

A sampledSurface defined by a surface of iso value. Always triangulated. To be used in sampleSurfaces / functionObjects. Recalculates iso surface only if time changes. More...

Inheritance diagram for sampledIsoSurface:
Inheritance graph
[legend]
Collaboration diagram for sampledIsoSurface:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("sampledIsoSurface")
 Runtime type information. More...
 
 sampledIsoSurface (const word &name, const polyMesh &mesh, const dictionary &dict)
 Construct from dictionary. More...
 
virtual ~sampledIsoSurface ()
 Destructor. More...
 
virtual bool needsUpdate () const
 Does the surface need an update? More...
 
virtual bool expire ()
 Mark the surface as needing an update. More...
 
virtual bool update ()
 Update the surface as required. More...
 
virtual const pointFieldpoints () const
 Points of surface. More...
 
virtual const faceListfaces () const
 Faces of surface. More...
 
const isoSurfacesurface () const
 
void getIsoField ()
 Lookup or read isoField. Sets volFieldPtr_ and pointFieldPtr_. More...
 
virtual tmp< scalarFieldsample (const volScalarField &) const
 Sample field on surface. More...
 
virtual tmp< vectorFieldsample (const volVectorField &) const
 Sample field on surface. More...
 
virtual tmp< sphericalTensorFieldsample (const volSphericalTensorField &) const
 Sample field on surface. More...
 
virtual tmp< symmTensorFieldsample (const volSymmTensorField &) const
 Sample field on surface. More...
 
virtual tmp< tensorFieldsample (const volTensorField &) const
 Sample field on surface. More...
 
virtual tmp< scalarFieldinterpolate (const interpolation< scalar > &) const
 Interpolate field on surface. More...
 
virtual tmp< vectorFieldinterpolate (const interpolation< vector > &) const
 Interpolate field on surface. More...
 
virtual tmp< sphericalTensorFieldinterpolate (const interpolation< sphericalTensor > &) const
 Interpolate field on surface. More...
 
virtual tmp< symmTensorFieldinterpolate (const interpolation< symmTensor > &) const
 Interpolate field on surface. More...
 
virtual tmp< tensorFieldinterpolate (const interpolation< tensor > &) const
 Interpolate field on surface. More...
 
virtual void print (Ostream &) const
 Write. More...
 
template<class Type >
Foam::tmp< Foam::Field< Type > > sampleField (const GeometricField< Type, fvPatchField, volMesh > &vField) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > interpolateField (const interpolation< Type > &interpolator) const
 
- Public Member Functions inherited from sampledSurface
 TypeName ("sampledSurface")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, sampledSurface, word,(const word &name, const polyMesh &mesh, const dictionary &dict),(name, mesh, dict))
 Declare run-time constructor selection table. More...
 
 sampledSurface (const word &name, const polyMesh &, const bool interpolate=false)
 Construct from name, mesh. More...
 
 sampledSurface (const word &name, const polyMesh &, const dictionary &)
 Construct from dictionary. More...
 
autoPtr< sampledSurfaceclone () const
 Clone. More...
 
virtual ~sampledSurface ()
 Destructor. More...
 
const polyMeshmesh () const
 Access to the underlying mesh. More...
 
const wordname () const
 Name of surface. More...
 
bool interpolate () const
 Interpolation requested for surface. More...
 
virtual const vectorFieldSf () const
 Return face area vectors. More...
 
virtual const scalarFieldmagSf () const
 Return face area magnitudes. More...
 
virtual const vectorFieldCf () const
 Return face centres as vectorField. More...
 
scalar area () const
 The total surface area. More...
 
template<class Type >
Type integrate (const Field< Type > &) const
 Integration of a field across the surface. More...
 
template<class Type >
Type integrate (const tmp< Field< Type > > &) const
 Integration of a field across the surface. More...
 
template<class Type >
Type average (const Field< Type > &) const
 Area-averaged value of a field across the surface. More...
 
template<class Type >
Type average (const tmp< Field< Type > > &) const
 Area-averaged value of a field across the surface. More...
 
tmp< Field< scalar > > project (const Field< scalar > &) const
 Project field onto surface. More...
 
tmp< Field< scalar > > project (const Field< vector > &) const
 Project field onto surface. More...
 
tmp< Field< vector > > project (const Field< sphericalTensor > &) const
 Project field onto surface. More...
 
tmp< Field< vector > > project (const Field< symmTensor > &) const
 Project field onto surface. More...
 
tmp< Field< vector > > project (const Field< tensor > &) const
 Project field onto surface. More...
 
template<class Type >
tmp< GeometricField< Type, fvPatchField, volMesh > > pointAverage (const GeometricField< Type, pointPatchField, pointMesh > &pfld) const
 Interpolate from points to cell centre. More...
 
virtual void rename (const word &newName)
 Rename. More...
 
template<class ReturnType , class Type >
Foam::tmp< Foam::Field< ReturnType > > project (const tmp< Field< Type > > &field) const
 
template<class Type >
Foam::tmp< Foam::GeometricField< Type, Foam::fvPatchField, Foam::volMesh > > pointAverage (const GeometricField< Type, pointPatchField, pointMesh > &pfld) const
 

Private Member Functions

void getIsoFields () const
 Get fields needed to recreate iso surface. More...
 
bool updateGeometry () const
 Create iso surface (if time has changed) More...
 
template<class Type >
tmp< Field< Type > > sampleField (const GeometricField< Type, fvPatchField, volMesh > &vField) const
 Sample field on faces. More...
 
template<class Type >
tmp< Field< Type > > interpolateField (const interpolation< Type > &) const
 

Private Attributes

const word isoField_
 Field to get isoSurface of. More...
 
const scalar isoVal_
 Iso value. More...
 
const boundBox bounds_
 Optional bounding box to trim triangles against. More...
 
const scalar mergeTol_
 Merge tolerance. More...
 
const Switch regularise_
 Whether to coarse. More...
 
const Switch average_
 Whether to recalculate cell values as average of point values. More...
 
cellZoneID zoneID_
 Zone name/index (if restricted to zones) More...
 
word exposedPatchName_
 For zones: patch to put exposed faces into. More...
 
autoPtr< isoSurfacesurfPtr_
 
autoPtr< faceListfacesPtr_
 Triangles converted to faceList. More...
 
label prevTimeIndex_
 Time at last call, also track if surface needs an update. More...
 
autoPtr< volScalarFieldstoredVolFieldPtr_
 Cached volfield. More...
 
const volScalarFieldvolFieldPtr_
 
const pointScalarFieldpointFieldPtr_
 Cached pointfield. More...
 
autoPtr< fvMeshSubsetsubMeshPtr_
 Cached submesh. More...
 
autoPtr< volScalarFieldstoredVolSubFieldPtr_
 Cached volfield. More...
 
const volScalarFieldvolSubFieldPtr_
 
const pointScalarFieldpointSubFieldPtr_
 Cached pointfield. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from sampledSurface
static autoPtr< sampledSurfaceNew (const word &name, const polyMesh &, const dictionary &)
 Return a reference to the selected surface. More...
 
- Protected Member Functions inherited from sampledSurface
virtual void clearGeom () const
 

Detailed Description

A sampledSurface defined by a surface of iso value. Always triangulated. To be used in sampleSurfaces / functionObjects. Recalculates iso surface only if time changes.

Source files

Definition at line 53 of file sampledIsoSurface.H.

Constructor & Destructor Documentation

◆ sampledIsoSurface()

sampledIsoSurface ( const word name,
const polyMesh mesh,
const dictionary dict 
)

◆ ~sampledIsoSurface()

~sampledIsoSurface ( )
virtual

Destructor.

Definition at line 513 of file sampledIsoSurface.C.

Member Function Documentation

◆ getIsoFields()

void getIsoFields ( ) const
private

◆ updateGeometry()

bool updateGeometry ( ) const
private

Create iso surface (if time has changed)

Do nothing (and return false) if no update was needed

Definition at line 345 of file sampledIsoSurface.C.

References polyMesh::boundaryMesh(), polyMesh::cellZones(), Foam::endl(), Foam::Info, mesh, Foam::nl, patches, points, Foam::Pout, fvMesh::time(), and TimeState::timeIndex().

Here is the call graph for this function:

◆ sampleField() [1/2]

tmp<Field<Type> > sampleField ( const GeometricField< Type, fvPatchField, volMesh > &  vField) const
private

Sample field on faces.

◆ interpolateField() [1/2]

tmp<Field<Type> > interpolateField ( const interpolation< Type > &  ) const
private

◆ TypeName()

TypeName ( "sampledIsoSurface"  )

Runtime type information.

◆ needsUpdate()

bool needsUpdate ( ) const
virtual

Does the surface need an update?

Implements sampledSurface.

Definition at line 519 of file sampledIsoSurface.C.

References mesh, fvMesh::time(), and TimeState::timeIndex().

Here is the call graph for this function:

◆ expire()

bool expire ( )
virtual

Mark the surface as needing an update.

May also free up unneeded data. Return false if surface was already marked as expired.

Implements sampledSurface.

Definition at line 527 of file sampledIsoSurface.C.

◆ update()

bool update ( )
virtual

Update the surface as required.

Do nothing (and return false) if no update was needed

Implements sampledSurface.

Definition at line 548 of file sampledIsoSurface.C.

◆ points()

virtual const pointField& points ( ) const
inlinevirtual

Points of surface.

Implements sampledSurface.

Definition at line 174 of file sampledIsoSurface.H.

References PrimitivePatch< Face, FaceList, PointField, PointType >::points(), and sampledIsoSurface::surface().

Here is the call graph for this function:

◆ faces()

virtual const faceList& faces ( ) const
inlinevirtual

Faces of surface.

Implements sampledSurface.

Definition at line 180 of file sampledIsoSurface.H.

References sampledIsoSurface::facesPtr_, forAll, s(), and sampledIsoSurface::surface().

Here is the call graph for this function:

◆ surface()

const isoSurface& surface ( ) const
inline

Definition at line 197 of file sampledIsoSurface.H.

References sampledIsoSurface::surfPtr_.

Referenced by sampledIsoSurface::faces(), and sampledIsoSurface::points().

Here is the caller graph for this function:

◆ getIsoField()

void getIsoField ( )

Lookup or read isoField. Sets volFieldPtr_ and pointFieldPtr_.

◆ sample() [1/5]

Foam::tmp< Foam::scalarField > sample ( const volScalarField vField) const
virtual

Sample field on surface.

Implements sampledSurface.

Definition at line 555 of file sampledIsoSurface.C.

◆ sample() [2/5]

Foam::tmp< Foam::tensorField > sample ( const volVectorField vField) const
virtual

Sample field on surface.

Implements sampledSurface.

Definition at line 564 of file sampledIsoSurface.C.

◆ sample() [3/5]

virtual tmp<sphericalTensorField> sample ( const volSphericalTensorField ) const
virtual

Sample field on surface.

Implements sampledSurface.

◆ sample() [4/5]

virtual tmp<symmTensorField> sample ( const volSymmTensorField ) const
virtual

Sample field on surface.

Implements sampledSurface.

◆ sample() [5/5]

virtual tmp<tensorField> sample ( const volTensorField ) const
virtual

Sample field on surface.

Implements sampledSurface.

◆ interpolate() [1/5]

Foam::tmp< Foam::scalarField > interpolate ( const interpolation< scalar > &  interpolator) const
virtual

Interpolate field on surface.

Implements sampledSurface.

Definition at line 600 of file sampledIsoSurface.C.

◆ interpolate() [2/5]

Foam::tmp< Foam::vectorField > interpolate ( const interpolation< vector > &  interpolator) const
virtual

Interpolate field on surface.

Implements sampledSurface.

Definition at line 609 of file sampledIsoSurface.C.

◆ interpolate() [3/5]

Foam::tmp< Foam::sphericalTensorField > interpolate ( const interpolation< sphericalTensor > &  interpolator) const
virtual

Interpolate field on surface.

Implements sampledSurface.

Definition at line 617 of file sampledIsoSurface.C.

◆ interpolate() [4/5]

Foam::tmp< Foam::symmTensorField > interpolate ( const interpolation< symmTensor > &  interpolator) const
virtual

Interpolate field on surface.

Implements sampledSurface.

Definition at line 626 of file sampledIsoSurface.C.

◆ interpolate() [5/5]

Foam::tmp< Foam::tensorField > interpolate ( const interpolation< tensor > &  interpolator) const
virtual

Interpolate field on surface.

Implements sampledSurface.

Definition at line 635 of file sampledIsoSurface.C.

◆ print()

void print ( Ostream os) const
virtual

Write.

Reimplemented from sampledSurface.

Definition at line 643 of file sampledIsoSurface.C.

References Foam::name().

Here is the call graph for this function:

◆ sampleField() [2/2]

Foam::tmp<Foam::Field<Type> > sampleField ( const GeometricField< Type, fvPatchField, volMesh > &  vField) const

Definition at line 36 of file sampledIsoSurfaceTemplates.C.

◆ interpolateField() [2/2]

Foam::tmp<Foam::Field<Type> > interpolateField ( const interpolation< Type > &  interpolator) const

Definition at line 50 of file sampledIsoSurfaceTemplates.C.

References Foam::compressible::New(), and interpolation::psi().

Here is the call graph for this function:

Field Documentation

◆ isoField_

const word isoField_
private

Field to get isoSurface of.

Definition at line 60 of file sampledIsoSurface.H.

Referenced by sampledIsoSurface::getIsoFields().

◆ isoVal_

const scalar isoVal_
private

Iso value.

Definition at line 63 of file sampledIsoSurface.H.

◆ bounds_

const boundBox bounds_
private

Optional bounding box to trim triangles against.

Definition at line 66 of file sampledIsoSurface.H.

◆ mergeTol_

const scalar mergeTol_
private

Merge tolerance.

Definition at line 69 of file sampledIsoSurface.H.

◆ regularise_

const Switch regularise_
private

Whether to coarse.

Definition at line 72 of file sampledIsoSurface.H.

◆ average_

const Switch average_
private

Whether to recalculate cell values as average of point values.

Definition at line 75 of file sampledIsoSurface.H.

Referenced by sampledIsoSurface::getIsoFields().

◆ zoneID_

cellZoneID zoneID_
mutableprivate

Zone name/index (if restricted to zones)

Definition at line 78 of file sampledIsoSurface.H.

◆ exposedPatchName_

word exposedPatchName_
mutableprivate

For zones: patch to put exposed faces into.

Definition at line 81 of file sampledIsoSurface.H.

◆ surfPtr_

autoPtr<isoSurface> surfPtr_
mutableprivate

Definition at line 83 of file sampledIsoSurface.H.

Referenced by sampledIsoSurface::surface().

◆ facesPtr_

autoPtr<faceList> facesPtr_
mutableprivate

Triangles converted to faceList.

Definition at line 86 of file sampledIsoSurface.H.

Referenced by sampledIsoSurface::faces().

◆ prevTimeIndex_

label prevTimeIndex_
mutableprivate

Time at last call, also track if surface needs an update.

Definition at line 92 of file sampledIsoSurface.H.

◆ storedVolFieldPtr_

autoPtr<volScalarField> storedVolFieldPtr_
mutableprivate

Cached volfield.

Definition at line 95 of file sampledIsoSurface.H.

Referenced by sampledIsoSurface::getIsoFields().

◆ volFieldPtr_

const volScalarField* volFieldPtr_
mutableprivate

Definition at line 96 of file sampledIsoSurface.H.

Referenced by sampledIsoSurface::getIsoFields().

◆ pointFieldPtr_

const pointScalarField* pointFieldPtr_
mutableprivate

Cached pointfield.

Definition at line 99 of file sampledIsoSurface.H.

Referenced by sampledIsoSurface::getIsoFields().

◆ subMeshPtr_

autoPtr<fvMeshSubset> subMeshPtr_
mutableprivate

Cached submesh.

Definition at line 104 of file sampledIsoSurface.H.

Referenced by sampledIsoSurface::getIsoFields().

◆ storedVolSubFieldPtr_

autoPtr<volScalarField> storedVolSubFieldPtr_
mutableprivate

Cached volfield.

Definition at line 107 of file sampledIsoSurface.H.

Referenced by sampledIsoSurface::getIsoFields().

◆ volSubFieldPtr_

const volScalarField* volSubFieldPtr_
mutableprivate

Definition at line 108 of file sampledIsoSurface.H.

Referenced by sampledIsoSurface::getIsoFields().

◆ pointSubFieldPtr_

const pointScalarField* pointSubFieldPtr_
mutableprivate

Cached pointfield.

Definition at line 111 of file sampledIsoSurface.H.

Referenced by sampledIsoSurface::getIsoFields().


The documentation for this class was generated from the following files: