FreeFOAM The Cross-Platform CFD Toolkit
sampledSurface Class Reference

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

#include <sampling/sampledSurface.H>


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.

Source files

Definition at line 73 of file sampledSurface.H.

+ Inheritance diagram for sampledSurface:

List of all members.

Classes

class  iNew
 Class used for the PtrLists read-construction. More...

Public Member Functions

 TypeName ("sampledSurface")
 Runtime type information.
 declareRunTimeSelectionTable (autoPtr, sampledSurface, word,(const word &name, const polyMesh &mesh, const dictionary &dict),(name, mesh, dict))
 sampledSurface (const word &name, const polyMesh &)
 Construct from name, mesh.
 sampledSurface (const word &name, const polyMesh &, const dictionary &)
 Construct from dictionary.
autoPtr< sampledSurfaceclone () const
 Clone.
virtual ~sampledSurface ()
const polyMeshmesh () const
 Access to the underlying mesh.
const wordname () const
 Name of surface.
bool interpolate () const
 interpolation requested for surface
virtual bool needsUpdate () const =0
 Does the surface need an update?
virtual bool expire ()=0
 Mark the surface as needing an update.
virtual bool update ()=0
 Update the surface as required.
virtual const pointFieldpoints () const =0
 Points of surface.
virtual const faceListfaces () const =0
 Faces of surface.
virtual const vectorFieldSf () const
 Return face area vectors.
virtual const scalarFieldmagSf () const
 Return face area magnitudes.
virtual const vectorFieldCf () const
 Return face centres as vectorField.
scalar area () const
 The total surface area.
template<class Type >
Type integrate (const Field< Type > &) const
 Integration of a field across the surface.
template<class Type >
Type integrate (const tmp< Field< Type > > &) const
 Integration of a field across the surface.
template<class Type >
Type average (const Field< Type > &) const
 Area-averaged value of a field across the surface.
template<class Type >
Type average (const tmp< Field< Type > > &) const
 Area-averaged value of a field across the surface.
tmp< Field< scalar > > project (const Field< scalar > &) const
 Project field onto surface.
tmp< Field< scalar > > project (const Field< vector > &) const
 Project field onto surface.
tmp< Field< vector > > project (const Field< sphericalTensor > &) const
 Project field onto surface.
tmp< Field< vector > > project (const Field< symmTensor > &) const
 Project field onto surface.
tmp< Field< vector > > project (const Field< tensor > &) const
 Project field onto surface.
virtual tmp< scalarFieldsample (const volScalarField &) const =0
 Sample field on surface.
virtual tmp< vectorFieldsample (const volVectorField &) const =0
 Sample field on surface.
virtual tmp< sphericalTensorFieldsample (const volSphericalTensorField &) const =0
 Sample field on surface.
virtual tmp< symmTensorFieldsample (const volSymmTensorField &) const =0
 Sample field on surface.
virtual tmp< tensorFieldsample (const volTensorField &) const =0
 Sample field on surface.
virtual tmp< scalarFieldinterpolate (const interpolation< scalar > &) const =0
 Interpolate field on surface.
virtual tmp< vectorFieldinterpolate (const interpolation< vector > &) const =0
 Interpolate field on surface.
virtual tmp< sphericalTensorFieldinterpolate (const interpolation< sphericalTensor > &) const =0
 Interpolate field on surface.
virtual tmp< symmTensorFieldinterpolate (const interpolation< symmTensor > &) const =0
 Interpolate field on surface.
virtual tmp< tensorFieldinterpolate (const interpolation< tensor > &) const =0
 Interpolate field on surface.
virtual void rename (const word &newName)
 Rename.
virtual void print (Ostream &) const
 Write.

Static Public Member Functions

static autoPtr< sampledSurfaceNew (const word &name, const polyMesh &, const dictionary &)
 Return a reference to the selected surface.

Protected Member Functions

virtual void clearGeom () const

Friends

Ostreamoperator<< (Ostream &, const sampledSurface &)

Constructor & Destructor Documentation

sampledSurface ( const word name,
const polyMesh mesh 
)

Construct from name, mesh.

Definition at line 153 of file sampledSurface.C.

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

Construct from dictionary.

Definition at line 170 of file sampledSurface.C.

References dictionary::readIfPresent().

~sampledSurface ( )
virtual

Definition at line 190 of file sampledSurface.C.


Member Function Documentation

TypeName ( "sampledSurface"  )

Runtime type information.

declareRunTimeSelectionTable ( autoPtr  ,
sampledSurface  ,
word  ,
(const word &name, const polyMesh &mesh, const dictionary &dict)  ,
(name, mesh, dict)   
)
autoPtr<sampledSurface> clone ( ) const
inline

Clone.

Definition at line 207 of file sampledSurface.H.

References notImplemented.

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

Return a reference to the selected surface.

Definition at line 119 of file sampledSurface.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorIn, Foam::Info, dictionary::lookup(), mesh, and Foam::name().

Referenced by sampledSurface::iNew::operator()().

const polyMesh& mesh ( ) const
inline

Access to the underlying mesh.

Definition at line 235 of file sampledSurface.H.

Referenced by sampledPatch::patchIndex().

const word& name ( ) const
inline

Name of surface.

Definition at line 241 of file sampledSurface.H.

Referenced by sampledSurface::iNew::operator()().

bool interpolate ( ) const
inline

interpolation requested for surface

Definition at line 247 of file sampledSurface.H.

Referenced by sampledIsoSurface::sampledIsoSurface().

virtual bool needsUpdate ( ) const
pure virtual
virtual bool expire ( )
pure virtual

Mark the surface as needing an update.

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

Implemented in sampledIsoSurface, sampledCuttingPlane, distanceSurface, sampledIsoSurfaceCell, sampledTriSurfaceMesh, sampledThresholdCellFaces, sampledPatch, and sampledPlane.

virtual bool update ( )
pure virtual

Update the surface as required.

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

Implemented in sampledIsoSurface, sampledCuttingPlane, distanceSurface, sampledIsoSurfaceCell, sampledTriSurfaceMesh, sampledThresholdCellFaces, sampledPatch, and sampledPlane.

Referenced by sampledSurfaces::update().

const Foam::vectorField & Sf ( ) const
virtual

Return face area vectors.

Definition at line 197 of file sampledSurface.C.

const Foam::scalarField & magSf ( ) const
virtual

Return face area magnitudes.

Definition at line 208 of file sampledSurface.C.

const Foam::vectorField & Cf ( ) const
virtual

Return face centres as vectorField.

Definition at line 219 of file sampledSurface.C.

Foam::scalar area ( ) const

The total surface area.

Definition at line 230 of file sampledSurface.C.

References Foam::reduce(), and Foam::sum().

Type integrate ( const Field< Type > &  field) const

Integration of a field across the surface.

Definition at line 53 of file sampledSurfaceTemplates.C.

References Foam::reduce(), and Foam::sum().

Type integrate ( const tmp< Field< Type > > &  field) const

Integration of a field across the surface.

Definition at line 68 of file sampledSurfaceTemplates.C.

Type average ( const Field< Type > &  field) const

Area-averaged value of a field across the surface.

Definition at line 77 of file sampledSurfaceTemplates.C.

References Foam::reduce(), and Foam::sum().

Type average ( const tmp< Field< Type > > &  field) const

Area-averaged value of a field across the surface.

Definition at line 101 of file sampledSurfaceTemplates.C.

References Foam::average().

Foam::tmp< Foam::Field< Foam::scalar > > project ( const Field< scalar > &  field) const

Project field onto surface.

Definition at line 244 of file sampledSurface.C.

References forAll.

Foam::tmp< Foam::Field< Foam::scalar > > project ( const Field< vector > &  field) const

Project field onto surface.

Definition at line 259 of file sampledSurface.C.

Foam::tmp< Foam::Field< Foam::vector > > project ( const Field< sphericalTensor > &  field) const

Project field onto surface.

Definition at line 268 of file sampledSurface.C.

Foam::tmp< Foam::Field< Foam::vector > > project ( const Field< symmTensor > &  field) const

Project field onto surface.

Definition at line 277 of file sampledSurface.C.

Foam::tmp< Foam::Field< Foam::vector > > project ( const Field< tensor > &  field) const

Project field onto surface.

Definition at line 286 of file sampledSurface.C.

virtual tmp<scalarField> sample ( const volScalarField ) const
pure virtual
virtual tmp<scalarField> interpolate ( const interpolation< scalar > &  ) const
pure virtual
virtual tmp<vectorField> interpolate ( const interpolation< vector > &  ) const
pure virtual
virtual tmp<symmTensorField> interpolate ( const interpolation< symmTensor > &  ) const
pure virtual
virtual tmp<tensorField> interpolate ( const interpolation< tensor > &  ) const
pure virtual
virtual void rename ( const word newName)
inlinevirtual

Rename.

Definition at line 380 of file sampledSurface.H.

void print ( Ostream os) const
virtual

Friends And Related Function Documentation

Ostream& operator<< ( Ostream ,
const sampledSurface  
)
friend

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