Public Member Functions | Protected Member Functions | List of all members
distanceSurface Class Reference

A surface defined by a distance from an input searchable surface. Uses an iso-surface algorithm (cell, topo, point) for constructing the distance surface. More...

Inheritance diagram for distanceSurface:
Inheritance graph
[legend]

Public Member Functions

 TypeName ("distanceSurface")
 
 distanceSurface (const word &defaultSurfaceName, const polyMesh &mesh, const dictionary &dict)
 
 distanceSurface (const polyMesh &mesh, const word &surfaceType, const word &surfaceName, const isoSurfaceParams &params=isoSurfaceParams(), const bool interpolate=false)
 
 distanceSurface (const polyMesh &mesh, const bool interpolate, const word &surfaceType, const word &surfaceName, const scalar distance, const bool useSignedDistance, const isoSurfaceParams &params=isoSurfaceParams())
 
 distanceSurface (const polyMesh &mesh, const bool interpolate, autoPtr< searchableSurface > &&surface, const scalar distance, const bool useSignedDistance, const isoSurfaceParams &params=isoSurfaceParams())
 
virtual ~distanceSurface ()=default
 
void createGeometry ()
 
const wordsurfaceName () const
 
scalar distance () const noexcept
 
const meshedSurfacesurface () const
 
meshedSurfacesurface ()
 
const labelListmeshCells () const
 
labelListmeshCells ()
 
void print (Ostream &os, int level=0) const
 

Protected Member Functions

bool hasIsoSurface () const
 
template<class Type >
tmp< Field< Type > > isoSurfaceInterpolate (const GeometricField< Type, fvPatchField, volMesh > &cellValues, const Field< Type > &pointValues) const
 
bool refineBlockedCells (bitSet &ignoreCells, const isoSurfaceBase &isoContext) const
 
bitSet filterPrepareRegionSplit (const bitSet &ignoreCells) const
 
void filterKeepLargestRegion (bitSet &ignoreCells) const
 
void filterKeepNearestRegions (bitSet &ignoreCells) const
 
void filterRegionProximity (bitSet &ignoreCells) const
 
void filterFaceProximity ()
 

Detailed Description

A surface defined by a distance from an input searchable surface. Uses an iso-surface algorithm (cell, topo, point) for constructing the distance surface.

For a zero-distance surface, it performs additional checks and supports filtering to handle the surface boundaries.

Usage
Example of function object partial specification:
surfaces
{
    surface1
    {
        type        distanceSurface;
        surfaceType triSurfaceMesh;
        surfaceName something.obj;
        topology    proximityFaces;
    }

    surface2
    {
        type        distanceSurface;
        surfaceType triSurfaceMesh;
        surfaceName other.obj;

        topology    nearestPoints;
        nearestPoints
        (
            (0 0 0)
            (10 10 0)
        );

        // Max search distance for nearestPoints
        maxDistance 0.005;
    }
}

Dictionary controls:

Property Description Required Default
distance distance from surface no 0
signed Use sign when distance is positive no true
isoMethod Iso-algorithm (cell/topo/point) no default
regularise Face simplification (enum or bool) no true
bounds Limit with bounding box no
surfaceType Type of surface yes
surfaceName Name of surface in triSurface/ no dict name
topology Topology filter name no none
nearestPoints Points for point-based segmentation no
maxDistance Max search distance for nearestPoints no GREAT
absProximity Max proximity of face centres no 1e-5

Topology/Filtering (for zero-distance only). These represent different ways to tackle the "ragged edge" problem.

Note
For distance = 0, some special adjustments.
  • Always signed (ignoring the input value).
  • Use normal distance from surface (for better treatment of open edges).
  • Additional checks for open surfaces edges are used to limit the extend of resulting distance surface. The resulting surface elements will, however, contain partial cell coverage. NB: Not applicable if the point isoMethod is used.

The keyword cell (bool value) which was use in 1906 and earlier to switch between point/cell algorithms is now ignored (2020-12).

Changed default algorithm from cell to topo (2020-12).

Source files

Definition at line 205 of file distanceSurface.H.

Constructor & Destructor Documentation

◆ distanceSurface() [1/4]

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

Definition at line 243 of file distanceSurface.C.

References dict, and Foam::sqr().

Here is the call graph for this function:

◆ distanceSurface() [2/4]

distanceSurface ( const polyMesh mesh,
const word surfaceType,
const word surfaceName,
const isoSurfaceParams params = isoSurfaceParams(),
const bool  interpolate = false 
)

Definition at line 313 of file distanceSurface.C.

◆ distanceSurface() [3/4]

distanceSurface ( const polyMesh mesh,
const bool  interpolate,
const word surfaceType,
const word surfaceName,
const scalar  distance,
const bool  useSignedDistance,
const isoSurfaceParams params = isoSurfaceParams() 
)

Definition at line 335 of file distanceSurface.C.

◆ distanceSurface() [4/4]

distanceSurface ( const polyMesh mesh,
const bool  interpolate,
autoPtr< searchableSurface > &&  surface,
const scalar  distance,
const bool  useSignedDistance,
const isoSurfaceParams params = isoSurfaceParams() 
)

Definition at line 371 of file distanceSurface.C.

◆ ~distanceSurface()

virtual ~distanceSurface ( )
virtualdefault

Member Function Documentation

◆ hasIsoSurface()

bool hasIsoSurface ( ) const
inlineprotected

Definition at line 298 of file distanceSurface.H.

References bool.

◆ isoSurfaceInterpolate()

tmp<Field<Type> > isoSurfaceInterpolate ( const GeometricField< Type, fvPatchField, volMesh > &  cellValues,
const Field< Type > &  pointValues 
) const
inlineprotected

Definition at line 306 of file distanceSurface.H.

◆ refineBlockedCells()

bool refineBlockedCells ( bitSet ignoreCells,
const isoSurfaceBase isoContext 
) const
protected

Definition at line 30 of file distanceSurfaceFilter.C.

References isoSurfaceBase::getCellCutType(), bitSet::set(), and bitSet::test().

Referenced by distanceSurface::createGeometry().

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

◆ filterPrepareRegionSplit()

Foam::bitSet filterPrepareRegionSplit ( const bitSet ignoreCells) const
protected

Definition at line 62 of file distanceSurfaceFilter.C.

References forAll, Foam::foamVersion::patch, bitSet::set(), and bitSet::test().

Here is the call graph for this function:

◆ filterKeepLargestRegion()

void filterKeepLargestRegion ( bitSet ignoreCells) const
protected

Definition at line 113 of file distanceSurfaceFilter.C.

References PackedList::clearStorage(), Foam::expressions::patchExpr::debug, Foam::findMax(), Foam::flatOutput(), forAll, Foam::Info, Foam::nl, regionSplit::nRegions(), bitSet::set(), Foam::sum(), bitSet::test(), and Foam::Zero.

Referenced by distanceSurface::createGeometry().

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

◆ filterKeepNearestRegions()

void filterKeepNearestRegions ( bitSet ignoreCells) const
protected

◆ filterRegionProximity()

void filterRegionProximity ( bitSet ignoreCells) const
protected

◆ filterFaceProximity()

void filterFaceProximity ( )
protected

◆ TypeName()

TypeName ( "distanceSurface"  )

◆ createGeometry()

void createGeometry ( )

◆ surfaceName()

const word& surfaceName ( ) const
inline

Definition at line 405 of file distanceSurface.H.

Referenced by distanceSurface::filterFaceProximity().

Here is the caller graph for this function:

◆ distance()

scalar distance ( ) const
inlinenoexcept

Definition at line 411 of file distanceSurface.H.

◆ surface() [1/2]

const meshedSurface& surface ( ) const
inline

◆ surface() [2/2]

meshedSurface& surface ( )
inline

Definition at line 427 of file distanceSurface.H.

◆ meshCells() [1/2]

const labelList& meshCells ( ) const
inline

Definition at line 437 of file distanceSurface.H.

◆ meshCells() [2/2]

labelList& meshCells ( )
inline

Definition at line 447 of file distanceSurface.H.

◆ print()

void print ( Ostream os,
int  level = 0 
) const

Definition at line 755 of file distanceSurface.C.

References Foam::distance(), and os().

Referenced by distanceSurface::createGeometry(), and sampledDistanceSurface::print().

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

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