Public Member Functions | Private Member Functions | Private Attributes
distanceSurface Class Reference

A sampledSurface defined by a distance to a surface. More...

Inheritance diagram for distanceSurface:
Inheritance graph
[legend]
Collaboration diagram for distanceSurface:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("distanceSurface")
 Runtime type information. More...
 
 distanceSurface (const word &name, const polyMesh &mesh, const dictionary &dict)
 Construct from dictionary. More...
 
 distanceSurface (const word &name, const polyMesh &mesh, const bool interpolate, const word &surfaceType, const word &surfaceName, const scalar distance, const bool signedDistance, const bool cell, const Switch regularise, const Switch average, const boundBox &bounds=boundBox::greatBox)
 Construct from components. More...
 
virtual ~distanceSurface ()
 Destructor. More...
 
virtual bool needsUpdate () const
 Does the surface need an update? More...
 
virtual bool expire ()
 Mark the surface as needing an update. More...
 
virtual bool update ()
 Update the surface as required. More...
 
virtual const pointFieldpoints () const
 Points of surface. More...
 
virtual const faceListfaces () const
 Faces of surface. More...
 
const triSurfacesurface () const
 
virtual tmp< scalarFieldsample (const volScalarField &) const
 Sample field on surface. More...
 
virtual tmp< vectorFieldsample (const volVectorField &) const
 Sample field on surface. More...
 
virtual tmp< sphericalTensorFieldsample (const volSphericalTensorField &) const
 Sample field on surface. More...
 
virtual tmp< symmTensorFieldsample (const volSymmTensorField &) const
 Sample field on surface. More...
 
virtual tmp< tensorFieldsample (const volTensorField &) const
 Sample field on surface. More...
 
virtual tmp< scalarFieldinterpolate (const interpolation< scalar > &) const
 Interpolate field on surface. More...
 
virtual tmp< vectorFieldinterpolate (const interpolation< vector > &) const
 Interpolate field on surface. More...
 
virtual tmp< sphericalTensorFieldinterpolate (const interpolation< sphericalTensor > &) const
 Interpolate field on surface. More...
 
virtual tmp< symmTensorFieldinterpolate (const interpolation< symmTensor > &) const
 Interpolate field on surface. More...
 
virtual tmp< tensorFieldinterpolate (const interpolation< tensor > &) const
 Interpolate field on surface. More...
 
virtual void print (Ostream &) const
 Write. More...
 
template<class Type >
Foam::tmp< Foam::Field< Type > > sampleField (const GeometricField< Type, fvPatchField, volMesh > &vField) const
 
template<class Type >
Foam::tmp< Foam::Field< Type > > interpolateField (const interpolation< Type > &interpolator) const
 
- Public Member Functions inherited from sampledSurface
 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 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 void rename (const word &newName)
 Rename. 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
 

Private Member Functions

void createGeometry ()
 Create iso surface. More...
 
template<class Type >
tmp< Field< Type > > sampleField (const GeometricField< Type, fvPatchField, volMesh > &vField) const
 Sample field on faces. More...
 
template<class Type >
tmp< Field< Type > > interpolateField (const interpolation< Type > &) const
 

Private Attributes

const autoPtr< searchableSurfacesurfPtr_
 Surface. More...
 
const scalar distance_
 Distance value. More...
 
const bool signed_
 Signed distance. More...
 
const bool cell_
 Whether to use isoSurfaceCell or isoSurface. More...
 
const Switch regularise_
 Whether to coarsen. More...
 
const Switch average_
 Whether to recalculate cell values as average of point values. More...
 
const boundBox bounds_
 Optional bounding box to trim triangles against. More...
 
keyType zoneKey_
 If restricted to zones, name of this zone or a regular expression. More...
 
bool needsUpdate_
 Track if the surface needs an update. More...
 
autoPtr< volScalarFieldcellDistancePtr_
 Distance to cell centres. More...
 
scalarField pointDistance_
 Distance to points. More...
 
autoPtr< isoSurfaceCellisoSurfCellPtr_
 Constructed iso surface. More...
 
autoPtr< isoSurfaceisoSurfPtr_
 Constructed iso surface. More...
 
autoPtr< faceListfacesPtr_
 Triangles converted to faceList. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from sampledSurface
static autoPtr< sampledSurfaceNew (const word &name, const polyMesh &, const dictionary &)
 Return a reference to the selected surface. More...
 
- Protected Member Functions inherited from sampledSurface
virtual void clearGeom () const
 

Detailed Description

A sampledSurface defined by a distance to a surface.

Uses either isoSurfaceCell or isoSurface.

Source files

Definition at line 53 of file distanceSurface.H.

Constructor & Destructor Documentation

◆ distanceSurface() [1/2]

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

Construct from dictionary.

Definition at line 306 of file distanceSurface.C.

◆ distanceSurface() [2/2]

distanceSurface ( const word name,
const polyMesh mesh,
const bool  interpolate,
const word surfaceType,
const word surfaceName,
const scalar  distance,
const bool  signedDistance,
const bool  cell,
const Switch  regularise,
const Switch  average,
const boundBox bounds = boundBox::greatBox 
)

Construct from components.

Definition at line 354 of file distanceSurface.C.

◆ ~distanceSurface()

~distanceSurface ( )
virtual

Destructor.

Definition at line 402 of file distanceSurface.C.

Member Function Documentation

◆ createGeometry()

void createGeometry ( )
private

◆ sampleField() [1/2]

tmp<Field<Type> > sampleField ( const GeometricField< Type, fvPatchField, volMesh > &  vField) const
private

Sample field on faces.

◆ interpolateField() [1/2]

tmp<Field<Type> > interpolateField ( const interpolation< Type > &  ) const
private

◆ TypeName()

TypeName ( "distanceSurface"  )

Runtime type information.

◆ needsUpdate()

bool needsUpdate ( ) const
virtual

Does the surface need an update?

Implements sampledSurface.

Definition at line 408 of file distanceSurface.C.

◆ expire()

bool expire ( )
virtual

Mark the surface as needing an update.

May also free up unneeded data. Return false if surface was already marked as expired.

Implements sampledSurface.

Definition at line 414 of file distanceSurface.C.

References Foam::endl(), and Foam::Pout.

Here is the call graph for this function:

◆ update()

bool update ( )
virtual

Update the surface as required.

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

Implements sampledSurface.

Definition at line 440 of file distanceSurface.C.

References Foam::endl(), and Foam::Pout.

Here is the call graph for this function:

◆ points()

virtual const pointField& points ( ) const
inlinevirtual

Points of surface.

Implements sampledSurface.

Definition at line 173 of file distanceSurface.H.

References PrimitivePatch< Face, FaceList, PointField, PointType >::points(), and distanceSurface::surface().

Here is the call graph for this function:

◆ faces()

virtual const faceList& faces ( ) const
inlinevirtual

Faces of surface.

Implements sampledSurface.

Definition at line 179 of file distanceSurface.H.

References distanceSurface::facesPtr_, forAll, s(), and distanceSurface::surface().

Here is the call graph for this function:

◆ surface()

const triSurface& surface ( ) const
inline

Definition at line 195 of file distanceSurface.H.

References distanceSurface::cell_, distanceSurface::isoSurfCellPtr_, and distanceSurface::isoSurfPtr_.

Referenced by distanceSurface::faces(), and distanceSurface::points().

Here is the caller graph for this function:

◆ sample() [1/5]

Foam::tmp< Foam::scalarField > sample ( const volScalarField vField) const
virtual

Sample field on surface.

Implements sampledSurface.

Definition at line 462 of file distanceSurface.C.

◆ sample() [2/5]

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

Sample field on surface.

Implements sampledSurface.

Definition at line 471 of file distanceSurface.C.

◆ sample() [3/5]

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

Sample field on surface.

Implements sampledSurface.

◆ sample() [4/5]

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

Sample field on surface.

Implements sampledSurface.

◆ sample() [5/5]

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

Sample field on surface.

Implements sampledSurface.

◆ interpolate() [1/5]

Foam::tmp< Foam::scalarField > interpolate ( const interpolation< scalar > &  interpolator) const
virtual

Interpolate field on surface.

Implements sampledSurface.

Definition at line 507 of file distanceSurface.C.

◆ interpolate() [2/5]

Foam::tmp< Foam::vectorField > interpolate ( const interpolation< vector > &  interpolator) const
virtual

Interpolate field on surface.

Implements sampledSurface.

Definition at line 516 of file distanceSurface.C.

◆ interpolate() [3/5]

Foam::tmp< Foam::sphericalTensorField > interpolate ( const interpolation< sphericalTensor > &  interpolator) const
virtual

Interpolate field on surface.

Implements sampledSurface.

Definition at line 524 of file distanceSurface.C.

◆ interpolate() [4/5]

Foam::tmp< Foam::symmTensorField > interpolate ( const interpolation< symmTensor > &  interpolator) const
virtual

Interpolate field on surface.

Implements sampledSurface.

Definition at line 533 of file distanceSurface.C.

◆ interpolate() [5/5]

Foam::tmp< Foam::tensorField > interpolate ( const interpolation< tensor > &  interpolator) const
virtual

Interpolate field on surface.

Implements sampledSurface.

Definition at line 542 of file distanceSurface.C.

◆ print()

void print ( Ostream os) const
virtual

Write.

Reimplemented from sampledSurface.

Definition at line 550 of file distanceSurface.C.

References Foam::name(), and points.

Referenced by distanceSurface::createGeometry().

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

◆ sampleField() [2/2]

Foam::tmp<Foam::Field<Type> > sampleField ( const GeometricField< Type, fvPatchField, volMesh > &  vField) const

Definition at line 36 of file distanceSurfaceTemplates.C.

◆ interpolateField() [2/2]

Foam::tmp<Foam::Field<Type> > interpolateField ( const interpolation< Type > &  interpolator) const

Definition at line 60 of file distanceSurfaceTemplates.C.

References Foam::MULES::interpolate(), mesh, Foam::compressible::New(), and interpolation::psi().

Here is the call graph for this function:

Field Documentation

◆ surfPtr_

const autoPtr<searchableSurface> surfPtr_
private

Surface.

Definition at line 60 of file distanceSurface.H.

Referenced by distanceSurface::createGeometry().

◆ distance_

const scalar distance_
private

Distance value.

Definition at line 63 of file distanceSurface.H.

Referenced by distanceSurface::createGeometry().

◆ signed_

const bool signed_
private

Signed distance.

Definition at line 66 of file distanceSurface.H.

Referenced by distanceSurface::createGeometry().

◆ cell_

const bool cell_
private

Whether to use isoSurfaceCell or isoSurface.

Definition at line 69 of file distanceSurface.H.

Referenced by distanceSurface::createGeometry(), and distanceSurface::surface().

◆ regularise_

const Switch regularise_
private

Whether to coarsen.

Definition at line 72 of file distanceSurface.H.

Referenced by distanceSurface::createGeometry().

◆ average_

const Switch average_
private

Whether to recalculate cell values as average of point values.

Definition at line 75 of file distanceSurface.H.

◆ bounds_

const boundBox bounds_
private

Optional bounding box to trim triangles against.

Definition at line 78 of file distanceSurface.H.

Referenced by distanceSurface::createGeometry().

◆ zoneKey_

keyType zoneKey_
private

If restricted to zones, name of this zone or a regular expression.

Definition at line 81 of file distanceSurface.H.

◆ needsUpdate_

bool needsUpdate_
mutableprivate

Track if the surface needs an update.

Definition at line 84 of file distanceSurface.H.

◆ cellDistancePtr_

autoPtr<volScalarField> cellDistancePtr_
private

Distance to cell centres.

Definition at line 88 of file distanceSurface.H.

Referenced by distanceSurface::createGeometry().

◆ pointDistance_

scalarField pointDistance_
private

Distance to points.

Definition at line 91 of file distanceSurface.H.

Referenced by distanceSurface::createGeometry().

◆ isoSurfCellPtr_

autoPtr<isoSurfaceCell> isoSurfCellPtr_
private

Constructed iso surface.

Definition at line 94 of file distanceSurface.H.

Referenced by distanceSurface::createGeometry(), and distanceSurface::surface().

◆ isoSurfPtr_

autoPtr<isoSurface> isoSurfPtr_
private

Constructed iso surface.

Definition at line 97 of file distanceSurface.H.

Referenced by distanceSurface::createGeometry(), and distanceSurface::surface().

◆ facesPtr_

autoPtr<faceList> facesPtr_
mutableprivate

Triangles converted to faceList.

Definition at line 100 of file distanceSurface.H.

Referenced by distanceSurface::createGeometry(), and distanceSurface::faces().


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