FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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:
Collaboration 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< sampledSurface >  clone () const
 Clone.
virtual  ~sampledSurface ()
const polyMesh &  mesh () const
 Access to the underlying mesh.
const word &  name () 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 pointField &  points () const =0
 Points of surface.
virtual const faceList &  faces () const =0
 Faces of surface.
virtual const vectorField &  Sf () const
 Return face area vectors.
virtual const scalarField &  magSf () const
 Return face area magnitudes.
virtual const vectorField &  Cf () 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< scalarField >  sample (const volScalarField &) const =0
 Sample field on surface.
virtual tmp< vectorField >  sample (const volVectorField &) const =0
 Sample field on surface.
virtual tmp< sphericalTensorField >  sample (const volSphericalTensorField &) const =0
 Sample field on surface.
virtual tmp< symmTensorField >  sample (const volSymmTensorField &) const =0
 Sample field on surface.
virtual tmp< tensorField >  sample (const volTensorField &) const =0
 Sample field on surface.
virtual tmp< scalarField >  interpolate (const interpolation< scalar > &) const =0
 Interpolate field on surface.
virtual tmp< vectorField >  interpolate (const interpolation< vector > &) const =0
 Interpolate field on surface.
virtual tmp< sphericalTensorField >  interpolate (const interpolation< sphericalTensor > &) const =0
 Interpolate field on surface.
virtual tmp< symmTensorField >  interpolate (const interpolation< symmTensor > &) const =0
 Interpolate field on surface.
virtual tmp< tensorField >  interpolate (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< sampledSurface >  New (const word &name, const polyMesh &, const dictionary &)
 Return a reference to the selected surface.

Protected Member Functions

virtual void  clearGeom () const

Friends

Ostream &  operator<< (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

void clearGeom (  ) const [protected, virtual]
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 distanceSurface, sampledIsoSurface, sampledIsoSurfaceCell, sampledCuttingPlane, sampledPatch, sampledPlane, sampledTriSurfaceMesh, and sampledThresholdCellFaces.

virtual bool update (  ) [pure virtual]

Update the surface as required.

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

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

Referenced by sampledSurfaces::update().

virtual const pointField& points (  ) const [pure virtual]
virtual const faceList& faces (  ) const [pure virtual]
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<vectorField> sample ( const volVectorField &    ) const [pure virtual]
virtual tmp<tensorField> sample ( const volTensorField &    ) 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<sphericalTensorField> interpolate ( const interpolation< sphericalTensor > &    ) 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  ) [inline, virtual]

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: