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...

Public Member Functions

 refinementSurfaces (const searchableSurfaces &allGeometry, const dictionary &, const label gapLevelIncrement, const bool dryRun)
 Construct from surfaces and dictionary. More...
 
 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. More...
 
const searchableSurfaces & geometry () const
 
const labelList & surfaces () const
 
const wordList & names () const
 Names of surfaces. More...
 
const PtrList< surfaceZonesInfo > & surfZones () const
 
const labelList & regionOffset () const
 From surface to starting global region. More...
 
const labelList & minLevel () const
 From global region number to refinement level. More...
 
const labelList & maxLevel () const
 From global region number to refinement level. More...
 
const labelList & gapLevel () const
 From global region number to small gap refinement level. More...
 
const labelList & blockLevel () const
 
const List< FixedList< label, 3 > > & extendedGapLevel () const
 From global region number to specification of gap and its. More...
 
const List< volumeType > & extendedGapMode () const
 From global region number to side of surface to detect. More...
 
const boolList & gapSelf () const
 From global region number to whether to detect gaps to same. More...
 
const scalarField & perpendicularAngle () const
 From global region number to perpendicular angle. More...
 
const PtrList< dictionary > & patchInfo () const
 From global region number to patch type. More...
 
label globalRegion (const label surfI, const label regionI) const
 From surface and region on surface to global region. More...
 
labelPair whichSurface (const label globalRegionI) const
 From global region to surface + region. More...
 
label minLevel (const label surfI, const label regionI) const
 Min level for surface and region on surface. More...
 
label maxLevel (const label surfI, const label regionI) const
 Max level for surface and region on surface. More...
 
label nRegions () const
 
labelList maxGapLevel () const
 Per surface the maximum extendedGapLevel over all its regions. More...
 
void setMinLevelFields (const shellSurfaces &shells)
 Calculate minLevelFields. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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 More...
 
void findNearestIntersection (const pointField &start, const pointField &end, labelList &surfaces, vectorField &normal) const
 Find nearest (to start only) intersection of edge. More...
 
void findNearestIntersection (const pointField &start, const pointField &end, labelList &surfaces, List< pointIndexHit > &, vectorField &normal) const
 Find nearest (to start only) intersection of edge. More...
 
void findAnyIntersection (const pointField &start, const pointField &end, labelList &surfaces, List< pointIndexHit > &) const
 Used for debugging only: find intersection of edge. More...
 
void findNearest (const labelList &surfacesToTest, const pointField &samples, const scalarField &nearestDistSqr, labelList &surfaces, List< pointIndexHit > &) const
 Find nearest point on surfaces. More...
 
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. More...
 
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. More...
 
void findInside (const labelList &surfacesToTest, const pointField &pt, labelList &insideSurfaces) const
 Detect if a point is 'inside' (closed) surfaces. More...
 
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. More...
 
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. More...
 

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 63 of file refinementSurfaces.H.

Constructor & Destructor Documentation

◆ refinementSurfaces() [1/2]

refinementSurfaces ( const searchableSurfaces &  allGeometry,
const dictionary &  surfacesDict,
const label  gapLevelIncrement,
const bool  dryRun 
)

◆ 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 581 of file refinementSurfaces.C.

References forAll, and PtrList< T >::set().

Here is the call graph for this function:

Member Function Documentation

◆ geometry()

const searchableSurfaces& geometry ( ) const
inline

Definition at line 178 of file refinementSurfaces.H.

Referenced by snappySnapDriver::calcNearestSurface().

Here is the caller graph for this function:

◆ surfaces()

const labelList& surfaces ( ) const
inline

Definition at line 183 of file refinementSurfaces.H.

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

Here is the caller graph for this function:

◆ names()

const wordList& names ( ) const
inline

Names of surfaces.

Definition at line 189 of file refinementSurfaces.H.

◆ surfZones()

const PtrList<surfaceZonesInfo>& surfZones ( ) const
inline

Definition at line 194 of file refinementSurfaces.H.

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

Here is the caller graph for this function:

◆ regionOffset()

const labelList& regionOffset ( ) const
inline

From surface to starting global region.

Definition at line 200 of file refinementSurfaces.H.

◆ minLevel() [1/2]

const labelList& minLevel ( ) const
inline

From global region number to refinement level.

Definition at line 206 of file refinementSurfaces.H.

◆ maxLevel() [1/2]

const labelList& maxLevel ( ) const
inline

From global region number to refinement level.

Definition at line 212 of file refinementSurfaces.H.

◆ gapLevel()

const labelList& gapLevel ( ) const
inline

From global region number to small gap refinement level.

Definition at line 218 of file refinementSurfaces.H.

◆ blockLevel()

const labelList& blockLevel ( ) const
inline

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

Definition at line 225 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 236 of file refinementSurfaces.H.

◆ extendedGapMode()

const List<volumeType>& extendedGapMode ( ) const
inline

From global region number to side of surface to detect.

Definition at line 242 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 249 of file refinementSurfaces.H.

◆ perpendicularAngle()

const scalarField& perpendicularAngle ( ) const
inline

From global region number to perpendicular angle.

Definition at line 255 of file refinementSurfaces.H.

◆ patchInfo()

const PtrList<dictionary>& patchInfo ( ) const
inline

From global region number to patch type.

Definition at line 261 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 270 of file refinementSurfaces.H.

Referenced by snappySnapDriver::calcNearestSurface(), refinementSurfaces::maxLevel(), refinementSurfaces::minLevel(), and snappySnapDriver::repatchToSurface().

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 621 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 279 of file refinementSurfaces.H.

References refinementSurfaces::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 285 of file refinementSurfaces.H.

References refinementSurfaces::globalRegion().

Here is the call graph for this function:

◆ nRegions()

label nRegions ( ) const
inline

Definition at line 290 of file refinementSurfaces.H.

◆ maxGapLevel()

Foam::labelList maxGapLevel ( ) const

Per surface the maximum extendedGapLevel over all its regions.

Definition at line 686 of file refinementSurfaces.C.

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

Here is the call graph for this function:

◆ setMinLevelFields()

void setMinLevelFields ( const shellSurfaces &  shells)

Calculate minLevelFields.

Definition at line 707 of file refinementSurfaces.C.

References searchableSurface::boundingSpheres(), Foam::endl(), searchableSurface::findNearest(), forAll, searchableSurface::getRegion(), searchableSurface::globalSize(), Foam::Info, Foam::labelMax, Foam::max(), Foam::min(), IOobject::name(), points, PrimitivePatch< FaceList, PointField >::points(), Foam::returnReduce(), setField(), 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 840 of file refinementSurfaces.C.

References stdFoam::end(), searchableSurface::findLineAny(), forAll, searchableSurface::getRegion(), Foam::identity(), p0, Foam::returnReduce(), and List< T >::setSize().

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 1002 of file refinementSurfaces.C.

References List< T >::clear(), stdFoam::end(), searchableSurface::findLineAll(), forAll, searchableSurface::getNormal(), searchableSurface::getRegion(), n, and List< T >::setSize().

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 1095 of file refinementSurfaces.C.

References stdFoam::end(), searchableSurface::findLineAll(), forAll, searchableSurface::getNormal(), searchableSurface::getRegion(), n, and List< T >::setSize().

Here is the call graph for this function:

◆ findNearestIntersection() [1/4]

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 1192 of file refinementSurfaces.C.

References stdFoam::end(), searchableSurface::findLine(), forAll, searchableSurface::getRegion(), and List< T >::setSize().

Referenced by snappySnapDriver::detectNearSurfaces().

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

◆ findNearestIntersection() [2/4]

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 1322 of file refinementSurfaces.C.

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

Here is the call graph for this function:

◆ findNearestIntersection() [3/4]

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

Find nearest (to start only) intersection of edge.

Definition at line 1445 of file refinementSurfaces.C.

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

Here is the call graph for this function:

◆ findNearestIntersection() [4/4]

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 1488 of file refinementSurfaces.C.

References stdFoam::end(), searchableSurface::findLine(), forAll, searchableSurface::getNormal(), List< T >::setSize(), 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 1538 of file refinementSurfaces.C.

References stdFoam::end(), and 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 1559 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 1592 of file refinementSurfaces.C.

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

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 1655 of file refinementSurfaces.C.

References Foam::findIndices(), searchableSurfacesQueries::findNearest(), forAll, samples(), List< T >::setSize(), 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 1776 of file refinementSurfaces.C.

References surfaceZonesInfo::areaSelectionAlgoNames, Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, searchableSurface::getVolumeType(), searchableSurface::hasVolumeType(), surfaceZonesInfo::INSIDE, volumeType::INSIDE, IOobject::name(), surfaceZonesInfo::OUTSIDE, volumeType::OUTSIDE, and List< T >::setSize().

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 1839 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 1876 of file refinementSurfaces.C.

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

Here is the call graph for this function:

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