Public Member Functions | Static Public Attributes | List of all members
meshSearch Class Reference

Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search. More...

Inheritance diagram for meshSearch:
Inheritance graph
[legend]

Public Member Functions

 ClassName ("meshSearch")
 
 meshSearch (const polyMesh &mesh, const polyMesh::cellDecomposition=polyMesh::CELL_TETS)
 Construct from components. Constructs bb slightly bigger than. More...
 
 meshSearch (const polyMesh &mesh, const treeBoundBox &bb, const polyMesh::cellDecomposition=polyMesh::CELL_TETS)
 Construct with a custom bounding box. Any mesh element outside. More...
 
 ~meshSearch ()
 Destructor. More...
 
const polyMeshmesh () const
 
polyMesh::cellDecomposition decompMode () const
 
const indexedOctree< treeDataFace > & boundaryTree () const
 Get (demand driven) reference to octree holding all. More...
 
const indexedOctree< treeDataCell > & cellTree () const
 Get (demand driven) reference to octree holding all cells. More...
 
label findNearestCell (const point &location, const label seedCelli=-1, const bool useTreeSearch=true) const
 Find nearest cell in terms of cell centre. More...
 
label findNearestFace (const point &location, const label seedFacei=-1, const bool useTreeSearch=true) const
 
label findCell (const point &location, const label seedCelli=-1, const bool useTreeSearch=true) const
 Find cell containing location. More...
 
label findNearestBoundaryFace (const point &location, const label seedFacei=-1, const bool useTreeSearch=true) const
 Find nearest boundary face. More...
 
pointIndexHit intersection (const point &pStart, const point &pEnd) const
 Find first intersection of boundary in segment [pStart, pEnd]. More...
 
List< pointIndexHitintersections (const point &pStart, const point &pEnd) const
 Find all intersections of boundary within segment pStart .. pEnd. More...
 
bool isInside (const point &) const
 Determine inside/outside status. More...
 
void clearOut ()
 Delete all storage. More...
 
void correct ()
 Correct for mesh geom/topo changes. More...
 

Static Public Attributes

static scalar tol_ = 1e-3
 Tolerance on linear dimensions. More...
 

Detailed Description

Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.

Source files

Definition at line 57 of file meshSearch.H.

Constructor & Destructor Documentation

◆ meshSearch() [1/2]

meshSearch ( const polyMesh mesh,
const polyMesh::cellDecomposition  cellDecompMode = polyMesh::CELL_TETS 
)

Construct from components. Constructs bb slightly bigger than.

mesh points bb.

Definition at line 491 of file meshSearch.C.

References polyMesh::CELL_TETS, polyMesh::FACE_DIAG_TRIS, and polyMesh::tetBasePtIs().

Here is the call graph for this function:

◆ meshSearch() [2/2]

meshSearch ( const polyMesh mesh,
const treeBoundBox bb,
const polyMesh::cellDecomposition  cellDecompMode = polyMesh::CELL_TETS 
)

Construct with a custom bounding box. Any mesh element outside.

bb will not be found. Up to user to make sure bb extends slightly beyond wanted elements.

Definition at line 511 of file meshSearch.C.

References polyMesh::CELL_TETS, polyMesh::FACE_DIAG_TRIS, and polyMesh::tetBasePtIs().

Here is the call graph for this function:

◆ ~meshSearch()

~meshSearch ( )

Destructor.

Definition at line 536 of file meshSearch.C.

Member Function Documentation

◆ ClassName()

ClassName ( "meshSearch"  )

◆ mesh()

const polyMesh& mesh ( ) const
inline

Definition at line 194 of file meshSearch.H.

◆ decompMode()

polyMesh::cellDecomposition decompMode ( ) const
inline

◆ boundaryTree()

const Foam::indexedOctree< Foam::treeDataFace > & boundaryTree ( ) const

Get (demand driven) reference to octree holding all.

boundary faces

Definition at line 545 of file meshSearch.C.

References Foam::e, treeBoundBox::extend(), and forAll.

Referenced by meshSearch::decompMode().

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

◆ cellTree()

const Foam::indexedOctree< Foam::treeDataCell > & cellTree ( ) const

Get (demand driven) reference to octree holding all cells.

Definition at line 596 of file meshSearch.C.

References Foam::e, treeBoundBox::extend(), and meshSearch::findNearestCell().

Referenced by meshSearch::decompMode(), and nearestEqOp::operator()().

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

◆ findNearestCell()

Foam::label findNearestCell ( const point location,
const label  seedCelli = -1,
const bool  useTreeSearch = true 
) const

Find nearest cell in terms of cell centre.

Options:

  • use octree
  • use linear search
  • if seed is provided walk. (uses findNearestCellWalk; does not handle holes in domain)

Definition at line 640 of file meshSearch.C.

References meshSearch::findNearestFace().

Referenced by meshSearch::cellTree(), and meshSearch::decompMode().

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

◆ findNearestFace()

Foam::label findNearestFace ( const point location,
const label  seedFacei = -1,
const bool  useTreeSearch = true 
) const

Definition at line 665 of file meshSearch.C.

References meshSearch::findCell().

Referenced by meshSearch::decompMode(), meshSearch::findNearestCell(), and mappedPatchBase::findSamples().

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

◆ findCell()

Foam::label findCell ( const point location,
const label  seedCelli = -1,
const bool  useTreeSearch = true 
) const

Find cell containing location.

If seed provided walks and falls back to linear/tree search. (so handles holes correctly)s Returns -1 if not in domain.

Definition at line 690 of file meshSearch.C.

References meshSearch::findNearestBoundaryFace().

Referenced by lineFace::calcSamples(), meshSearch::decompMode(), and meshSearch::findNearestFace().

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

◆ findNearestBoundaryFace()

Foam::label findNearestBoundaryFace ( const point location,
const label  seedFacei = -1,
const bool  useTreeSearch = true 
) const

Find nearest boundary face.

If seed provided walks but then does not pass local minima in distance. Also does not jump from one connected region to the next.

Definition at line 716 of file meshSearch.C.

References indexedOctree< Type >::bb(), PointHit< Point >::distance(), treeDataFace::faceLabels(), PointIndexHit< Point >::hit(), PointIndexHit< Point >::index(), meshSearch::intersection(), Foam::magSqr(), boundBox::max(), boundBox::min(), Foam::minDist(), face::nearestPoint(), indexedOctree< Type >::shapes(), and Foam::sqr().

Referenced by meshSearch::decompMode(), and meshSearch::findCell().

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

◆ intersection()

Foam::pointIndexHit intersection ( const point pStart,
const point pEnd 
) const

Find first intersection of boundary in segment [pStart, pEnd].

(so inclusive of endpoints). Always octree for now

Definition at line 784 of file meshSearch.C.

References PointIndexHit< Point >::hit(), PointIndexHit< Point >::index(), meshSearch::intersections(), and PointIndexHit< Point >::setIndex().

Referenced by meshSearch::decompMode(), and meshSearch::findNearestBoundaryFace().

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

◆ intersections()

Foam::List< Foam::pointIndexHit > intersections ( const point pStart,
const point pEnd 
) const

Find all intersections of boundary within segment pStart .. pEnd.

Always octree for now

Definition at line 801 of file meshSearch.C.

References DynamicList< T, SizeInc, SizeMult, SizeDiv >::append(), PointIndexHit< Point >::hit(), PointIndexHit< Point >::hitPoint(), PointIndexHit< Point >::index(), Foam::mag(), DynamicList< T, SizeInc, SizeMult, SizeDiv >::shrink(), and Foam::sqrt().

Referenced by lineFace::calcSamples(), meshSearch::decompMode(), and meshSearch::intersection().

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

◆ isInside()

bool isInside ( const point p) const

Determine inside/outside status.

Definition at line 848 of file meshSearch.C.

References volumeType::INSIDE.

Referenced by meshSearch::decompMode().

Here is the caller graph for this function:

◆ clearOut()

void clearOut ( )

Delete all storage.

Definition at line 854 of file meshSearch.C.

Referenced by meshSearch::decompMode().

Here is the caller graph for this function:

◆ correct()

void correct ( )

Correct for mesh geom/topo changes.

Definition at line 862 of file meshSearch.C.

Referenced by meshSearch::decompMode().

Here is the caller graph for this function:

Member Data Documentation

◆ tol_

scalar tol_ = 1e-3
static

Tolerance on linear dimensions.

Definition at line 163 of file meshSearch.H.


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