An abstract class for surfaces with sampling. More...
Classes | |
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< sampledSurface > | clone () const |
Clone. More... | |
virtual | ~sampledSurface () |
Destructor. More... | |
const polyMesh & | mesh () const |
Access to the underlying mesh. More... | |
const word & | name () 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 pointField & | points () const =0 |
Points of surface. More... | |
virtual const faceList & | faces () const =0 |
Faces of surface. More... | |
virtual const vectorField & | Sf () const |
Return face area vectors. More... | |
virtual const scalarField & | magSf () const |
Return face area magnitudes. More... | |
virtual const vectorField & | Cf () 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< scalarField > | sample (const volScalarField &) const =0 |
Sample field on surface. More... | |
virtual tmp< vectorField > | sample (const volVectorField &) const =0 |
Sample field on surface. More... | |
virtual tmp< sphericalTensorField > | sample (const volSphericalTensorField &) const =0 |
Sample field on surface. More... | |
virtual tmp< symmTensorField > | sample (const volSymmTensorField &) const =0 |
Sample field on surface. More... | |
virtual tmp< tensorField > | sample (const volTensorField &) const =0 |
Sample field on surface. More... | |
virtual tmp< scalarField > | sample (const surfaceScalarField &) const |
Surface sample field on surface. More... | |
virtual tmp< vectorField > | sample (const surfaceVectorField &) const |
Surface Sample field on surface. More... | |
virtual tmp< sphericalTensorField > | sample (const surfaceSphericalTensorField &) const |
Surface sample field on surface. More... | |
virtual tmp< symmTensorField > | sample (const surfaceSymmTensorField &) const |
Surface sample field on surface. More... | |
virtual tmp< tensorField > | sample (const surfaceTensorField &) const |
Surface sample field on surface. More... | |
virtual tmp< scalarField > | interpolate (const interpolation< scalar > &) const =0 |
Interpolate field on surface. More... | |
virtual tmp< vectorField > | interpolate (const interpolation< vector > &) const =0 |
Interpolate field on surface. More... | |
virtual tmp< sphericalTensorField > | interpolate (const interpolation< sphericalTensor > &) const =0 |
Interpolate field on surface. More... | |
virtual tmp< symmTensorField > | interpolate (const interpolation< symmTensor > &) const =0 |
Interpolate field on surface. More... | |
virtual tmp< tensorField > | interpolate (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< sampledSurface > | New (const word &name, const polyMesh &, const dictionary &) |
Return a reference to the selected surface. More... | |
Protected Member Functions | |
virtual void | clearGeom () const |
Friends | |
Ostream & | operator<< (Ostream &, const sampledSurface &) |
Ostream operator. More... | |
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 81 of file sampledSurface.H.
sampledSurface | ( | const word & | name, |
const polyMesh & | mesh, | ||
const bool | interpolate = false |
||
) |
Construct from name, mesh.
Definition at line 152 of file sampledSurface.C.
Referenced by sampledSurface::New(), and sampledSurface::iNew::operator()().
sampledSurface | ( | const word & | name, |
const polyMesh & | mesh, | ||
const dictionary & | dict | ||
) |
Construct from dictionary.
Definition at line 169 of file sampledSurface.C.
References dictionary::readIfPresent().
|
virtual |
Destructor.
Definition at line 189 of file sampledSurface.C.
Referenced by sampledSurface::clone().
|
protectedvirtual |
Definition at line 107 of file sampledSurface.C.
References Foam::deleteDemandDrivenData(), and sampledSurface::New().
Referenced by sampledPlane::expire(), sampledIsoSurfaceCell::expire(), sampledPatch::expire(), sampledTriSurfaceMesh::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) | |||
) |
Declare run-time constructor selection table.
|
inline |
Clone.
Definition at line 221 of file sampledSurface.H.
References sampledSurface::New(), NotImplemented, and sampledSurface::~sampledSurface().
|
static |
Return a reference to the selected surface.
Definition at line 119 of file sampledSurface.C.
References dict, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::Info, dictionary::lookup(), mesh, Foam::name(), Foam::nl, and sampledSurface::sampledSurface().
Referenced by sampledSurface::clearGeom(), sampledSurface::clone(), NamedEnum< directionType, 3 >::names(), and sampledSurface::iNew::operator()().
|
inline |
Access to the underlying mesh.
Definition at line 248 of file sampledSurface.H.
Referenced by sampledPatch::patchFaceLabels(), and sampledSurface::pointAverage().
|
inline |
Name of surface.
Definition at line 254 of file sampledSurface.H.
Referenced by sampledSurface::iNew::operator()(), and sampledPatch::patchFaceLabels().
|
inline |
Interpolation requested for surface.
Definition at line 260 of file sampledSurface.H.
References sampledSurface::area(), sampledSurface::average(), sampledSurface::Cf(), sampledSurface::expire(), sampledSurface::faces(), sampledSurface::integrate(), sampledSurface::magSf(), sampledSurface::needsUpdate(), sampledSurface::pointAverage(), sampledSurface::points(), sampledSurface::sample(), sampledSurface::Sf(), and sampledSurface::update().
Referenced by sampledThresholdCellFaces::faces(), sampledIsoSurfaceCell::faces(), sampledPatch::faces(), sampledTriSurfaceMesh::faces(), sampledPatchInternalField::interpolate(), sampledThresholdCellFaces::interpolate(), sampledPlane::interpolate(), sampledIsoSurfaceCell::interpolate(), sampledCuttingPlane::interpolate(), distanceSurface::interpolate(), sampledIsoSurface::interpolate(), sampledPatch::interpolate(), sampledTriSurfaceMesh::interpolate(), sampledPlane::meshCells(), nearestEqOp::operator()(), sampledSurface::iNew::operator()(), sampledPatchInternalField::sample(), sampledThresholdCellFaces::sample(), sampledPlane::sample(), sampledIsoSurfaceCell::sample(), sampledCuttingPlane::sample(), sampledPatch::sample(), distanceSurface::sample(), sampledIsoSurface::sample(), sampledTriSurfaceMesh::sample(), sampledIsoSurface::sampledIsoSurface(), sampledCuttingPlane::surface(), distanceSurface::surface(), and sampledIsoSurface::surface().
|
pure virtual |
Does the surface need an update?
Implemented in sampledTriSurfaceMesh, sampledIsoSurface, sampledPatch, distanceSurface, sampledCuttingPlane, sampledIsoSurfaceCell, sampledThresholdCellFaces, and sampledPlane.
Referenced by sampledSurface::interpolate().
|
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, sampledIsoSurface, sampledPatch, distanceSurface, sampledCuttingPlane, sampledIsoSurfaceCell, sampledThresholdCellFaces, and sampledPlane.
Referenced by sampledSurface::interpolate().
|
pure virtual |
Update the surface as required.
Do nothing (and return false) if no update was required
Implemented in sampledTriSurfaceMesh, sampledIsoSurface, sampledPatch, distanceSurface, sampledCuttingPlane, sampledIsoSurfaceCell, sampledThresholdCellFaces, and sampledPlane.
Referenced by sampledSurface::interpolate(), and sampledSurfaces::update().
|
pure virtual |
Points of surface.
Implemented in sampledTriSurfaceMesh, sampledIsoSurface, sampledPatch, distanceSurface, sampledCuttingPlane, sampledIsoSurfaceCell, sampledThresholdCellFaces, and sampledPlane.
Referenced by sampledSurface::interpolate(), NamedEnum< directionType, 3 >::names(), and sampledSurfaces::update().
|
pure virtual |
Faces of surface.
Implemented in sampledTriSurfaceMesh, sampledIsoSurface, sampledPatch, distanceSurface, sampledCuttingPlane, sampledIsoSurfaceCell, sampledThresholdCellFaces, and sampledPlane.
Referenced by sampledSurface::interpolate(), NamedEnum< directionType, 3 >::names(), sampledSurface::project(), and sampledSurfaces::update().
|
virtual |
Return face area vectors.
Definition at line 197 of file sampledSurface.C.
Referenced by sampledSurface::average(), and sampledSurface::interpolate().
|
virtual |
Return face area magnitudes.
Definition at line 208 of file sampledSurface.C.
Referenced by sampledSurface::average(), sampledSurface::integrate(), and sampledSurface::interpolate().
|
virtual |
Return face centres as vectorField.
Definition at line 219 of file sampledSurface.C.
Referenced by sampledSurface::interpolate().
Foam::scalar area | ( | ) | const |
The total surface area.
Definition at line 230 of file sampledSurface.C.
References Foam::reduce(), sampledSurface::sample(), and Foam::sum().
Referenced by sampledSurface::average(), and sampledSurface::interpolate().
Type integrate | ( | const Field< Type > & | field | ) | const |
Integration of a field across the surface.
Definition at line 50 of file sampledSurfaceTemplates.C.
References sampledSurface::magSf(), Foam::reduce(), Foam::sum(), and Foam::Zero.
Referenced by sampledSurface::integrate(), and sampledSurface::interpolate().
Integration of a field across the surface.
Definition at line 65 of file sampledSurfaceTemplates.C.
References sampledSurface::integrate().
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 sampledSurface::area(), sampledSurface::magSf(), Foam::reduce(), Foam::sum(), and Foam::Zero.
Referenced by sampledSurface::average(), and sampledSurface::interpolate().
Area-averaged value of a field across the surface.
Definition at line 98 of file sampledSurfaceTemplates.C.
References sampledSurface::average(), List< Type >::clear(), forAll, Foam::mag(), and sampledSurface::Sf().
Foam::tmp< Foam::Field< Foam::scalar > > project | ( | const Field< scalar > & | field | ) | const |
Project field onto surface.
Definition at line 293 of file sampledSurface.C.
References forAll, and tmp< T >::ref().
Foam::tmp< Foam::Field< Foam::scalar > > project | ( | const Field< vector > & | field | ) | const |
Project field onto surface.
Definition at line 308 of file sampledSurface.C.
References tmp< T >::ref().
Foam::tmp< Foam::Field< Foam::vector > > project | ( | const Field< sphericalTensor > & | field | ) | const |
Project field onto surface.
Definition at line 317 of file sampledSurface.C.
References tmp< T >::ref().
Foam::tmp< Foam::Field< Foam::vector > > project | ( | const Field< symmTensor > & | field | ) | const |
Project field onto surface.
Definition at line 326 of file sampledSurface.C.
References tmp< T >::ref().
Foam::tmp< Foam::Field< Foam::vector > > project | ( | const Field< tensor > & | field | ) | const |
Project field onto surface.
Definition at line 335 of file sampledSurface.C.
References tmp< T >::ref().
tmp<GeometricField<Type, fvPatchField, volMesh> > pointAverage | ( | const GeometricField< Type, pointPatchField, pointMesh > & | pfld | ) | const |
Interpolate from points to cell centre.
Referenced by sampledSurface::interpolate(), and sampledSurface::project().
|
pure virtual |
Sample field on surface.
Implemented in sampledPatch, sampledPatch, sampledTriSurfaceMesh, sampledIsoSurface, distanceSurface, sampledPatch, sampledCuttingPlane, sampledIsoSurfaceCell, sampledThresholdCellFaces, sampledPlane, and sampledPatchInternalField.
Definition at line 273 of file sampledSurface.C.
References NotImplemented.
Referenced by sampledSurface::area(), sampledSurface::interpolate(), and sampledSurface::sample().
|
pure virtual |
Sample field on surface.
Implemented in sampledTriSurfaceMesh, sampledIsoSurface, distanceSurface, sampledPatch, sampledCuttingPlane, sampledIsoSurfaceCell, sampledPlane, sampledThresholdCellFaces, and sampledPatchInternalField.
|
pure virtual |
Sample field on surface.
Implemented in sampledTriSurfaceMesh, sampledIsoSurface, distanceSurface, sampledPatch, sampledCuttingPlane, sampledIsoSurfaceCell, sampledPlane, sampledThresholdCellFaces, and sampledPatchInternalField.
|
pure virtual |
Sample field on surface.
Implemented in sampledTriSurfaceMesh, sampledIsoSurface, distanceSurface, sampledPatch, sampledCuttingPlane, sampledIsoSurfaceCell, sampledPlane, sampledThresholdCellFaces, and sampledPatchInternalField.
|
pure virtual |
Sample field on surface.
Implemented in sampledTriSurfaceMesh, sampledIsoSurface, distanceSurface, sampledPatch, sampledCuttingPlane, sampledIsoSurfaceCell, sampledPlane, sampledThresholdCellFaces, and sampledPatchInternalField.
|
virtual |
Surface sample field on surface.
Reimplemented in sampledPatch.
Definition at line 243 of file sampledSurface.C.
References NotImplemented, and sampledSurface::sample().
|
virtual |
Surface Sample field on surface.
Reimplemented in sampledPatch.
Definition at line 253 of file sampledSurface.C.
References NotImplemented, and sampledSurface::sample().
|
virtual |
Surface sample field on surface.
Reimplemented in sampledPatch.
Definition at line 263 of file sampledSurface.C.
References NotImplemented, and sampledSurface::sample().
|
virtual |
Surface sample field on surface.
Reimplemented in sampledPatch, sampledPatch, sampledTriSurfaceMesh, sampledIsoSurface, distanceSurface, sampledPatch, sampledCuttingPlane, sampledIsoSurfaceCell, sampledThresholdCellFaces, sampledPlane, and sampledPatchInternalField.
|
virtual |
Surface sample field on surface.
Reimplemented in sampledPatch, sampledPatch, sampledTriSurfaceMesh, sampledIsoSurface, distanceSurface, sampledPatch, sampledCuttingPlane, sampledIsoSurfaceCell, sampledThresholdCellFaces, sampledPlane, and sampledPatchInternalField.
|
pure virtual |
Interpolate field on surface.
Implemented in sampledTriSurfaceMesh, sampledPatch, sampledIsoSurface, distanceSurface, sampledCuttingPlane, sampledIsoSurfaceCell, sampledPlane, sampledThresholdCellFaces, and sampledPatchInternalField.
|
pure virtual |
Interpolate field on surface.
Implemented in sampledTriSurfaceMesh, sampledPatch, sampledIsoSurface, distanceSurface, sampledCuttingPlane, sampledIsoSurfaceCell, sampledPlane, sampledThresholdCellFaces, and sampledPatchInternalField.
|
pure virtual |
Interpolate field on surface.
Implemented in sampledTriSurfaceMesh, sampledPatch, sampledIsoSurface, distanceSurface, sampledCuttingPlane, sampledIsoSurfaceCell, sampledPlane, sampledThresholdCellFaces, and sampledPatchInternalField.
|
pure virtual |
Interpolate field on surface.
Implemented in sampledTriSurfaceMesh, sampledPatch, sampledIsoSurface, distanceSurface, sampledCuttingPlane, sampledIsoSurfaceCell, sampledPlane, sampledThresholdCellFaces, and sampledPatchInternalField.
|
pure virtual |
Interpolate field on surface.
Implemented in sampledTriSurfaceMesh, sampledPatch, sampledIsoSurface, distanceSurface, sampledCuttingPlane, sampledIsoSurfaceCell, sampledPlane, sampledThresholdCellFaces, and sampledPatchInternalField.
|
inlinevirtual |
Rename.
Definition at line 428 of file sampledSurface.H.
References sampledSurface::operator<<, and sampledSurface::print().
|
virtual |
Write.
Reimplemented in sampledTriSurfaceMesh, sampledPatch, sampledIsoSurface, distanceSurface, sampledCuttingPlane, sampledIsoSurfaceCell, sampledPlane, sampledThresholdCellFaces, and sampledPatchInternalField.
Definition at line 343 of file sampledSurface.C.
References Foam::type().
Referenced by Foam::operator<<(), and sampledSurface::rename().
Foam::tmp<Foam::Field<ReturnType> > project | ( | const tmp< Field< Type >> & | field | ) | const |
Definition at line 144 of file sampledSurfaceTemplates.C.
References sampledSurface::faces(), and sampledSurface::pointAverage().
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > pointAverage | ( | const GeometricField< Type, pointPatchField, pointMesh > & | pfld | ) | const |
Definition at line 157 of file sampledSurfaceTemplates.C.
References GeometricField< Type, PatchField, GeoMesh >::correctBoundaryConditions(), IOobject::db(), Foam::dimless, forAll, sampledSurface::mesh(), DimensionedField< Type, GeoMesh >::mesh(), primitiveMesh::nCells(), IOobject::NO_READ, IOobject::NO_WRITE, primitiveMesh::nPoints(), primitiveMesh::pointCells(), tmp< T >::ref(), fvMesh::time(), Time::timeName(), and Foam::Zero.
|
friend |
Ostream operator.
Referenced by sampledSurface::rename().