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...
Public Member Functions | |
TypeName ("distanceSurface") | |
Runtime type information. More... | |
distanceSurface (const word &defaultSurfaceName, const polyMesh &mesh, const dictionary &dict) | |
Construct from dictionary. More... | |
distanceSurface (const polyMesh &mesh, const word &surfaceType, const word &surfaceName, const isoSurfaceParams ¶ms=isoSurfaceParams(), const bool interpolate=false) | |
Construct from components with zero-distanced. More... | |
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. More... | |
distanceSurface (const polyMesh &mesh, const bool interpolate, autoPtr< searchableSurface > &&surface, const scalar distance, const bool useSignedDistance, const isoSurfaceParams ¶ms=isoSurfaceParams()) | |
virtual | ~distanceSurface ()=default |
Destructor. More... | |
void | createGeometry () |
Create/recreate the distance surface. More... | |
const word & | surfaceName () const |
The name of the underlying searchableSurface. More... | |
scalar | distance () const noexcept |
The distance to the underlying searchableSurface. More... | |
const meshedSurface & | surface () const |
The underlying surface. More... | |
meshedSurface & | surface () |
The underlying surface. More... | |
const labelList & | meshCells () const |
For each face, the original cell in mesh. More... | |
labelList & | meshCells () |
For each face, the original cell in mesh. More... | |
void | print (Ostream &os, int level=0) const |
Print information. More... | |
Protected Member Functions | |
bool | hasIsoSurface () const |
Is currently backed by an isoSurfacePtr_. More... | |
template<class Type > | |
tmp< Field< Type > > | isoSurfaceInterpolate (const GeometricField< Type, fvPatchField, volMesh > &cellValues, const Field< Type > &pointValues) const |
Interpolate volume field onto surface points. More... | |
bool | refineBlockedCells (bitSet &ignoreCells, const isoSurfaceBase &isoContext) const |
Re-filter the blocked cells based on the anticipated cuts. More... | |
bitSet | filterPrepareRegionSplit (const bitSet &ignoreCells) const |
Prepare blockedFaces for region split. More... | |
void | filterKeepLargestRegion (bitSet &ignoreCells) const |
Keep region with the most cuts (after region split) More... | |
void | filterKeepNearestRegions (bitSet &ignoreCells) const |
Keep region(s) closest to the nearest points. More... | |
void | filterRegionProximity (bitSet &ignoreCells) const |
Remove region(s) that have far faces. More... | |
void | filterFaceProximity () |
Adjust extracted iso-surface to remove far faces. More... | |
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 209 of file distanceSurface.H.
distanceSurface | ( | const word & | defaultSurfaceName, |
const polyMesh & | mesh, | ||
const dictionary & | dict | ||
) |
Construct from dictionary.
Definition at line 250 of file distanceSurface.C.
References dict, and Foam::sqr().
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 320 of file distanceSurface.C.
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 342 of file distanceSurface.C.
distanceSurface | ( | const polyMesh & | mesh, |
const bool | interpolate, | ||
autoPtr< searchableSurface > && | surface, | ||
const scalar | distance, | ||
const bool | useSignedDistance, | ||
const isoSurfaceParams & | params = isoSurfaceParams() |
||
) |
Definition at line 378 of file distanceSurface.C.
|
virtualdefault |
Destructor.
|
inlineprotected |
Is currently backed by an isoSurfacePtr_.
Definition at line 302 of file distanceSurface.H.
References bool.
|
inlineprotected |
Interpolate volume field onto surface points.
Definition at line 310 of file distanceSurface.H.
|
protected |
Re-filter the blocked cells based on the anticipated cuts.
Uses a lightweight variant of cutting.
Definition at line 37 of file distanceSurfaceFilter.C.
References isoSurfaceBase::getCellCutType(), bitSet::set(), and bitSet::test().
Referenced by distanceSurface::createGeometry().
|
protected |
Prepare blockedFaces for region split.
Definition at line 69 of file distanceSurfaceFilter.C.
References forAll, Foam::foamVersion::patch, List< T >::set(), and bitSet::test().
|
protected |
Keep region with the most cuts (after region split)
Definition at line 120 of file distanceSurfaceFilter.C.
References PackedList< Width >::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().
|
protected |
Keep region(s) closest to the nearest points.
Definition at line 187 of file distanceSurfaceFilter.C.
References PackedList< Width >::clearStorage(), Foam::expressions::patchExpr::debug, Foam::endl(), Foam::findMax(), Foam::flatOutput(), forAll, Foam::Info, Foam::magSqr(), Foam::nl, regionSplit::nRegions(), bitSet::set(), Foam::sqrt(), Foam::sum(), bitSet::test(), WarningInFunction, and Foam::Zero.
Referenced by distanceSurface::createGeometry().
|
protected |
Remove region(s) that have far faces.
Definition at line 311 of file distanceSurfaceFilter.C.
References PackedList< Width >::clearStorage(), Foam::expressions::patchExpr::debug, Foam::faceMap(), searchableSurface::findNearest(), forAll, Foam::Info, Foam::nl, regionSplit::nRegions(), outputName(), Foam::returnReduce(), List< T >::set(), MeshedSurface< Face >::transfer(), writer< Type >::write(), writer(), and Foam::Zero.
Referenced by distanceSurface::createGeometry().
|
protected |
Adjust extracted iso-surface to remove far faces.
Definition at line 467 of file distanceSurfaceFilter.C.
References Foam::expressions::patchExpr::debug, Foam::diff(), Foam::faceMap(), searchableSurface::findNearest(), forAll, searchableSurface::getNormal(), Foam::Info, Foam::mag(), Foam::nl, outputName(), Foam::Pout, MeshedSurface< Face >::size(), MeshedSurface< Face >::subsetMesh(), distanceSurface::surfaceName(), MeshedSurface< Face >::transfer(), writer< Type >::write(), and writer().
Referenced by distanceSurface::createGeometry().
TypeName | ( | "distanceSurface" | ) |
Runtime type information.
void createGeometry | ( | ) |
Create/recreate the distance surface.
Definition at line 413 of file distanceSurface.C.
References isoSurfaceParams::ALGO_POINT, isoSurfaceParams::algorithm(), GeometricField< Type, PatchField, GeoMesh >::boundaryField(), fvMesh::C(), Foam::calcNormalDistance_filtered(), Foam::calcNormalDistance_nonzero(), Foam::calcNormalDistance_zero(), Foam::checkAllHits(), List< T >::clear(), MeshedSurface< Face >::clear(), PackedList< Width >::clearStorage(), Foam::expressions::patchExpr::debug, Foam::dimLength, Foam::endl(), distanceSurface::filterFaceProximity(), distanceSurface::filterKeepLargestRegion(), distanceSurface::filterKeepNearestRegions(), distanceSurface::filterRegionProximity(), searchableSurface::findNearest(), fld, forAll, searchableSurface::getNormal(), MeshObject< polyMesh, UpdateableMeshObject, pointMesh >::New(), isoSurfaceBase::New(), IOobject::NO_READ, IOobject::NO_WRITE, bitSet::none(), primitiveMesh::nPoints(), polyMesh::points(), Foam::Pout, GeometricField< Type, PatchField, GeoMesh >::primitiveFieldRef(), distanceSurface::print(), distanceSurface::refineBlockedCells(), fvMesh::time(), Time::timeName(), List< T >::transfer(), MeshedSurface< Face >::transfer(), Ostream::write(), and Foam::Zero.
Referenced by sampledDistanceSurface::update().
|
inline |
The name of the underlying searchableSurface.
Definition at line 409 of file distanceSurface.H.
Referenced by distanceSurface::filterFaceProximity().
|
inlinenoexcept |
The distance to the underlying searchableSurface.
Definition at line 415 of file distanceSurface.H.
|
inline |
The underlying surface.
Definition at line 421 of file distanceSurface.H.
Referenced by sampledDistanceSurface::Cf(), sampledDistanceSurface::faces(), sampledDistanceSurface::magSf(), sampledDistanceSurface::points(), and sampledDistanceSurface::Sf().
|
inline |
The underlying surface.
Definition at line 431 of file distanceSurface.H.
|
inline |
For each face, the original cell in mesh.
Definition at line 441 of file distanceSurface.H.
|
inline |
For each face, the original cell in mesh.
Definition at line 451 of file distanceSurface.H.
void print | ( | Ostream & | os, |
int | level = 0 |
||
) | const |
Print information.
Definition at line 762 of file distanceSurface.C.
References Foam::distance(), and os().
Referenced by distanceSurface::createGeometry(), and sampledDistanceSurface::print().