Loading...
Searching...
No Matches
refinementSurfaces Class Reference

Container for data on surfaces used for surface-driven refinement. Contains all the data about the level of refinement needed per surface. More...

#include <refinementSurfaces.H>

Public Member Functions

 refinementSurfaces (const searchableSurfaces &allGeometry, const dictionary &, const label gapLevelIncrement, const bool dryRun)
 Construct from surfaces and dictionary.
 refinementSurfaces (const searchableSurfaces &allGeometry, const labelList &surfaces, const wordList &names, const PtrList< surfaceZonesInfo > &surfZones, const labelList &regionOffset, const labelList &minLevel, const labelList &maxLevel, const labelList &gapLevel, const scalarField &perpendicularAngle, PtrList< dictionary > &patchInfo, const bool dryRun)
 Construct from components.
const searchableSurfacesgeometry () const
const labelListsurfaces () const
const wordListnames () const
 Names of surfaces.
const PtrList< surfaceZonesInfo > & surfZones () const
const labelListregionOffset () const
 From surface to starting global region.
const labelListminLevel () const
 From global region number to refinement level.
const labelListmaxLevel () const
 From global region number to refinement level.
const labelListgapLevel () const
 From global region number to small gap refinement level.
const labelListblockLevel () const
 From global region number to cell level at which blockage detection is applied.
const labelListleakLevel () const
 From global region number to cell level at which leakage detection is applied. labelMax if not set.
const List< FixedList< label, 3 > > & extendedGapLevel () const
 From global region number to specification of gap and its.
const List< volumeType > & extendedGapMode () const
 From global region number to side of surface to detect.
const boolListgapSelf () const
 From global region number to whether to detect gaps to same.
const List< FixedList< label, 4 > > & extendedCurvatureLevel () const
 From global region number to specification of curvature.
const scalarFieldperpendicularAngle () const
 From global region number to perpendicular angle.
const PtrList< dictionary > & patchInfo () const
 From global region number to patch type.
const boolListaddBufferLayers () const
 From global region number to whether to add buffer layers.
label globalRegion (const label surfI, const label regionI) const
 From surface and region on surface to global region.
labelPair whichSurface (const label globalRegionI) const
 From global region to surface + region.
label minLevel (const label surfI, const label regionI) const
 Min level for surface and region on surface.
label maxLevel (const label surfI, const label regionI) const
 Max level for surface and region on surface.
label nRegions () const
labelList maxGapLevel () const
 Per surface the maximum extendedGapLevel over all its regions.
labelList maxCurvatureLevel () const
 Per surface the maximum curvatureLevel over all its regions.
void setMinLevelFields (const shellSurfaces &shells)
 Calculate minLevelFields according to both surface- and.
void setCurvatureMinLevelFields (const scalar cosAngle, const scalar level0EdgeLength)
 Update minLevelFields according to (triSurface-only) curvature.
void findHigherIntersection (const shellSurfaces &shells, const pointField &start, const pointField &end, const labelList &currentLevel, labelList &surfaces, labelList &surfaceLevel) const
 Find intersection of edge. Return -1 or first surface.
void findAllIntersections (const pointField &start, const pointField &end, const labelList &currentLevel, const labelList &globalMinLevel, const labelList &globalMaxLevel, List< vectorList > &surfaceNormal, labelListList &surfaceLevel) const
 Find all intersections of edge with any surface with applicable.
void findAllIntersections (const pointField &start, const pointField &end, const labelList &currentLevel, const labelList &globalMinLevel, const labelList &globalMaxLevel, List< pointList > &surfaceLocation, List< vectorList > &surfaceNormal, labelListList &surfaceLevel) const
 Find all intersections of edge with any surface with applicable.
void findNearestIntersection (const labelList &surfacesToTest, const pointField &start, const pointField &end, labelList &surface1, List< pointIndexHit > &hit1, labelList &region1, labelList &surface2, List< pointIndexHit > &hit2, labelList &region2) const
 Find intersection nearest to the endpoints. surface1,2 are.
void findNearestIntersection (const labelList &surfacesToTest, const pointField &start, const pointField &end, labelList &surface1, List< pointIndexHit > &hit1, labelList &region1, vectorField &normal1, labelList &surface2, List< pointIndexHit > &hit2, labelList &region2, vectorField &normal2) const
 findNearestIntersection but also get normals
void findNearestIntersection (const pointField &start, const pointField &end, labelList &surfaces, vectorField &normal) const
 Find nearest (to start only) intersection of edge.
void findNearestIntersection (const pointField &start, const pointField &end, labelList &surfaces, labelList &regions, List< pointIndexHit > &, vectorField &normal) const
 Find nearest (to start only) intersection of edge.
void findNearestIntersection (const pointField &start, const pointField &end, labelList &surfaces, List< pointIndexHit > &, vectorField &normal) const
 Find nearest (to start only) intersection of edge.
void findAnyIntersection (const pointField &start, const pointField &end, labelList &surfaces, List< pointIndexHit > &) const
 Used for debugging only: find intersection of edge.
void findNearest (const labelList &surfacesToTest, const pointField &samples, const scalarField &nearestDistSqr, labelList &surfaces, List< pointIndexHit > &) const
 Find nearest point on surfaces.
void findNearestRegion (const labelList &surfacesToTest, const pointField &samples, const scalarField &nearestDistSqr, labelList &hitSurface, labelList &hitRegion) const
 Find nearest point on surfaces. Return surface and region on.
void findNearestRegion (const labelList &surfacesToTest, const pointField &samples, const scalarField &nearestDistSqr, labelList &hitSurface, List< pointIndexHit > &hitInfo, labelList &hitRegion, vectorField &hitNormal) const
 Find nearest point on surfaces. Return surface, region and.
void findInside (const labelList &surfacesToTest, const pointField &pt, labelList &insideSurfaces) const
 Detect if a point is 'inside' (closed) surfaces.
void findNearest (const labelList &surfacesToTest, const labelListList &regions, const pointField &samples, const scalarField &nearestDistSqr, labelList &hitSurface, List< pointIndexHit > &hitInfo) const
 Find nearest point on selected regions of surfaces.
void findNearestRegion (const labelList &surfacesToTest, const labelListList &regions, const pointField &samples, const scalarField &nearestDistSqr, labelList &hitSurface, List< pointIndexHit > &hitInfo, labelList &hitRegion, vectorField &hitNormal) const
 Find nearest point on selected regions of surfaces.

Detailed Description

Container for data on surfaces used for surface-driven refinement. Contains all the data about the level of refinement needed per surface.

Source files

Definition at line 59 of file refinementSurfaces.H.

Constructor & Destructor Documentation

◆ refinementSurfaces() [1/2]

◆ refinementSurfaces() [2/2]

refinementSurfaces ( const searchableSurfaces & allGeometry,
const labelList & surfaces,
const wordList & names,
const PtrList< surfaceZonesInfo > & surfZones,
const labelList & regionOffset,
const labelList & minLevel,
const labelList & maxLevel,
const labelList & gapLevel,
const scalarField & perpendicularAngle,
PtrList< dictionary > & patchInfo,
const bool dryRun )

Construct from components.

Definition at line 670 of file refinementSurfaces.C.

References forAll, gapLevel(), maxLevel(), minLevel(), names(), patchInfo(), perpendicularAngle(), regionOffset(), surfaces(), and surfZones().

Here is the call graph for this function:

Member Function Documentation

◆ geometry()

const searchableSurfaces & geometry ( ) const
inline

Definition at line 238 of file refinementSurfaces.H.

Referenced by snappySnapDriver::calcNearestSurface().

Here is the caller graph for this function:

◆ surfaces()

const labelList & surfaces ( ) const
inline

◆ names()

const wordList & names ( ) const
inline

Names of surfaces.

Definition at line 251 of file refinementSurfaces.H.

Referenced by refinementSurfaces().

Here is the caller graph for this function:

◆ surfZones()

const PtrList< surfaceZonesInfo > & surfZones ( ) const
inline

◆ regionOffset()

const labelList & regionOffset ( ) const
inline

From surface to starting global region.

Definition at line 264 of file refinementSurfaces.H.

Referenced by refinementSurfaces().

Here is the caller graph for this function:

◆ minLevel() [1/2]

const labelList & minLevel ( ) const
inline

From global region number to refinement level.

Definition at line 272 of file refinementSurfaces.H.

Referenced by findHigherIntersection(), refinementSurfaces(), setCurvatureMinLevelFields(), and setMinLevelFields().

Here is the caller graph for this function:

◆ maxLevel() [1/2]

const labelList & maxLevel ( ) const
inline

From global region number to refinement level.

Definition at line 280 of file refinementSurfaces.H.

Referenced by refinementSurfaces().

Here is the caller graph for this function:

◆ gapLevel()

const labelList & gapLevel ( ) const
inline

From global region number to small gap refinement level.

Definition at line 288 of file refinementSurfaces.H.

Referenced by refinementSurfaces().

Here is the caller graph for this function:

◆ blockLevel()

const labelList & blockLevel ( ) const
inline

From global region number to cell level at which blockage detection is applied.

Definition at line 297 of file refinementSurfaces.H.

◆ leakLevel()

const labelList & leakLevel ( ) const
inline

From global region number to cell level at which leakage detection is applied. labelMax if not set.

Definition at line 306 of file refinementSurfaces.H.

◆ extendedGapLevel()

const List< FixedList< label, 3 > > & extendedGapLevel ( ) const
inline

From global region number to specification of gap and its.

refinement: 3 labels specifying

  • minimum wanted number of cells in the gap
  • minimum cell level when to start trying to detect gaps
  • maximum cell level to refine to (so do not detect gaps if cell >= maximum level)

Definition at line 320 of file refinementSurfaces.H.

◆ extendedGapMode()

const List< volumeType > & extendedGapMode ( ) const
inline

From global region number to side of surface to detect.

Definition at line 328 of file refinementSurfaces.H.

◆ gapSelf()

const boolList & gapSelf ( ) const
inline

From global region number to whether to detect gaps to same.

surface (in gap refinement)

Definition at line 338 of file refinementSurfaces.H.

◆ extendedCurvatureLevel()

const List< FixedList< label, 4 > > & extendedCurvatureLevel ( ) const
inline

From global region number to specification of curvature.

refinement: 4 labels specifying

  • minimum wanted number of cells in the curvature radius
  • ?minimum cell level when to start trying to detect gaps
  • maximum cell level to refine to (so do not detect curvature if celllevel >= maximum level)
  • minimum radius to ignore (expressed as refinement level). This can be used to ignore feature-edges. Set to -1 to ignore.

Definition at line 354 of file refinementSurfaces.H.

◆ perpendicularAngle()

const scalarField & perpendicularAngle ( ) const
inline

From global region number to perpendicular angle.

Definition at line 362 of file refinementSurfaces.H.

Referenced by refinementSurfaces().

Here is the caller graph for this function:

◆ patchInfo()

const PtrList< dictionary > & patchInfo ( ) const
inline

From global region number to patch type.

Definition at line 370 of file refinementSurfaces.H.

Referenced by refinementSurfaces().

Here is the caller graph for this function:

◆ addBufferLayers()

const boolList & addBufferLayers ( ) const
inline

From global region number to whether to add buffer layers.

when snapping

Definition at line 380 of file refinementSurfaces.H.

◆ globalRegion()

label globalRegion ( const label surfI,
const label regionI ) const
inline

From surface and region on surface to global region.

Definition at line 391 of file refinementSurfaces.H.

Referenced by snappySnapDriver::calcNearestSurface(), findAllIntersections(), findAllIntersections(), maxCurvatureLevel(), maxGapLevel(), maxLevel(), minLevel(), snappySnapDriver::repatchToSurface(), and setCurvatureMinLevelFields().

Here is the caller graph for this function:

◆ whichSurface()

Foam::labelPair whichSurface ( const label globalRegionI) const

From global region to surface + region.

Definition at line 710 of file refinementSurfaces.C.

◆ minLevel() [2/2]

label minLevel ( const label surfI,
const label regionI ) const
inline

Min level for surface and region on surface.

Definition at line 404 of file refinementSurfaces.H.

References globalRegion().

Here is the call graph for this function:

◆ maxLevel() [2/2]

label maxLevel ( const label surfI,
const label regionI ) const
inline

Max level for surface and region on surface.

Definition at line 412 of file refinementSurfaces.H.

References globalRegion().

Here is the call graph for this function:

◆ nRegions()

label nRegions ( ) const
inline

Definition at line 417 of file refinementSurfaces.H.

Referenced by refinementSurfaces().

Here is the caller graph for this function:

◆ maxGapLevel()

Foam::labelList maxGapLevel ( ) const

Per surface the maximum extendedGapLevel over all its regions.

Definition at line 776 of file refinementSurfaces.C.

References forAll, globalRegion(), Foam::max(), regionNames, and Foam::Zero.

Here is the call graph for this function:

◆ maxCurvatureLevel()

Foam::labelList maxCurvatureLevel ( ) const

Per surface the maximum curvatureLevel over all its regions.

Definition at line 795 of file refinementSurfaces.C.

References forAll, globalRegion(), Foam::max(), regionNames, and Foam::Zero.

Referenced by setCurvatureMinLevelFields().

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

◆ setMinLevelFields()

◆ setCurvatureMinLevelFields()

void setCurvatureMinLevelFields ( const scalar cosAngle,
const scalar level0EdgeLength )

Update minLevelFields according to (triSurface-only) curvature.

?If locally have a cached field override the

surface-based level ignore any curvature? if (minLevelField[i] > surfMin[i]) { // Ignore curvature } else if (surfMin[i] == surfMax[i]) { // Ignore curvature. Bypass calculation below. } else

Definition at line 951 of file refinementSurfaces.C.

References searchableSurface::boundingSpheres(), triSurfaceTools::curvatures(), f(), searchableSurface::findNearest(), forAll, searchableSurface::getField(), searchableSurface::getRegion(), globalRegion(), Foam::isA(), Foam::max(), maxCurvatureLevel(), Foam::min(), minLevel(), points, bitSet::set(), setField(), UList< T >::size(), and Foam::Zero.

Here is the call graph for this function:

◆ findHigherIntersection()

void findHigherIntersection ( const shellSurfaces & shells,
const pointField & start,
const pointField & end,
const labelList & currentLevel,
labelList & surfaces,
labelList & surfaceLevel ) const

Find intersection of edge. Return -1 or first surface.

with higher (than currentLevel) minlevel. Return surface number and level.

Definition at line 1261 of file refinementSurfaces.C.

References searchableSurface::findLineAny(), forAll, searchableSurface::getRegion(), Foam::identity(), minLevel(), p0, Foam::returnReduceAnd(), List< T >::setSize(), UList< T >::size(), and surfaces().

Here is the call graph for this function:

◆ findAllIntersections() [1/2]

void findAllIntersections ( const pointField & start,
const pointField & end,
const labelList & currentLevel,
const labelList & globalMinLevel,
const labelList & globalMaxLevel,
List< vectorList > & surfaceNormal,
labelListList & surfaceLevel ) const

Find all intersections of edge with any surface with applicable.

min/max refinement level. Unsorted order.

Definition at line 1423 of file refinementSurfaces.C.

References List< T >::clear(), forAll, globalRegion(), n, List< T >::setSize(), and UList< T >::size().

Here is the call graph for this function:

◆ findAllIntersections() [2/2]

void findAllIntersections ( const pointField & start,
const pointField & end,
const labelList & currentLevel,
const labelList & globalMinLevel,
const labelList & globalMaxLevel,
List< pointList > & surfaceLocation,
List< vectorList > & surfaceNormal,
labelListList & surfaceLevel ) const

Find all intersections of edge with any surface with applicable.

min/max refinement level. Unsorted order.

Definition at line 1514 of file refinementSurfaces.C.

References forAll, globalRegion(), n, List< T >::setSize(), and UList< T >::size().

Here is the call graph for this function:

◆ findNearestIntersection() [1/5]

void findNearestIntersection ( const labelList & surfacesToTest,
const pointField & start,
const pointField & end,
labelList & surface1,
List< pointIndexHit > & hit1,
labelList & region1,
labelList & surface2,
List< pointIndexHit > & hit2,
labelList & region2 ) const

Find intersection nearest to the endpoints. surface1,2 are.

not indices into surfacesToTest but refinement surface indices. Returns surface, region on surface (so not global surface) and position on surface.

Definition at line 1691 of file refinementSurfaces.C.

References forAll, List< T >::setSize(), and UList< T >::size().

Referenced by snappySnapDriver::detectNearSurfaces().

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

◆ findNearestIntersection() [2/5]

void findNearestIntersection ( const labelList & surfacesToTest,
const pointField & start,
const pointField & end,
labelList & surface1,
List< pointIndexHit > & hit1,
labelList & region1,
vectorField & normal1,
labelList & surface2,
List< pointIndexHit > & hit2,
labelList & region2,
vectorField & normal2 ) const

findNearestIntersection but also get normals

Definition at line 1821 of file refinementSurfaces.C.

References searchableSurface::findLine(), forAll, searchableSurface::getNormal(), searchableSurface::getRegion(), List< T >::setSize(), UList< T >::size(), and Foam::Zero.

Here is the call graph for this function:

◆ findNearestIntersection() [3/5]

void findNearestIntersection ( const pointField & start,
const pointField & end,
labelList & surfaces,
vectorField & normal ) const

Find nearest (to start only) intersection of edge.

Definition at line 1944 of file refinementSurfaces.C.

References searchableSurface::findLine(), forAll, searchableSurface::getNormal(), List< T >::setSize(), UList< T >::size(), and Foam::Zero.

Here is the call graph for this function:

◆ findNearestIntersection() [4/5]

void findNearestIntersection ( const pointField & start,
const pointField & end,
labelList & surfaces,
labelList & regions,
List< pointIndexHit > & hitInfo1,
vectorField & normal ) const

Find nearest (to start only) intersection of edge.

Definition at line 1987 of file refinementSurfaces.C.

References searchableSurface::findLine(), forAll, searchableSurface::getNormal(), searchableSurface::getRegion(), List< T >::setSize(), UList< T >::size(), and Foam::Zero.

Here is the call graph for this function:

◆ findNearestIntersection() [5/5]

void findNearestIntersection ( const pointField & start,
const pointField & end,
labelList & surfaces,
List< pointIndexHit > & hitInfo1,
vectorField & normal ) const

Find nearest (to start only) intersection of edge.

Definition at line 2040 of file refinementSurfaces.C.

References searchableSurface::findLine(), forAll, searchableSurface::getNormal(), List< T >::setSize(), UList< T >::size(), and Foam::Zero.

Here is the call graph for this function:

◆ findAnyIntersection()

void findAnyIntersection ( const pointField & start,
const pointField & end,
labelList & surfaces,
List< pointIndexHit > & hitInfo ) const

Used for debugging only: find intersection of edge.

Definition at line 2090 of file refinementSurfaces.C.

References searchableSurfacesQueries::findAnyIntersection().

Here is the call graph for this function:

◆ findNearest() [1/2]

void findNearest ( const labelList & surfacesToTest,
const pointField & samples,
const scalarField & nearestDistSqr,
labelList & surfaces,
List< pointIndexHit > & hitInfo ) const

Find nearest point on surfaces.

Definition at line 2111 of file refinementSurfaces.C.

References searchableSurfacesQueries::findNearest(), forAll, and samples().

Referenced by snappySnapDriver::calcNearestSurface().

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

◆ findNearestRegion() [1/3]

void findNearestRegion ( const labelList & surfacesToTest,
const pointField & samples,
const scalarField & nearestDistSqr,
labelList & hitSurface,
labelList & hitRegion ) const

Find nearest point on surfaces. Return surface and region on.

surface (so not global surface)

Definition at line 2144 of file refinementSurfaces.C.

References Foam::findIndices(), searchableSurfacesQueries::findNearest(), forAll, samples(), List< T >::setSize(), and UList< T >::size().

Referenced by snappySnapDriver::calcNearestSurface(), and snappySnapDriver::repatchToSurface().

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

◆ findNearestRegion() [2/3]

void findNearestRegion ( const labelList & surfacesToTest,
const pointField & samples,
const scalarField & nearestDistSqr,
labelList & hitSurface,
List< pointIndexHit > & hitInfo,
labelList & hitRegion,
vectorField & hitNormal ) const

Find nearest point on surfaces. Return surface, region and.

normal on surface (so not global surface)

Definition at line 2207 of file refinementSurfaces.C.

References Foam::findIndices(), searchableSurfacesQueries::findNearest(), forAll, samples(), List< T >::setSize(), UList< T >::size(), and Foam::Zero.

Here is the call graph for this function:

◆ findInside()

void findInside ( const labelList & surfacesToTest,
const pointField & pt,
labelList & insideSurfaces ) const

Detect if a point is 'inside' (closed) surfaces.

Returns -1 if not, returns first surface it is.

Definition at line 2328 of file refinementSurfaces.C.

References surfaceZonesInfo::areaSelectionAlgoNames, Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, surfaceZonesInfo::INSIDE, volumeType::INSIDE, surfaceZonesInfo::OUTSIDE, volumeType::OUTSIDE, List< T >::setSize(), and UList< T >::size().

Here is the call graph for this function:

◆ findNearest() [2/2]

void findNearest ( const labelList & surfacesToTest,
const labelListList & regions,
const pointField & samples,
const scalarField & nearestDistSqr,
labelList & hitSurface,
List< pointIndexHit > & hitInfo ) const

Find nearest point on selected regions of surfaces.

Definition at line 2391 of file refinementSurfaces.C.

References searchableSurfacesQueries::findNearest(), forAll, and samples().

Here is the call graph for this function:

◆ findNearestRegion() [3/3]

void findNearestRegion ( const labelList & surfacesToTest,
const labelListList & regions,
const pointField & samples,
const scalarField & nearestDistSqr,
labelList & hitSurface,
List< pointIndexHit > & hitInfo,
labelList & hitRegion,
vectorField & hitNormal ) const

Find nearest point on selected regions of surfaces.

Definition at line 2428 of file refinementSurfaces.C.

References Foam::findIndices(), searchableSurfacesQueries::findNearest(), forAll, samples(), List< T >::setSize(), UList< T >::size(), and Foam::Zero.

Here is the call graph for this function:

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