Public Member Functions | Private Types | Private Member Functions | Private Attributes
sampledThresholdCellFaces Class Reference

A sampledSurface defined by the cell faces corresponding to a threshold value. More...

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

Public Member Functions

 TypeName ("sampledThresholdCellFaces")
 Runtime type information. More...
 
 sampledThresholdCellFaces (const word &name, const polyMesh &, const dictionary &)
 Construct from dictionary. More...
 
virtual ~sampledThresholdCellFaces ()
 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...
 
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
 
- Public Member Functions inherited from MeshedSurface< face >
 MeshedSurface ()
 Construct null. More...
 
 MeshedSurface (const Xfer< pointField > &, const Xfer< List< Face > > &, const Xfer< surfZoneList > &)
 Construct by transferring components (points, faces, zones). More...
 
 MeshedSurface (const Xfer< pointField > &, const Xfer< List< Face > > &, const labelUList &zoneSizes=labelUList(), const UList< word > &zoneNames=UList< word >())
 Construct by transferring components (points, faces). More...
 
 MeshedSurface (const MeshedSurface &)
 Construct as copy. More...
 
 MeshedSurface (const UnsortedMeshedSurface< Face > &)
 Construct from a UnsortedMeshedSurface. More...
 
 MeshedSurface (const polyBoundaryMesh &, const bool globalPoints=false)
 Construct from a boundary mesh with local points/faces. More...
 
 MeshedSurface (const surfMesh &)
 Construct from a surfMesh. More...
 
 MeshedSurface (const Xfer< UnsortedMeshedSurface< Face > > &)
 Construct by transferring the contents from a UnsortedMeshedSurface. More...
 
 MeshedSurface (const Xfer< MeshedSurface< Face > > &)
 Construct by transferring the contents from a MeshedSurface. More...
 
 MeshedSurface (const fileName &)
 Construct from file name (uses extension to determine type) More...
 
 MeshedSurface (const fileName &, const word &ext)
 Construct from file name (uses extension to determine type) More...
 
 MeshedSurface (const Time &, const word &surfName="")
 Construct from database. More...
 
 MeshedSurface ()
 
 MeshedSurface (const Xfer< pointField > &pointLst, const Xfer< List< Face > > &faceLst, const Xfer< surfZoneList > &zoneLst)
 
 MeshedSurface (const Xfer< pointField > &pointLst, const Xfer< List< Face > > &faceLst, const labelUList &zoneSizes, const UList< word > &zoneNames)
 
 MeshedSurface (const MeshedSurface< Face > &surf)
 
 MeshedSurface (const UnsortedMeshedSurface< Face > &surf)
 
 MeshedSurface (const surfMesh &mesh)
 
 MeshedSurface (const polyBoundaryMesh &bMesh, const bool useGlobalPoints)
 
 MeshedSurface (const fileName &name, const word &ext)
 
 MeshedSurface (const fileName &name)
 
 MeshedSurface (const Time &t, const word &surfName)
 
 MeshedSurface (const Xfer< UnsortedMeshedSurface< Face > > &surf)
 
 MeshedSurface (const Xfer< MeshedSurface< Face > > &surf)
 
 ClassName ("MeshedSurface")
 Runtime type information. More...
 
bool isTri ()
 Specialization for holding triangulated information. More...
 
 declareRunTimeSelectionTable (autoPtr, MeshedSurface, fileExtension,(const fileName &name),(name))
 
virtual ~MeshedSurface ()
 Destructor. More...
 
 declareMemberFunctionSelectionTable (void, UnsortedMeshedSurface, write, fileExtension,(const fileName &name, const MeshedSurface< Face > &surf),(name, surf))
 
virtual void write (const fileName &name) const
 Generic write routine. Chooses writer based on extension. More...
 
void write (const Time &, const word &surfName="") const
 Write to database. More...
 
label size () const
 The surface size is the number of faces. More...
 
const List< Face > & faces () const
 Return const access to the faces. More...
 
const List< surfZone > & surfZones () const
 Const access to the surface zones. More...
 
virtual void addZones (const UList< surfZone > &, const bool cullEmpty=false)
 Add surface zones. More...
 
virtual void addZones (const labelUList &sizes, const UList< word > &names, const bool cullEmpty=false)
 Add surface zones. More...
 
virtual void addZones (const labelUList &sizes, const bool cullEmpty=false)
 Add surface zones. More...
 
virtual void removeZones ()
 Remove surface zones. More...
 
virtual void clear ()
 Clear all storage. More...
 
virtual void movePoints (const pointField &)
 Move points. More...
 
virtual void scalePoints (const scalar)
 Scale points. A non-positive factor is ignored. More...
 
virtual void reset (const Xfer< pointField > &points, const Xfer< List< Face > > &faces, const Xfer< surfZoneList > &zones)
 Reset primitive data (points, faces and zones) More...
 
virtual void reset (const Xfer< List< point > > &points, const Xfer< List< Face > > &faces, const Xfer< surfZoneList > &zones)
 Reset primitive data (points, faces and zones) More...
 
virtual void cleanup (const bool verbose)
 Remove invalid faces. More...
 
virtual bool stitchFaces (const scalar tol=SMALL, const bool verbose=false)
 
virtual bool checkFaces (const bool verbose=false)
 
virtual label triangulate ()
 Triangulate in-place, returning the number of triangles added. More...
 
virtual label triangulate (List< label > &faceMap)
 Triangulate in-place, returning the number of triangles added. More...
 
label triangulate ()
 Specialization for holding triangulated information. More...
 
label triangulate (List< label > &faceMap)
 Specialization for holding triangulated information. More...
 
MeshedSurface subsetMesh (const labelHashSet &include, labelList &pointMap, labelList &faceMap) const
 Return new surface. More...
 
MeshedSurface subsetMesh (const labelHashSet &include) const
 Return new surface. More...
 
void transfer (MeshedSurface< Face > &)
 Transfer the contents of the argument and annul the argument. More...
 
void transfer (UnsortedMeshedSurface< Face > &)
 Transfer the contents of the argument and annul the argument. More...
 
Xfer< MeshedSurface< Face > > xfer ()
 Transfer contents to the Xfer container. More...
 
bool read (const fileName &, const word &ext)
 Read from file. Chooses reader based on explicit extension. More...
 
virtual bool read (const fileName &)
 Read from file. Chooses reader based on detected extension. More...
 
void writeStats (Ostream &os) const
 
void operator= (const MeshedSurface< Face > &)
 
 operator MeshedSurfaceProxy< Face > () const
 Conversion operator to MeshedSurfaceProxy. More...
 

Private Types

typedef MeshedSurface< faceMeshStorage
 Private typedefs for convenience. More...
 

Private Member Functions

bool updateGeometry () const
 Create surface (if time has changed) 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 word fieldName_
 Field to get isoSurface of. More...
 
const scalar lowerThreshold_
 Threshold value. More...
 
const scalar upperThreshold_
 Threshold value. More...
 
keyType zoneKey_
 If restricted to zones, name of this zone or a regular expression. More...
 
bool triangulate_
 Triangulated faces or keep faces as is. More...
 
label prevTimeIndex_
 Time at last call, also track it surface needs an update. More...
 
labelList meshCells_
 For every face the original cell in mesh. More...
 

Additional Inherited Members

- Public Types inherited from MeshedSurface< face >
typedef Face FaceType
 Face type used. More...
 
- 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...
 
- Static Public Member Functions inherited from MeshedSurface< face >
static bool isTri ()
 Face storage only handles triangulated faces. More...
 
static bool canRead (const fileName &, const bool verbose=false)
 Can we read this file format? More...
 
static bool canReadType (const word &ext, const bool verbose=false)
 Can we read this file format? More...
 
static bool canWriteType (const word &ext, const bool verbose=false)
 Can we write this file format? More...
 
static wordHashSet readTypes ()
 
static wordHashSet writeTypes ()
 
static autoPtr< MeshedSurfaceNew (const fileName &, const word &ext)
 Select constructed from filename (explicit extension) More...
 
static autoPtr< MeshedSurfaceNew (const fileName &)
 Select constructed from filename (implicit extension) More...
 
static void write (const fileName &, const MeshedSurface< Face > &)
 Write to file. More...
 
- Protected Member Functions inherited from sampledSurface
virtual void clearGeom () const
 
- Protected Member Functions inherited from MeshedSurface< face >
void transcribe (MeshedSurface< face > &)
 Transfer points/zones and transcribe face -> triFace. More...
 
void transcribe (MeshedSurface< face > &surf)
 
void transcribe (MeshedSurface< face > &surf)
 
void checkZones ()
 Basic sanity check on zones. More...
 
pointFieldstoredPoints ()
 Non-const access to global points. More...
 
List< Face > & storedFaces ()
 Non-const access to the faces. More...
 
surfZoneListstoredZones ()
 Non-const access to the zones. More...
 
void sortFacesAndStore (const Xfer< List< Face > > &unsortedFaces, const Xfer< List< label > > &zoneIds, const bool sorted)
 Sort faces by zones and store sorted faces. More...
 
virtual void remapFaces (const labelUList &faceMap)
 Set new zones from faceMap. More...
 

Detailed Description

A sampledSurface defined by the cell faces corresponding to a threshold value.

Source files

Definition at line 50 of file sampledThresholdCellFaces.H.

Member Typedef Documentation

◆ MeshStorage

typedef MeshedSurface<face> MeshStorage
private

Private typedefs for convenience.

Definition at line 56 of file sampledThresholdCellFaces.H.

Constructor & Destructor Documentation

◆ sampledThresholdCellFaces()

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

Construct from dictionary.

Definition at line 149 of file sampledThresholdCellFaces.C.

References Foam::abort(), dict, Foam::endl(), Foam::FatalError, FatalErrorInFunction, and dictionary::found().

Here is the call graph for this function:

◆ ~sampledThresholdCellFaces()

Destructor.

Definition at line 183 of file sampledThresholdCellFaces.C.

Member Function Documentation

◆ updateGeometry()

bool updateGeometry ( ) const
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 ( "sampledThresholdCellFaces"  )

Runtime type information.

◆ needsUpdate()

bool needsUpdate ( ) const
virtual

Does the surface need an update?

Implements sampledSurface.

Definition at line 189 of file sampledThresholdCellFaces.C.

References mesh, fvMesh::time(), and TimeState::timeIndex().

Here is the call graph for this function:

◆ 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 197 of file sampledThresholdCellFaces.C.

◆ update()

bool update ( )
virtual

Update the surface as required.

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

Implements sampledSurface.

Definition at line 211 of file sampledThresholdCellFaces.C.

◆ points()

virtual const pointField& points ( ) const
inlinevirtual

Points of surface.

Implements sampledSurface.

Definition at line 139 of file sampledThresholdCellFaces.H.

References points.

Referenced by sampledThresholdCellFaces::updateGeometry().

Here is the caller graph for this function:

◆ faces()

virtual const faceList& faces ( ) const
inlinevirtual

Faces of surface.

Implements sampledSurface.

Definition at line 145 of file sampledThresholdCellFaces.H.

References MeshedSurface< face >::faces().

Referenced by sampledThresholdCellFaces::updateGeometry().

Here is the call graph for this function:
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 218 of file sampledThresholdCellFaces.C.

◆ sample() [2/5]

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

Sample field on surface.

Implements sampledSurface.

Definition at line 227 of file sampledThresholdCellFaces.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 263 of file sampledThresholdCellFaces.C.

◆ interpolate() [2/5]

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

Interpolate field on surface.

Implements sampledSurface.

Definition at line 272 of file sampledThresholdCellFaces.C.

◆ interpolate() [3/5]

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

Interpolate field on surface.

Implements sampledSurface.

Definition at line 281 of file sampledThresholdCellFaces.C.

◆ interpolate() [4/5]

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

Interpolate field on surface.

Implements sampledSurface.

Definition at line 290 of file sampledThresholdCellFaces.C.

◆ interpolate() [5/5]

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

Interpolate field on surface.

Implements sampledSurface.

Definition at line 299 of file sampledThresholdCellFaces.C.

◆ print()

void print ( Ostream os) const
virtual

Write.

Reimplemented from sampledSurface.

Definition at line 307 of file sampledThresholdCellFaces.C.

References Foam::name().

Here is the call graph for this function:

◆ sampleField() [2/2]

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

Definition at line 38 of file sampledThresholdCellFacesTemplates.C.

◆ interpolateField() [2/2]

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

Definition at line 52 of file sampledThresholdCellFacesTemplates.C.

References f(), forAll, interpolation::interpolate(), and points.

Here is the call graph for this function:

Field Documentation

◆ fieldName_

const word fieldName_
private

Field to get isoSurface of.

Definition at line 61 of file sampledThresholdCellFaces.H.

Referenced by sampledThresholdCellFaces::updateGeometry().

◆ lowerThreshold_

const scalar lowerThreshold_
private

Threshold value.

Definition at line 64 of file sampledThresholdCellFaces.H.

Referenced by sampledThresholdCellFaces::updateGeometry().

◆ upperThreshold_

const scalar upperThreshold_
private

Threshold value.

Definition at line 67 of file sampledThresholdCellFaces.H.

Referenced by sampledThresholdCellFaces::updateGeometry().

◆ zoneKey_

keyType zoneKey_
private

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

Definition at line 70 of file sampledThresholdCellFaces.H.

◆ triangulate_

bool triangulate_
private

Triangulated faces or keep faces as is.

Definition at line 73 of file sampledThresholdCellFaces.H.

Referenced by sampledThresholdCellFaces::updateGeometry().

◆ prevTimeIndex_

label prevTimeIndex_
mutableprivate

Time at last call, also track it surface needs an update.

Definition at line 78 of file sampledThresholdCellFaces.H.

Referenced by sampledThresholdCellFaces::updateGeometry().

◆ meshCells_

labelList meshCells_
mutableprivate

For every face the original cell in mesh.

Definition at line 81 of file sampledThresholdCellFaces.H.

Referenced by sampledThresholdCellFaces::updateGeometry().


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