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...
#include <distanceSurface.H>

Public Member Functions | |
| TypeName ("distanceSurface") | |
| Runtime type information. | |
| distanceSurface (const word &defaultSurfaceName, const polyMesh &mesh, const dictionary &dict) | |
| Construct from dictionary. | |
| distanceSurface (const polyMesh &mesh, const word &surfaceType, const word &surfaceName, const isoSurfaceParams ¶ms=isoSurfaceParams(), const bool interpolate=false) | |
| Construct from components with zero-distanced. | |
| distanceSurface (const polyMesh &mesh, const bool interpolate, const word &surfaceType, const word &surfaceName, const scalar distance, const bool useSignedDistance, const isoSurfaceParams ¶ms=isoSurfaceParams()) | |
| Construct from components. | |
| distanceSurface (const polyMesh &mesh, const bool interpolate, autoPtr< searchableSurface > &&surface, const scalar distance, const bool useSignedDistance, const isoSurfaceParams ¶ms=isoSurfaceParams()) | |
| virtual | ~distanceSurface ()=default |
| Destructor. | |
| void | createGeometry () |
| Create/recreate the distance surface. | |
| const word & | surfaceName () const |
| The name of the underlying searchableSurface. | |
| scalar | distance () const noexcept |
| The distance to the underlying searchableSurface. | |
| const meshedSurface & | surface () const |
| The underlying surface. | |
| meshedSurface & | surface () |
| The underlying surface. | |
| const labelList & | meshCells () const |
| For each face, the original cell in mesh. | |
| labelList & | meshCells () |
| For each face, the original cell in mesh. | |
| void | print (Ostream &os, int level=0) const |
| Print information. | |
Protected Member Functions | |
| bool | hasIsoSurface () const |
| Is currently backed by an isoSurfacePtr_. | |
| template<class Type> | |
| tmp< Field< Type > > | isoSurfaceInterpolate (const VolumeField< Type > &cellValues, const Field< Type > &pointValues) const |
| Interpolate volume field onto surface points. | |
| bool | refineBlockedCells (bitSet &ignoreCells, const isoSurfaceBase &isoContext) const |
| Re-filter the blocked cells based on the anticipated cuts. | |
| bitSet | filterPrepareRegionSplit (const bitSet &ignoreCells) const |
| Prepare blockedFaces for region split. | |
| void | filterKeepLargestRegion (bitSet &ignoreCells) const |
| Keep region with the most cuts (after region split). | |
| void | filterKeepNearestRegions (bitSet &ignoreCells) const |
| Keep region(s) closest to the nearest points. | |
| void | filterRegionProximity (bitSet &ignoreCells) const |
| Remove region(s) that have far faces. | |
| void | filterFaceProximity () |
| Adjust extracted iso-surface to remove far faces. | |
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.
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.
none : No filteringproximityFaces or proximity (post-filter): Checks the resulting faces against the original search surface and rejects faces with a distance greater than absProximity.proximityRegions (post-filter): Checks the distance of the resulting faces against the original search surface. Filters based on the area-weighted distance of each topologically connected region. If the area-weighted distance of a region is greater than absProximity, the entire region is rejected.largestRegion (pre-filter): The cut cells are checked for topological connectivity and the region with the most number of cut cells is retained.nearestPoints (pre-filter): The cut cells split into regions, the regions closest to the user-defined points are retained. Uses maxDistance for additional control.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).
Definition at line 205 of file distanceSurface.H.
| distanceSurface | ( | const word & | defaultSurfaceName, |
| const polyMesh & | mesh, | ||
| const dictionary & | dict ) |
Construct from dictionary.
Definition at line 234 of file distanceSurface.C.
References dict, e, Foam::equal(), mesh, Foam::New(), and Foam::sqr().
Referenced by distanceSurface(), distanceSurface(), sampledDistanceSurface::sampledDistanceSurface(), and sampledDistanceSurface::sampledDistanceSurface().


| distanceSurface | ( | const polyMesh & | mesh, |
| const word & | surfaceType, | ||
| const word & | surfaceName, | ||
| const isoSurfaceParams & | params = isoSurfaceParams(), | ||
| const bool | interpolate = false ) |
Construct from components with zero-distanced.
Definition at line 304 of file distanceSurface.C.
References distanceSurface(), mesh, and surfaceName().

| distanceSurface | ( | const polyMesh & | mesh, |
| const bool | interpolate, | ||
| const word & | surfaceType, | ||
| const word & | surfaceName, | ||
| const scalar | distance, | ||
| const bool | useSignedDistance, | ||
| const isoSurfaceParams & | params = isoSurfaceParams() ) |
Construct from components.
Definition at line 326 of file distanceSurface.C.
References distance(), distanceSurface(), mesh, Foam::New(), and surfaceName().

| distanceSurface | ( | const polyMesh & | mesh, |
| const bool | interpolate, | ||
| autoPtr< searchableSurface > && | surface, | ||
| const scalar | distance, | ||
| const bool | useSignedDistance, | ||
| const isoSurfaceParams & | params = isoSurfaceParams() ) |
Definition at line 362 of file distanceSurface.C.
References distance(), e, Foam::equal(), mesh, Foam::sqr(), and surface().

|
virtualdefault |
Destructor.
|
inlineprotected |
Is currently backed by an isoSurfacePtr_.
Definition at line 337 of file distanceSurface.H.
Referenced by sampledDistanceSurface::sampleOnIsoSurfacePoints(), and sampledDistanceSurface::sampleOnPoints().

|
inlineprotected |
Interpolate volume field onto surface points.
Definition at line 346 of file distanceSurface.H.
Referenced by sampledDistanceSurface::sampleOnIsoSurfacePoints().

|
protected |
Re-filter the blocked cells based on the anticipated cuts.
Uses a lightweight variant of cutting.
Definition at line 29 of file distanceSurfaceFilter.C.
References isoSurfaceBase::ANYCUT, isoSurfaceBase::getCellCutType(), bitSet::set(), and bitSet::test().
Referenced by createGeometry().


|
protected |
Prepare blockedFaces for region split.
Definition at line 61 of file distanceSurfaceFilter.C.
References forAll, bitSet::set(), syncTools::syncFaceList(), and bitSet::test().
Referenced by filterKeepLargestRegion(), filterKeepNearestRegions(), and filterRegionProximity().


|
protected |
Keep region with the most cuts (after region split).
Definition at line 112 of file distanceSurfaceFilter.C.
References UPstream::broadcast, PackedList< Width >::clearStorage(), filterPrepareRegionSplit(), Foam::findMax(), Foam::flatOutput(), forAll, Foam::Info, Pstream::listGather(), UPstream::master(), Foam::nl, regionSplit::nRegions(), bitSet::set(), UList< T >::size(), Foam::sum(), bitSet::test(), UList< T >::test(), and Foam::Zero.
Referenced by createGeometry().


|
protected |
Keep region(s) closest to the nearest points.
Definition at line 179 of file distanceSurfaceFilter.C.
References UPstream::broadcast, PackedList< Width >::clearStorage(), Foam::endl(), filterPrepareRegionSplit(), Foam::findMax(), Foam::flatOutput(), forAll, Foam::Info, Pstream::listCombineGather(), Pstream::listGather(), Foam::magSqr(), UPstream::master(), Foam::nl, regionSplit::nRegions(), bitSet::set(), UList< T >::size(), Foam::sqrt(), Foam::sum(), bitSet::test(), UList< T >::test(), WarningInFunction, and Foam::Zero.
Referenced by createGeometry().


|
protected |
Remove region(s) that have far faces.
Definition at line 303 of file distanceSurfaceFilter.C.
References UPstream::broadcast, PackedList< Width >::clearStorage(), Foam::ListOps::create(), Foam::ListOps::createWithValue(), Foam::faceMap(), filterPrepareRegionSplit(), searchableSurface::findNearest(), forAll, Foam::Info, Pstream::listGather(), UPstream::master(), Foam::nl, bitSet::none(), regionSplit::nRegions(), outputName(), PackedList< Width >::reset(), Foam::returnReduceAnd(), bitSet::set(), UList< T >::size(), surfaceName(), writer(), and Foam::Zero.
Referenced by createGeometry().


|
protected |
Adjust extracted iso-surface to remove far faces.
Definition at line 460 of file distanceSurfaceFilter.C.
References Foam::ListOps::createWithValue(), Foam::diff(), Foam::faceMap(), searchableSurface::findNearest(), forAll, searchableSurface::getNormal(), Foam::Info, Foam::mag(), Foam::nl, outputName(), Foam::Pout, List< T >::resize(), bitSet::set(), UList< T >::size(), surfaceName(), and writer().
Referenced by createGeometry().


| TypeName | ( | "distanceSurface" | ) |
Runtime type information.
References dict, distance(), mesh, surface(), and surfaceName().

| void createGeometry | ( | ) |
Create/recreate the distance surface.
Definition at line 398 of file distanceSurface.C.
References isoSurfaceParams::ALGO_POINT, GeometricField< Type, PatchField, GeoMesh >::boundaryField(), fvMesh::C(), Foam::calcNormalDistance_filtered(), Foam::calcNormalDistance_nonzero(), Foam::calcNormalDistance_zero(), Foam::checkAllHits(), PackedList< Width >::clearStorage(), Foam::dimLength, Foam::endl(), filterFaceProximity(), filterKeepLargestRegion(), filterKeepNearestRegions(), filterRegionProximity(), searchableSurface::findNearest(), fld(), forAll, searchableSurface::getNormal(), isoSurfaceBase::New(), MeshObject< polyMesh, UpdateableMeshObject, pointMesh >::New(), IOobjectOption::NO_READ, IOobjectOption::NO_REGISTER, IOobjectOption::NO_WRITE, bitSet::none(), primitiveMesh::nPoints(), IOobject::objectPath(), polyMesh::points(), Foam::Pout, GeometricField< Type, PatchField, GeoMesh >::primitiveFieldRef(), print(), pts, refineBlockedCells(), primitiveMesh::reset(), PackedList< Width >::resize(), Foam::simpleGeometricFilter(), UList< T >::size(), fvMesh::time(), Time::timeName(), regIOobject::write(), and Foam::Zero.
Referenced by sampledDistanceSurface::update().


|
inline |
The name of the underlying searchableSurface.
Definition at line 473 of file distanceSurface.H.
Referenced by distanceSurface(), distanceSurface(), filterFaceProximity(), filterRegionProximity(), print(), and TypeName().

|
inlinenoexcept |
The distance to the underlying searchableSurface.
Definition at line 481 of file distanceSurface.H.
References Foam::noexcept.
Referenced by distanceSurface(), distanceSurface(), sampledDistanceSurface::sampledDistanceSurface(), TypeName(), and sampledDistanceSurface::TypeName().

|
inline |
The underlying surface.
Definition at line 489 of file distanceSurface.H.
Referenced by sampledDistanceSurface::Cf(), distanceSurface(), sampledDistanceSurface::faces(), sampledDistanceSurface::magSf(), sampledDistanceSurface::points(), print(), sampledDistanceSurface::sampledDistanceSurface(), sampledDistanceSurface::Sf(), TypeName(), and sampledDistanceSurface::TypeName().

|
inline |
The underlying surface.
Definition at line 501 of file distanceSurface.H.
|
inline |
For each face, the original cell in mesh.
Definition at line 513 of file distanceSurface.H.
Referenced by sampledDistanceSurface::sampleOnFaces(), and sampledDistanceSurface::sampleOnPoints().

|
inline |
For each face, the original cell in mesh.
Definition at line 525 of file distanceSurface.H.
| void print | ( | Ostream & | os, |
| int | level = 0 ) const |
Print information.
Definition at line 747 of file distanceSurface.C.
References Foam::distance(), os(), surface(), and surfaceName().
Referenced by createGeometry(), and sampledDistanceSurface::print().

