Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | List of all members
sampledSurface Class Referenceabstract

An abstract class for surfaces with sampling. More...

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

Classes

class  iNew
 
class  iNewCapture
 

Public Member Functions

 TypeName ("sampledSurface")
 
 declareRunTimeSelectionTable (autoPtr, sampledSurface, word,(const word &name, const polyMesh &mesh, const dictionary &dict),(name, mesh, dict))
 
 sampledSurface (const word &name, const polyMesh &mesh, const bool interpolateToPoints=false)
 
 sampledSurface (const word &name, const polyMesh &mesh, const dictionary &dict)
 
autoPtr< sampledSurfaceclone () const
 
virtual ~sampledSurface ()
 
const polyMeshmesh () const noexcept
 
const wordname () const noexcept
 
bool enabled () const noexcept
 
bool invariant () const noexcept
 
bool isPointData () const noexcept
 
virtual bool isPointData (const bool on)
 
virtual bool needsUpdate () const =0
 
virtual bool expire ()=0
 
virtual bool update ()=0
 
virtual const pointFieldpoints () const =0
 
virtual const faceListfaces () const =0
 
virtual const vectorFieldSf () const =0
 
virtual const scalarFieldmagSf () const =0
 
virtual const vectorFieldCf () const =0
 
scalar area () const
 
virtual bool hasFaceIds () const
 
polySurfacegetRegistrySurface (const objectRegistry &obr, word lookupName="") const
 
polySurfacestoreRegistrySurface (objectRegistry &obr, word lookupName="") const
 
bool removeRegistrySurface (objectRegistry &obr, word lookupName="") const
 
template<class Type , class GeoMeshType >
bool storeRegistryField (const objectRegistry &obr, const word &fieldName, const dimensionSet &dims, const Field< Type > &values, word lookupName="") const
 
template<class Type , class GeoMeshType >
bool storeRegistryField (const objectRegistry &obr, const word &fieldName, const dimensionSet &dims, Field< Type > &&values, word lookupName="") const
 
surfMeshgetSurfMesh (word lookupName="") const
 
surfMeshstoreSurfMesh (word lookupName="") const
 
bool removeSurfMesh (word lookupName="") const
 
template<class Type , class GeoMeshType >
bool storeSurfMeshField (const word &fieldName, const dimensionSet &dims, const Field< Type > &values, word lookupName="") const
 
template<class Type , class GeoMeshType >
bool storeSurfMeshField (const word &fieldName, const dimensionSet &dims, Field< Type > &&values, word lookupName="") const
 
virtual tmp< scalarFieldsample (const interpolation< scalar > &sampler) const =0
 
virtual tmp< vectorFieldsample (const interpolation< vector > &sampler) const =0
 
virtual tmp< sphericalTensorFieldsample (const interpolation< sphericalTensor > &sampler) const =0
 
virtual tmp< symmTensorFieldsample (const interpolation< symmTensor > &sampler) const =0
 
virtual tmp< tensorFieldsample (const interpolation< tensor > &sampler) const =0
 
virtual bool withSurfaceFields () const
 
virtual tmp< scalarFieldsample (const surfaceScalarField &sField) const
 
virtual tmp< vectorFieldsample (const surfaceVectorField &sField) const
 
virtual tmp< sphericalTensorFieldsample (const surfaceSphericalTensorField &sField) const
 
virtual tmp< symmTensorFieldsample (const surfaceSymmTensorField &sField) const
 
virtual tmp< tensorFieldsample (const surfaceTensorField &sField) const
 
virtual tmp< scalarFieldinterpolate (const interpolation< scalar > &interpolator) const =0
 
virtual tmp< vectorFieldinterpolate (const interpolation< vector > &interpolator) const =0
 
virtual tmp< sphericalTensorFieldinterpolate (const interpolation< sphericalTensor > &interpolator) const =0
 
virtual tmp< symmTensorFieldinterpolate (const interpolation< symmTensor > &interpolator) const =0
 
virtual tmp< tensorFieldinterpolate (const interpolation< tensor > &interpolator) const =0
 
virtual void rename (const word &newName)
 
virtual void print (Ostream &os, int level=0) const
 
bool interpolate () const noexcept
 
template<class Type >
Foam::tmp< Foam::Field< Type > > sampleOnFaces (const interpolation< Type > &sampler, const labelUList &elements, const faceList &fcs, const pointField &pts, const Type &defaultValue)
 
template<class Type >
Foam::tmp< Foam::Field< Type > > sampleOnPoints (const interpolation< Type > &interpolator, 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
constexpr meshedSurf () noexcept=default
 
virtual ~meshedSurf ()=default
 
virtual const labelListzoneIds () const
 
virtual const labelListfaceIds () const
 

Static Public Member Functions

static autoPtr< sampledSurfaceNew (const word &name, const polyMesh &mesh, const dictionary &dict)
 

Static Public Attributes

static const wordList surfaceFieldTypes
 

Protected Member Functions

virtual void clearGeom () const
 
 sampledSurface (const word &name, std::nullptr_t)
 

Static Protected Member Functions

template<class Type >
static tmp< Field< Type > > sampleOnFaces (const interpolation< Type > &sampler, const labelUList &elements, const faceList &fcs, const pointField &pts, const Type &defaultValue=Type(Zero))
 
template<class Type >
static tmp< Field< Type > > sampleOnPoints (const interpolation< Type > &interpolator, const labelUList &elements, const faceList &fcs, const pointField &pts)
 
template<class Type >
static tmp< GeometricField< Type, fvPatchField, volMesh > > pointAverage (const GeometricField< Type, pointPatchField, pointMesh > &pfld)
 

Detailed Description

An abstract class for surfaces with sampling.

The constructors for the derived classes should generally start in a 'expired' condition (ie, needsUpdate() == true) and rely on a subsequent call to the update() method to complete the initialization. Delaying the final construction as late as possible allows the construction of surfaces that may depend on intermediate calculation results (eg, iso-surfaces) and also avoids the unnecessary reconstruction of surfaces between sampling intervals.

It is the responsibility of the caller to ensure that the surface update() is called before the surface is used. The update() method implementation should do nothing when the surface is already up-to-date.

Any sampler is assumed to work for the standard volume field types. Some may also support surface fields.

Dictionary entries:

Property Description Required Default
name Alternative name no
enabled Enable/disable the surface? no yes
interpolate Interpolate to nodes instead of faces no false
invariant Invariant with geometry change (use with caution!) no false
Note
The invariant switch is an advanced feature to declare that the surface is unaffected by changes in the general mesh geometry. For example, if sampling on a static patch while some other motion occurs elsewhere. If used improperly, there is a significant possibility for problems (caveat emptor).
Source files

Definition at line 117 of file sampledSurface.H.

Constructor & Destructor Documentation

◆ sampledSurface() [1/3]

sampledSurface ( const word name,
std::nullptr_t   
)
explicitprotected

Definition at line 85 of file sampledSurface.C.

◆ sampledSurface() [2/3]

sampledSurface ( const word name,
const polyMesh mesh,
const bool  interpolateToPoints = false 
)

Definition at line 97 of file sampledSurface.C.

◆ sampledSurface() [3/3]

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

Definition at line 113 of file sampledSurface.C.

◆ ~sampledSurface()

~sampledSurface ( )
virtual

Definition at line 130 of file sampledSurface.C.

Member Function Documentation

◆ sampleOnFaces() [1/2]

static tmp<Field<Type> > sampleOnFaces ( const interpolation< Type > &  sampler,
const labelUList elements,
const faceList fcs,
const pointField pts,
const Type &  defaultValue = Type(Zero) 
)
staticprotected

◆ sampleOnPoints() [1/2]

static tmp<Field<Type> > sampleOnPoints ( const interpolation< Type > &  interpolator,
const labelUList elements,
const faceList fcs,
const pointField pts 
)
staticprotected

◆ pointAverage() [1/2]

static tmp<GeometricField<Type, fvPatchField, volMesh> > pointAverage ( const GeometricField< Type, pointPatchField, pointMesh > &  pfld)
staticprotected

◆ clearGeom()

void clearGeom ( ) const
protectedvirtual

◆ TypeName()

TypeName ( "sampledSurface"  )

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
sampledSurface  ,
word  ,
(const word &name, const polyMesh &mesh, const dictionary &dict ,
(name, mesh, dict  
)

◆ clone()

autoPtr<sampledSurface> clone ( ) const
inline

Definition at line 285 of file sampledSurface.H.

References NotImplemented.

◆ New()

Foam::autoPtr< Foam::sampledSurface > New ( const word name,
const polyMesh mesh,
const dictionary dict 
)
static

Definition at line 55 of file sampledSurface.C.

References DebugInfo, dict, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInLookup, dictionary::get(), mesh, and Foam::name().

Referenced by sampledSurface::iNew::operator()(), sampledSurface::iNewCapture::operator()(), sampledSurfaces::read(), and surfaceFieldValue::read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mesh()

const polyMesh& mesh ( ) const
inlinenoexcept

Definition at line 312 of file sampledSurface.H.

Referenced by sampledSurface::getSurfMesh(), sampledPatch::patchIDs(), and sampledFaceZone::zoneIDs().

Here is the caller graph for this function:

◆ name()

const word& name ( ) const
inlinenoexcept

◆ enabled()

bool enabled ( ) const
inlinenoexcept

Definition at line 324 of file sampledSurface.H.

◆ invariant()

bool invariant ( ) const
inlinenoexcept

Definition at line 330 of file sampledSurface.H.

◆ isPointData() [1/2]

bool isPointData ( ) const
inlinenoexcept

Definition at line 336 of file sampledSurface.H.

◆ isPointData() [2/2]

bool isPointData ( const bool  on)
virtual

Definition at line 149 of file sampledSurface.C.

◆ needsUpdate()

virtual bool needsUpdate ( ) const
pure virtual

◆ expire()

virtual bool expire ( )
pure virtual

◆ update()

virtual bool update ( )
pure virtual

◆ points()

virtual const pointField& points ( ) const
pure virtual

◆ faces()

virtual const faceList& faces ( ) const
pure virtual

◆ Sf()

virtual const vectorField& Sf ( ) const
pure virtual

◆ magSf()

virtual const scalarField& magSf ( ) const
pure virtual

◆ Cf()

virtual const vectorField& Cf ( ) const
pure virtual

◆ area()

Foam::scalar area ( ) const

Definition at line 138 of file sampledSurface.C.

References Foam::gSum().

Here is the call graph for this function:

◆ hasFaceIds()

virtual bool hasFaceIds ( ) const
inlinevirtual

Reimplemented in sampledMeshedSurface.

Definition at line 376 of file sampledSurface.H.

◆ getRegistrySurface()

Foam::polySurface * getRegistrySurface ( const objectRegistry obr,
word  lookupName = "" 
) const

Definition at line 28 of file sampledSurfaceRegister.C.

References objectRegistry::getObjectPtr(), and Foam::name().

Here is the call graph for this function:

◆ storeRegistrySurface()

Foam::polySurface * storeRegistrySurface ( objectRegistry obr,
word  lookupName = "" 
) const

Definition at line 43 of file sampledSurfaceRegister.C.

References polySurface::copySurface(), and Foam::name().

Here is the call graph for this function:

◆ removeRegistrySurface()

bool removeRegistrySurface ( objectRegistry obr,
word  lookupName = "" 
) const

Definition at line 68 of file sampledSurfaceRegister.C.

References objectRegistry::checkOut().

Here is the call graph for this function:

◆ storeRegistryField() [1/2]

bool storeRegistryField ( const objectRegistry obr,
const word fieldName,
const dimensionSet dims,
const Field< Type > &  values,
word  lookupName = "" 
) const

Definition at line 175 of file sampledSurfaceTemplates.C.

References polySurface::storeField(), and Foam::HashTableOps::values().

Here is the call graph for this function:

◆ storeRegistryField() [2/2]

bool storeRegistryField ( const objectRegistry obr,
const word fieldName,
const dimensionSet dims,
Field< Type > &&  values,
word  lookupName = "" 
) const

Definition at line 199 of file sampledSurfaceTemplates.C.

References polySurface::storeField(), and Foam::HashTableOps::values().

Here is the call graph for this function:

◆ getSurfMesh()

Foam::surfMesh * getSurfMesh ( word  lookupName = "") const

Definition at line 78 of file sampledSurfaceRegister.C.

References objectRegistry::getObjectPtr(), sampledSurface::mesh(), and sampledSurface::name().

Here is the call graph for this function:

◆ storeSurfMesh()

Foam::surfMesh * storeSurfMesh ( word  lookupName = "") const

Definition at line 89 of file sampledSurfaceRegister.C.

References surfMesh::copySurface(), mesh, Foam::name(), and regIOobject::store().

Here is the call graph for this function:

◆ removeSurfMesh()

bool removeSurfMesh ( word  lookupName = "") const

Definition at line 112 of file sampledSurfaceRegister.C.

References objectRegistry::checkOut(), and mesh.

Here is the call graph for this function:

◆ storeSurfMeshField() [1/2]

bool storeSurfMeshField ( const word fieldName,
const dimensionSet dims,
const Field< Type > &  values,
word  lookupName = "" 
) const

Definition at line 223 of file sampledSurfaceTemplates.C.

References surfMesh::storeField(), and Foam::HashTableOps::values().

Here is the call graph for this function:

◆ storeSurfMeshField() [2/2]

bool storeSurfMeshField ( const word fieldName,
const dimensionSet dims,
Field< Type > &&  values,
word  lookupName = "" 
) const

Definition at line 246 of file sampledSurfaceTemplates.C.

References surfMesh::storeField(), and Foam::HashTableOps::values().

Here is the call graph for this function:

◆ sample() [1/10]

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

◆ sample() [2/10]

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

◆ sample() [3/10]

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

◆ sample() [4/10]

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

◆ sample() [5/10]

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

◆ withSurfaceFields()

bool withSurfaceFields ( ) const
virtual

Reimplemented in sampledPatch, and sampledFaceZone.

Definition at line 157 of file sampledSurface.C.

◆ sample() [6/10]

Foam::tmp< Foam::tensorField > sample ( const surfaceScalarField sField) const
virtual

◆ sample() [7/10]

virtual tmp<vectorField> sample ( const surfaceVectorField sField) const
virtual

◆ sample() [8/10]

virtual tmp<sphericalTensorField> sample ( const surfaceSphericalTensorField sField) const
virtual

◆ sample() [9/10]

virtual tmp<symmTensorField> sample ( const surfaceSymmTensorField sField) const
virtual

◆ sample() [10/10]

virtual tmp<tensorField> sample ( const surfaceTensorField sField) const
virtual

◆ interpolate() [1/6]

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

◆ interpolate() [2/6]

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

◆ interpolate() [3/6]

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

◆ interpolate() [4/6]

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

◆ interpolate() [5/6]

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

◆ rename()

virtual void rename ( const word newName)
inlinevirtual

Definition at line 579 of file sampledSurface.H.

◆ print()

void print ( Ostream os,
int  level = 0 
) const
virtual

◆ interpolate() [6/6]

bool interpolate ( ) const
inlinenoexcept

Definition at line 594 of file sampledSurface.H.

◆ sampleOnFaces() [2/2]

Foam::tmp<Foam::Field<Type> > sampleOnFaces ( const interpolation< Type > &  sampler,
const labelUList elements,
const faceList fcs,
const pointField pts,
const Type &  defaultValue 
)

◆ sampleOnPoints() [2/2]

Foam::tmp<Foam::Field<Type> > sampleOnPoints ( const interpolation< Type > &  interpolator,
const labelUList elements,
const faceList fcs,
const pointField pts 
)

◆ pointAverage() [2/2]

Definition at line 123 of file sampledSurfaceTemplates.C.

References Foam::dimless, forAll, mesh, Foam::New(), and Foam::Zero.

Here is the call graph for this function:

Member Data Documentation

◆ surfaceFieldTypes

const Foam::wordList surfaceFieldTypes
static

Definition at line 126 of file sampledSurface.H.


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