Data Structures | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends
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]

Data Structures

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

Public Member Functions

 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 bool needsUpdate () const =0
 Does the surface need an update? More...
 
virtual bool expire ()=0
 Mark the surface as needing an update. More...
 
virtual bool update ()=0
 Update the surface as required. More...
 
virtual const pointFieldpoints () const =0
 Points of surface. More...
 
virtual const faceListfaces () const =0
 Faces of 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 tmp< scalarFieldsample (const volScalarField &) const =0
 Sample field on surface. More...
 
virtual tmp< vectorFieldsample (const volVectorField &) const =0
 Sample field on surface. More...
 
virtual tmp< sphericalTensorFieldsample (const volSphericalTensorField &) const =0
 Sample field on surface. More...
 
virtual tmp< symmTensorFieldsample (const volSymmTensorField &) const =0
 Sample field on surface. More...
 
virtual tmp< tensorFieldsample (const volTensorField &) const =0
 Sample field on surface. More...
 
virtual tmp< scalarFieldsample (const surfaceScalarField &) const
 Surface sample field on surface. More...
 
virtual tmp< vectorFieldsample (const surfaceVectorField &) const
 Surface Sample field on surface. More...
 
virtual tmp< sphericalTensorFieldsample (const surfaceSphericalTensorField &) const
 Surface sample field on surface. More...
 
virtual tmp< symmTensorFieldsample (const surfaceSymmTensorField &) const
 Surface sample field on surface. More...
 
virtual tmp< tensorFieldsample (const surfaceTensorField &) const
 Surface sample field on surface. More...
 
virtual tmp< scalarFieldinterpolate (const interpolation< scalar > &) const =0
 Interpolate field on surface. More...
 
virtual tmp< vectorFieldinterpolate (const interpolation< vector > &) const =0
 Interpolate field on surface. More...
 
virtual tmp< sphericalTensorFieldinterpolate (const interpolation< sphericalTensor > &) const =0
 Interpolate field on surface. More...
 
virtual tmp< symmTensorFieldinterpolate (const interpolation< symmTensor > &) const =0
 Interpolate field on surface. More...
 
virtual tmp< tensorFieldinterpolate (const interpolation< tensor > &) const =0
 Interpolate field on surface. More...
 
virtual void rename (const word &newName)
 Rename. More...
 
virtual void print (Ostream &) const
 Write. 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
 

Static Public Member Functions

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

Protected Member Functions

virtual void clearGeom () const
 

Private Member Functions

void makeSf () const
 Make Sf. More...
 
void makeMagSf () const
 Make magSf. More...
 
void makeCf () const
 Make Cf. More...
 
template<class Type >
bool checkFieldSize (const Field< Type > &) const
 Check field size matches surface size. More...
 
template<class ReturnType , class Type >
void project (Field< ReturnType > &, const Field< Type > &) const
 Project field onto surface. More...
 
template<class ReturnType , class Type >
void project (Field< ReturnType > &, const tmp< Field< Type > > &) const
 Project field onto surface. More...
 
template<class ReturnType , class Type >
tmp< Field< ReturnType > > project (const tmp< Field< Type > > &) const
 Project field onto surface. More...
 

Private Attributes

word name_
 Name of sample surface. More...
 
const polyMeshmesh_
 Reference to mesh. More...
 
const bool interpolate_
 Do we intend to interpolate the information? More...
 
vectorFieldSfPtr_
 Face area vectors. More...
 
scalarFieldmagSfPtr_
 Mag face area vectors. More...
 
vectorFieldCfPtr_
 Face centres. More...
 
scalar area_
 Total surface area. More...
 

Friends

Ostreamoperator<< (Ostream &, const sampledSurface &)
 Ostream operator. More...
 

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 77 of file sampledSurface.H.

Constructor & Destructor Documentation

◆ sampledSurface() [1/2]

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

Construct from name, mesh.

Definition at line 150 of file sampledSurface.C.

◆ sampledSurface() [2/2]

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

Construct from dictionary.

Definition at line 167 of file sampledSurface.C.

References dict, and dictionary::readIfPresent().

Here is the call graph for this function:

◆ ~sampledSurface()

~sampledSurface ( )
virtual

Destructor.

Definition at line 187 of file sampledSurface.C.

Member Function Documentation

◆ makeSf()

void makeSf ( ) const
private

Make Sf.

Definition at line 51 of file sampledSurface.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, points, and List::size().

Here is the call graph for this function:

◆ makeMagSf()

void makeMagSf ( ) const
private

Make magSf.

Definition at line 72 of file sampledSurface.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, points, and List::size().

Here is the call graph for this function:

◆ makeCf()

void makeCf ( ) const
private

Make Cf.

Definition at line 93 of file sampledSurface.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, points, and List::size().

Here is the call graph for this function:

◆ checkFieldSize()

bool checkFieldSize ( const Field< Type > &  field) const
private

Check field size matches surface size.

Definition at line 29 of file sampledSurfaceTemplates.C.

References Foam::exit(), sampledSurface::faces(), Foam::FatalError, FatalErrorInFunction, and List::size().

Here is the call graph for this function:

◆ project() [1/9]

void project ( Field< ReturnType > &  res,
const Field< Type > &  field 
) const
private

Project field onto surface.

Definition at line 108 of file sampledSurfaceTemplates.C.

References forAll, and Foam::mag().

Here is the call graph for this function:

◆ project() [2/9]

void project ( Field< ReturnType > &  res,
const tmp< Field< Type > > &  field 
) const
private

Project field onto surface.

Definition at line 131 of file sampledSurfaceTemplates.C.

◆ project() [3/9]

tmp<Field<ReturnType> > project ( const tmp< Field< Type > > &  ) const
private

Project field onto surface.

◆ clearGeom()

void clearGeom ( ) const
protectedvirtual

◆ TypeName()

TypeName ( "sampledSurface"  )

Runtime type information.

◆ declareRunTimeSelectionTable()

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

Declare run-time constructor selection table.

◆ clone()

autoPtr<sampledSurface> clone ( ) const
inline

Clone.

Definition at line 217 of file sampledSurface.H.

References NotImplemented.

◆ New()

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 117 of file sampledSurface.C.

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

Referenced by sampledSurface::iNew::operator()(), and faceSource::sampledSurfaceFaces().

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

◆ mesh()

const polyMesh& mesh ( ) const
inline

◆ name()

const word& name ( ) const
inline

Name of surface.

Definition at line 250 of file sampledSurface.H.

References sampledSurface::name_.

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

Here is the caller graph for this function:

◆ interpolate() [1/6]

bool interpolate ( ) const
inline

Interpolation requested for surface.

Definition at line 256 of file sampledSurface.H.

References sampledSurface::interpolate_.

Referenced by sampledIsoSurface::getIsoFields(), sampledIsoSurface::sampledIsoSurface(), sampledTriSurfaceMesh::update(), and sampledIsoSurfaceCell::updateGeometry().

Here is the caller graph for this function:

◆ needsUpdate()

virtual bool needsUpdate ( ) const
pure virtual

◆ expire()

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 sampledTriSurfaceMesh, distanceSurface, sampledIsoSurface, sampledPatch, sampledCuttingPlane, sampledIsoSurfaceCell, sampledThresholdCellFaces, and sampledPlane.

◆ update()

virtual bool update ( )
pure virtual

Update the surface as required.

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

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

◆ points()

virtual const pointField& points ( ) const
pure virtual

◆ faces()

virtual const faceList& faces ( ) const
pure virtual

◆ Sf()

const Foam::vectorField & Sf ( ) const
virtual

Return face area vectors.

Definition at line 195 of file sampledSurface.C.

◆ magSf()

const Foam::scalarField & magSf ( ) const
virtual

Return face area magnitudes.

Definition at line 206 of file sampledSurface.C.

◆ Cf()

const Foam::vectorField & Cf ( ) const
virtual

Return face centres as vectorField.

Definition at line 217 of file sampledSurface.C.

◆ area()

Foam::scalar area ( ) const

The total surface area.

Definition at line 228 of file sampledSurface.C.

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

Here is the call graph for this function:

◆ integrate() [1/2]

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

Integration of a field across the surface.

Definition at line 50 of file sampledSurfaceTemplates.C.

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

Here is the call graph for this function:

◆ integrate() [2/2]

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

Integration of a field across the surface.

Definition at line 65 of file sampledSurfaceTemplates.C.

◆ average() [1/2]

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

Area-averaged value of a field across the surface.

Definition at line 74 of file sampledSurfaceTemplates.C.

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

Here is the call graph for this function:

◆ average() [2/2]

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

Area-averaged value of a field across the surface.

Definition at line 98 of file sampledSurfaceTemplates.C.

References Foam::average().

Here is the call graph for this function:

◆ project() [4/9]

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

Project field onto surface.

Definition at line 291 of file sampledSurface.C.

References forAll.

◆ project() [5/9]

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

Project field onto surface.

Definition at line 306 of file sampledSurface.C.

◆ project() [6/9]

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

Project field onto surface.

Definition at line 315 of file sampledSurface.C.

◆ project() [7/9]

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

Project field onto surface.

Definition at line 324 of file sampledSurface.C.

◆ project() [8/9]

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

Project field onto surface.

Definition at line 333 of file sampledSurface.C.

◆ pointAverage() [1/2]

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

Interpolate from points to cell centre.

Referenced by sampledIsoSurface::getIsoFields().

Here is the caller graph for this function:

◆ sample() [1/10]

virtual tmp<scalarField> sample ( const volScalarField ) const
pure virtual

◆ sample() [2/10]

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

◆ sample() [3/10]

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

◆ sample() [4/10]

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

◆ sample() [5/10]

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

◆ sample() [6/10]

virtual tmp<scalarField> sample ( const surfaceScalarField ) const
virtual

◆ sample() [7/10]

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

◆ sample() [8/10]

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

◆ sample() [9/10]

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

◆ sample() [10/10]

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

◆ interpolate() [2/6]

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

◆ interpolate() [3/6]

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

◆ interpolate() [4/6]

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

◆ interpolate() [5/6]

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

◆ interpolate() [6/6]

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

◆ rename()

virtual void rename ( const word newName)
inlinevirtual

Rename.

Definition at line 424 of file sampledSurface.H.

References sampledSurface::name_.

◆ print()

void print ( Ostream os) const
virtual

Write.

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

Definition at line 341 of file sampledSurface.C.

References Foam::type().

Here is the call graph for this function:

◆ project() [9/9]

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

Definition at line 144 of file sampledSurfaceTemplates.C.

◆ pointAverage() [2/2]

Friends And Related Function Documentation

◆ operator<<

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

Ostream operator.

Field Documentation

◆ name_

word name_
private

Name of sample surface.

Definition at line 82 of file sampledSurface.H.

Referenced by sampledSurface::name(), and sampledSurface::rename().

◆ mesh_

const polyMesh& mesh_
private

Reference to mesh.

Definition at line 85 of file sampledSurface.H.

Referenced by sampledSurface::mesh().

◆ interpolate_

const bool interpolate_
private

Do we intend to interpolate the information?

Definition at line 88 of file sampledSurface.H.

Referenced by sampledSurface::interpolate().

◆ SfPtr_

vectorField* SfPtr_
mutableprivate

Face area vectors.

Definition at line 94 of file sampledSurface.H.

Referenced by sampledSurface::clearGeom().

◆ magSfPtr_

scalarField* magSfPtr_
mutableprivate

Mag face area vectors.

Definition at line 97 of file sampledSurface.H.

Referenced by sampledSurface::clearGeom().

◆ CfPtr_

vectorField* CfPtr_
mutableprivate

Face centres.

Definition at line 100 of file sampledSurface.H.

Referenced by sampledSurface::clearGeom().

◆ area_

scalar area_
mutableprivate

Total surface area.

Definition at line 103 of file sampledSurface.H.

Referenced by sampledSurface::clearGeom().


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