An abstract class for surfaces with sampling. More...
#include <sampling/sampledSurface.H>
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.
Definition at line 73 of file sampledSurface.H.
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 &) |
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.
void clearGeom | ( | ) | const [protected, virtual]
|
Definition at line 42 of file sampledSurface.C.
References Foam::deleteDemandDrivenData().
Referenced by sampledTriSurfaceMesh::expire(), sampledPlane::expire(), sampledPatch::expire(), sampledIsoSurfaceCell::expire(), and sampledPlane::update().
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]
|
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]
|
Does the surface need an update?
Implemented in distanceSurface, sampledIsoSurface, sampledIsoSurfaceCell, sampledCuttingPlane, sampledPatch, sampledPlane, sampledTriSurfaceMesh, and sampledThresholdCellFaces.
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]
|
Points of surface.
Implemented in distanceSurface, sampledIsoSurface, sampledIsoSurfaceCell, sampledCuttingPlane, sampledPatch, sampledPlane, sampledTriSurfaceMesh, and sampledThresholdCellFaces.
Referenced by sampledSurfaces::update().
virtual const faceList& faces | ( | ) | const [pure virtual]
|
Faces of surface.
Implemented in distanceSurface, sampledIsoSurface, sampledIsoSurfaceCell, sampledCuttingPlane, sampledPatch, sampledPlane, sampledTriSurfaceMesh, and sampledThresholdCellFaces.
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().
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().
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 |
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]
|
Sample field on surface.
Implemented in distanceSurface, sampledIsoSurfaceCell, sampledCuttingPlane, sampledPatch, sampledPlane, sampledTriSurfaceMesh, and sampledThresholdCellFaces.
virtual tmp<vectorField> sample | ( | const volVectorField & | ) | const [pure virtual]
|
Sample field on surface.
Implemented in distanceSurface, sampledIsoSurface, sampledIsoSurfaceCell, sampledCuttingPlane, sampledPatch, sampledPlane, sampledTriSurfaceMesh, and sampledThresholdCellFaces.
virtual tmp<sphericalTensorField> sample | ( | const volSphericalTensorField & | ) | const [pure virtual]
|
Sample field on surface.
Implemented in distanceSurface, sampledIsoSurface, sampledIsoSurface, sampledIsoSurfaceCell, sampledCuttingPlane, sampledPatch, sampledPlane, sampledTriSurfaceMesh, and sampledThresholdCellFaces.
virtual tmp<symmTensorField> sample | ( | const volSymmTensorField & | ) | const [pure virtual]
|
Sample field on surface.
Implemented in distanceSurface, sampledIsoSurface, sampledIsoSurfaceCell, sampledCuttingPlane, sampledPatch, sampledPlane, sampledTriSurfaceMesh, and sampledThresholdCellFaces.
virtual tmp<tensorField> sample | ( | const volTensorField & | ) | const [pure virtual]
|
Sample field on surface.
Implemented in distanceSurface, sampledIsoSurface, sampledIsoSurfaceCell, sampledCuttingPlane, sampledPatch, sampledPlane, sampledTriSurfaceMesh, and sampledThresholdCellFaces.
virtual tmp<scalarField> interpolate | ( | const interpolation< scalar > & | ) | const [pure virtual]
|
Interpolate field on surface.
Implemented in distanceSurface, sampledIsoSurface, sampledIsoSurfaceCell, sampledCuttingPlane, sampledPatch, sampledPlane, sampledTriSurfaceMesh, and sampledThresholdCellFaces.
virtual tmp<vectorField> interpolate | ( | const interpolation< vector > & | ) | const [pure virtual]
|
Interpolate field on surface.
Implemented in distanceSurface, sampledIsoSurface, sampledIsoSurfaceCell, sampledCuttingPlane, sampledPatch, sampledPlane, sampledTriSurfaceMesh, and sampledThresholdCellFaces.
virtual tmp<sphericalTensorField> interpolate | ( | const interpolation< sphericalTensor > & | ) | const [pure virtual]
|
Interpolate field on surface.
Implemented in distanceSurface, sampledIsoSurface, sampledIsoSurfaceCell, sampledCuttingPlane, sampledPatch, sampledPlane, sampledTriSurfaceMesh, and sampledThresholdCellFaces.
virtual tmp<symmTensorField> interpolate | ( | const interpolation< symmTensor > & | ) | const [pure virtual]
|
Interpolate field on surface.
Implemented in distanceSurface, sampledIsoSurface, sampledIsoSurfaceCell, sampledCuttingPlane, sampledPatch, sampledPlane, sampledTriSurfaceMesh, and sampledThresholdCellFaces.
virtual tmp<tensorField> interpolate | ( | const interpolation< tensor > & | ) | const [pure virtual]
|
Interpolate field on surface.
Implemented in distanceSurface, sampledIsoSurface, sampledIsoSurfaceCell, sampledCuttingPlane, sampledPatch, sampledPlane, sampledTriSurfaceMesh, and sampledThresholdCellFaces.
virtual void rename | ( | const word & | newName ) | [inline, virtual]
|
Rename.
Definition at line 380 of file sampledSurface.H.
void print | ( | Ostream & | os ) | const [virtual]
|
Write.
Reimplemented in distanceSurface, sampledIsoSurface, sampledIsoSurfaceCell, sampledCuttingPlane, sampledPatch, sampledPlane, sampledTriSurfaceMesh, and sampledThresholdCellFaces.
Definition at line 294 of file sampledSurface.C.
References Foam::type().
Ostream& operator<< | ( | Ostream & | , |
const sampledSurface & | |||
) | [friend]
|