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:
[legend]
Collaboration diagram for sampledIsoSurface:
[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...
 
const isoSurfacesurface () const
 
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...
 
virtual const labelListzoneIds () const
 Per-face zone/region information. More...
 
virtual const vectorFieldSf () const
 Face area magnitudes. More...
 
virtual const scalarFieldmagSf () const
 Face area magnitudes. More...
 
virtual const vectorFieldCf () const
 Face centres. More...
 
void getIsoField ()
 Lookup or read isoField. More...
 
virtual tmp< scalarFieldsample (const interpolation< scalar > &sampler) const
 Sample volume field onto surface faces. More...
 
virtual tmp< vectorFieldsample (const interpolation< vector > &sampler) const
 Sample volume field onto surface faces. More...
 
virtual tmp< sphericalTensorFieldsample (const interpolation< sphericalTensor > &sampler) const
 Sample volume field onto surface faces. More...
 
virtual tmp< symmTensorFieldsample (const interpolation< symmTensor > &sampler) const
 Sample volume field onto surface faces. More...
 
virtual tmp< tensorFieldsample (const interpolation< tensor > &sampler) const
 Sample volume field onto surface faces. More...
 
virtual tmp< scalarFieldinterpolate (const interpolation< scalar > &interpolator) const
 Interpolate volume field onto surface points. More...
 
virtual tmp< vectorFieldinterpolate (const interpolation< vector > &interpolator) const
 Interpolate volume field onto surface points. More...
 
virtual tmp< sphericalTensorFieldinterpolate (const interpolation< sphericalTensor > &interpolator) const
 Interpolate volume field onto surface points. More...
 
virtual tmp< symmTensorFieldinterpolate (const interpolation< symmTensor > &interpolator) const
 Interpolate volume field onto surface points. More...
 
virtual tmp< tensorFieldinterpolate (const interpolation< tensor > &interpolator) const
 Interpolate volume field onto surface points. More...
 
virtual void print (Ostream &) const
 Write. More...
 
template<class Type >
Foam::tmp< Foam::Field< Type > > sampleOnFaces (const interpolation< Type > &sampler) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > sampleOnPoints (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 &mesh, const bool interpolate=false)
 Construct from name, mesh. More...
 
 sampledSurface (const word &name, const polyMesh &mesh, const dictionary &dict)
 Construct from dictionary. More...
 
autoPtr< sampledSurfaceclone () const
 Clone. More...
 
virtual ~sampledSurface ()
 Destructor - calls clearGeom() More...
 
const polyMeshmesh () const
 Access to the underlying mesh. More...
 
const wordname () const
 Name of surface. More...
 
bool enabled () const
 Surface is enabled. More...
 
bool invariant () const
 Surface is invariant with geometry change (caution) More...
 
bool interpolate () const
 Interpolation to nodes requested for surface. More...
 
scalar area () const
 The total surface area. More...
 
virtual bool hasFaceIds () const
 If element ids/order of the original surface are available. More...
 
virtual const labelListoriginalIds () const
 
polySurfacegetRegistrySurface (const objectRegistry &obr, word lookupName="") const
 Get surface from registry if available. More...
 
polySurfacestoreRegistrySurface (objectRegistry &obr, word lookupName="") const
 Copy surface into registry. More...
 
bool removeRegistrySurface (objectRegistry &obr, word lookupName="") const
 Remove surface from registry. More...
 
template<class Type , class GeoMeshType >
bool storeRegistryField (const objectRegistry &obr, const word &fieldName, const dimensionSet &dims, const Field< Type > &values, word lookupName="") const
 Copy/store sampled field onto registered surface (if it exists) More...
 
template<class Type , class GeoMeshType >
bool storeRegistryField (const objectRegistry &obr, const word &fieldName, const dimensionSet &dims, Field< Type > &&values, word lookupName="") const
 Move/store sampled field onto registered surface (if it exists) More...
 
surfMeshgetSurfMesh (word lookupName="") const
 Get surface from registry if available. More...
 
surfMeshstoreSurfMesh (word lookupName="") const
 Copy surface into registry. More...
 
bool removeSurfMesh (word lookupName="") const
 Remove surface from registry. More...
 
template<class Type , class GeoMeshType >
bool storeSurfMeshField (const word &fieldName, const dimensionSet &dims, const Field< Type > &values, word lookupName="") const
 Copy/store sampled Face field onto surfMesh (if it exists) More...
 
template<class Type , class GeoMeshType >
bool storeSurfMeshField (const word &fieldName, const dimensionSet &dims, Field< Type > &&values, word lookupName="") const
 Move/store sampled Face field onto surfMesh (if it exists) More...
 
virtual bool withSurfaceFields () const
 Can it sample surface-fields? More...
 
virtual tmp< scalarFieldsample (const surfaceScalarField &sField) const
 Sample surface field onto surface. More...
 
virtual tmp< vectorFieldsample (const surfaceVectorField &sField) const
 Sample surface field onto surface. More...
 
virtual tmp< sphericalTensorFieldsample (const surfaceSphericalTensorField &sField) const
 Sample surface field onto surface. More...
 
virtual tmp< symmTensorFieldsample (const surfaceSymmTensorField &sField) const
 Sample surface field onto surface. More...
 
virtual tmp< tensorFieldsample (const surfaceTensorField &sField) const
 Sample surface field onto surface. More...
 
virtual void rename (const word &newName)
 Rename. More...
 
template<class Type >
Foam::tmp< Foam::Field< Type > > sampleOnFaces (const interpolation< Type > &sampler, const labelUList &elements, const faceList &fcs, const pointField &pts)
 
template<class Type >
Foam::tmp< Foam::GeometricField< Type, Foam::fvPatchField, Foam::volMesh > > pointAverage (const GeometricField< Type, pointPatchField, pointMesh > &pfld)
 
- Public Member Functions inherited from meshedSurf
 meshedSurf ()=default
 Construct null. More...
 
virtual ~meshedSurf ()=default
 Destructor. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from sampledSurface
static autoPtr< sampledSurfaceNew (const word &name, const polyMesh &mesh, const dictionary &dict)
 Return a reference to the selected surface. More...
 
- Static Public Attributes inherited from sampledSurface
static const wordList surfaceFieldTypes
 Class names for surface field types. More...
 
- Protected Member Functions inherited from sampledSurface
virtual void clearGeom () const
 Additional cleanup when clearing the geometry. More...
 
 sampledSurface (const word &name, std::nullptr_t)
 Construct null. More...
 
- Static Protected Member Functions inherited from sampledSurface
template<class Type >
static tmp< Field< Type > > sampleOnFaces (const interpolation< Type > &sampler, const labelUList &elements, const faceList &fcs, const pointField &pts)
 General loop for sampling elements to faces. More...
 
template<class Type >
static tmp< GeometricField< Type, fvPatchField, volMesh > > pointAverage (const GeometricField< Type, pointPatchField, pointMesh > &pfld)
 Create cell values by averaging the point values. More...
 

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.

This is often embedded as part of a sampled surfaces function object.

Usage
Example of function object partial specification:
surfaces
(
    surface1
    {
        type    sampledIsoSurface;
        cell    false;
    }
);

Where the sub-entries comprise:

Property Description Required Default
type sampledIsoSurface yes
isoField field name for obtaining iso-surface yes
isoValue value of iso-surface yes
mergeTol tolerance for merging points no 1e-6
regularise point snapping (bool or enum) no true
average cell values from averaged point values no false
bounds limit with bounding box no
zone limit to cell zone (name or regex) no
zones limit to cell zones (names, regexs) no
exposedPatchName name for zone subset partly
Source files

Definition at line 140 of file sampledIsoSurface.H.

Constructor & Destructor Documentation

◆ sampledIsoSurface()

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

Construct from dictionary.

Definition at line 417 of file sampledIsoSurface.C.

References polyMesh::boundaryMesh(), polyMesh::cellZones(), DebugInfo, dict, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, ZoneMesh< ZoneType, MeshType >::findIndex(), polyBoundaryMesh::findPatchID(), Foam::flatOutput(), dictionary::found(), sampledSurface::interpolate(), mesh, polyBoundaryMesh::names(), dictionary::readEntry(), and dictionary::readIfPresent().

Here is the call graph for this function:

◆ ~sampledIsoSurface()

~sampledIsoSurface ( )
virtual

Destructor.

Definition at line 482 of file sampledIsoSurface.C.

Member Function Documentation

◆ TypeName()

TypeName ( "sampledIsoSurface"  )

Runtime type information.

◆ surface()

const isoSurface& surface ( ) const
inline

Definition at line 245 of file sampledIsoSurface.H.

Referenced by sampledIsoSurface::Cf(), sampledIsoSurface::faces(), sampledIsoSurface::magSf(), sampledIsoSurface::points(), and sampledIsoSurface::Sf().

Here is the caller graph for this function:

◆ needsUpdate()

bool needsUpdate ( ) const
virtual

Does the surface need an update?

Implements sampledSurface.

Definition at line 488 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 496 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 516 of file sampledIsoSurface.C.

◆ points()

virtual const pointField& points ( ) const
inlinevirtual

Points of surface.

Implements sampledSurface.

Definition at line 264 of file sampledIsoSurface.H.

References 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 270 of file sampledIsoSurface.H.

References sampledIsoSurface::surface(), and MeshedSurface< Face >::surfFaces().

Here is the call graph for this function:

◆ zoneIds()

virtual const labelList& zoneIds ( ) const
inlinevirtual

Per-face zone/region information.

Reimplemented from meshedSurf.

Definition at line 276 of file sampledIsoSurface.H.

References List< label >::null().

Here is the call graph for this function:

◆ Sf()

virtual const vectorField& Sf ( ) const
inlinevirtual

Face area magnitudes.

Implements sampledSurface.

Definition at line 282 of file sampledIsoSurface.H.

References MeshedSurface< Face >::Sf(), and sampledIsoSurface::surface().

Here is the call graph for this function:

◆ magSf()

virtual const scalarField& magSf ( ) const
inlinevirtual

Face area magnitudes.

Implements sampledSurface.

Definition at line 288 of file sampledIsoSurface.H.

References MeshedSurface< Face >::magSf(), and sampledIsoSurface::surface().

Here is the call graph for this function:

◆ Cf()

virtual const vectorField& Cf ( ) const
inlinevirtual

Face centres.

Implements sampledSurface.

Definition at line 294 of file sampledIsoSurface.H.

References MeshedSurface< Face >::Cf(), and sampledIsoSurface::surface().

Here is the call graph for this function:

◆ getIsoField()

void getIsoField ( )

Lookup or read isoField.

Sets volFieldPtr_ and pointFieldPtr_.

◆ sample() [1/5]

Foam::tmp< Foam::scalarField > sample ( const interpolation< scalar > &  sampler) const
virtual

Sample volume field onto surface faces.

Implements sampledSurface.

Definition at line 523 of file sampledIsoSurface.C.

◆ sample() [2/5]

Foam::tmp< Foam::vectorField > sample ( const interpolation< vector > &  sampler) const
virtual

Sample volume field onto surface faces.

Implements sampledSurface.

Definition at line 532 of file sampledIsoSurface.C.

◆ sample() [3/5]

Foam::tmp< Foam::sphericalTensorField > sample ( const interpolation< sphericalTensor > &  sampler) const
virtual

Sample volume field onto surface faces.

Implements sampledSurface.

Definition at line 541 of file sampledIsoSurface.C.

◆ sample() [4/5]

Foam::tmp< Foam::symmTensorField > sample ( const interpolation< symmTensor > &  sampler) const
virtual

Sample volume field onto surface faces.

Implements sampledSurface.

Definition at line 550 of file sampledIsoSurface.C.

◆ sample() [5/5]

Foam::tmp< Foam::tensorField > sample ( const interpolation< tensor > &  sampler) const
virtual

Sample volume field onto surface faces.

Implements sampledSurface.

Definition at line 559 of file sampledIsoSurface.C.

◆ interpolate() [1/5]

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

Interpolate volume field onto surface points.

Implements sampledSurface.

Definition at line 568 of file sampledIsoSurface.C.

◆ interpolate() [2/5]

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

Interpolate volume field onto surface points.

Implements sampledSurface.

Definition at line 577 of file sampledIsoSurface.C.

◆ interpolate() [3/5]

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

Interpolate volume field onto surface points.

Implements sampledSurface.

Definition at line 585 of file sampledIsoSurface.C.

◆ interpolate() [4/5]

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

Interpolate volume field onto surface points.

Implements sampledSurface.

Definition at line 594 of file sampledIsoSurface.C.

◆ interpolate() [5/5]

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

Interpolate volume field onto surface points.

Implements sampledSurface.

Definition at line 603 of file sampledIsoSurface.C.

◆ print()

void print ( Ostream os) const
virtual

Write.

Reimplemented from sampledSurface.

Definition at line 611 of file sampledIsoSurface.C.

References Foam::name().

Here is the call graph for this function:

◆ sampleOnFaces()

Foam::tmp<Foam::Field<Type> > sampleOnFaces ( const interpolation< Type > &  sampler) const

Definition at line 39 of file sampledIsoSurfaceTemplates.C.

References points.

◆ sampleOnPoints()

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

Definition at line 58 of file sampledIsoSurfaceTemplates.C.

References Foam::fac::interpolate(), Foam::New(), and interpolation< Type >::psi().

Here is the call graph for this function:

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