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().
|
virtual |
Definition at line 190 of file sampledSurface.C.
|
protectedvirtual |
Definition at line 42 of file sampledSurface.C.
References Foam::deleteDemandDrivenData().
Referenced by sampledPlane::expire(), sampledPatch::expire(), sampledTriSurfaceMesh::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) | |||
) |
|
inline |
|
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()().
|
inline |
Access to the underlying mesh.
Definition at line 235 of file sampledSurface.H.
Referenced by sampledPatch::patchIndex().
|
inline |
Name of surface.
Definition at line 241 of file sampledSurface.H.
Referenced by sampledSurface::iNew::operator()().
|
inline |
interpolation requested for surface
Definition at line 247 of file sampledSurface.H.
Referenced by sampledIsoSurface::sampledIsoSurface().
|
pure virtual |
Does the surface need an update?
Implemented in sampledIsoSurface, sampledCuttingPlane, distanceSurface, sampledIsoSurfaceCell, sampledTriSurfaceMesh, sampledThresholdCellFaces, sampledPatch, and sampledPlane.
|
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.
|
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().
|
pure virtual |
Points of surface.
Implemented in sampledIsoSurface, sampledPatch, sampledCuttingPlane, distanceSurface, sampledIsoSurfaceCell, sampledTriSurfaceMesh, sampledThresholdCellFaces, and sampledPlane.
Referenced by sampledSurfaces::update().
|
pure virtual |
Faces of surface.
Implemented in sampledIsoSurface, sampledPatch, sampledCuttingPlane, distanceSurface, sampledIsoSurfaceCell, sampledTriSurfaceMesh, sampledThresholdCellFaces, and sampledPlane.
Referenced by sampledSurfaces::update().
|
virtual |
Return face area vectors.
Definition at line 197 of file sampledSurface.C.
|
virtual |
Return face area magnitudes.
Definition at line 208 of file sampledSurface.C.
|
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.
|
pure virtual |
Sample field on surface.
Implemented in sampledCuttingPlane, distanceSurface, sampledIsoSurfaceCell, sampledPatch, sampledTriSurfaceMesh, sampledThresholdCellFaces, and sampledPlane.
|
pure virtual |
Sample field on surface.
Implemented in sampledIsoSurface, sampledCuttingPlane, distanceSurface, sampledIsoSurfaceCell, sampledPatch, sampledTriSurfaceMesh, sampledThresholdCellFaces, and sampledPlane.
|
pure virtual |
Sample field on surface.
Implemented in sampledIsoSurface, sampledIsoSurface, sampledCuttingPlane, distanceSurface, sampledCuttingPlane, distanceSurface, sampledIsoSurfaceCell, sampledPatch, sampledIsoSurfaceCell, sampledPatch, sampledTriSurfaceMesh, sampledThresholdCellFaces, sampledTriSurfaceMesh, sampledThresholdCellFaces, sampledPlane, and sampledPlane.
|
pure virtual |
Sample field on surface.
Implemented in sampledIsoSurface, sampledIsoSurface, sampledCuttingPlane, distanceSurface, sampledCuttingPlane, distanceSurface, sampledIsoSurfaceCell, sampledPatch, sampledIsoSurfaceCell, sampledPatch, sampledTriSurfaceMesh, sampledThresholdCellFaces, sampledTriSurfaceMesh, sampledThresholdCellFaces, sampledPlane, and sampledPlane.
|
pure virtual |
Sample field on surface.
Implemented in sampledIsoSurface, sampledCuttingPlane, distanceSurface, sampledIsoSurfaceCell, sampledPatch, sampledTriSurfaceMesh, sampledThresholdCellFaces, and sampledPlane.
|
pure virtual |
Interpolate field on surface.
Implemented in sampledIsoSurface, sampledCuttingPlane, distanceSurface, sampledIsoSurfaceCell, sampledPatch, sampledTriSurfaceMesh, sampledThresholdCellFaces, and sampledPlane.
|
pure virtual |
Interpolate field on surface.
Implemented in sampledIsoSurface, sampledCuttingPlane, distanceSurface, sampledIsoSurfaceCell, sampledPatch, sampledTriSurfaceMesh, sampledThresholdCellFaces, and sampledPlane.
|
pure virtual |
Interpolate field on surface.
Implemented in sampledIsoSurface, sampledCuttingPlane, distanceSurface, sampledIsoSurfaceCell, sampledPatch, sampledTriSurfaceMesh, sampledThresholdCellFaces, and sampledPlane.
|
pure virtual |
Interpolate field on surface.
Implemented in sampledIsoSurface, sampledCuttingPlane, distanceSurface, sampledIsoSurfaceCell, sampledPatch, sampledTriSurfaceMesh, sampledThresholdCellFaces, and sampledPlane.
|
pure virtual |
Interpolate field on surface.
Implemented in sampledIsoSurface, sampledCuttingPlane, distanceSurface, sampledIsoSurfaceCell, sampledPatch, sampledTriSurfaceMesh, sampledThresholdCellFaces, and sampledPlane.
|
inlinevirtual |
Rename.
Definition at line 380 of file sampledSurface.H.
|
virtual |
Write.
Reimplemented in sampledIsoSurface, sampledCuttingPlane, distanceSurface, sampledIsoSurfaceCell, sampledPatch, sampledTriSurfaceMesh, sampledThresholdCellFaces, and sampledPlane.
Definition at line 294 of file sampledSurface.C.
References Foam::type().
|
friend |