meshSearch Class Reference

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

Inheritance diagram for meshSearch:
[legend]

Public Member Functions

 ClassName ("meshSearch")
 Declare type-name (with debug switch) More...
 
 meshSearch (const polyMesh &mesh, const polyMesh::cellDecomposition=polyMesh::CELL_TETS)
 Construct from components. More...
 
 meshSearch (const polyMesh &mesh, const treeBoundBox &bb, const polyMesh::cellDecomposition=polyMesh::CELL_TETS)
 Construct with a custom bounding box. More...
 
 ~meshSearch ()
 Destructor. More...
 
const polyMeshmesh () const
 
polyMesh::cellDecomposition decompMode () const
 
const indexedOctree< treeDataFace > & boundaryTree () const
 Demand-driven reference to octree holding all boundary faces. More...
 
const indexedOctree< treeDataFace > & nonCoupledBoundaryTree () const
 
const indexedOctree< treeDataCell > & cellTree () const
 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 60 of file meshSearch.H.

Constructor & Destructor Documentation

◆ meshSearch() [1/2]

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

Construct from components.

Constructs bb slightly bigger than mesh points bb.

Definition at line 550 of file meshSearch.C.

References polyMesh::CELL_TETS, polyMesh::FACE_DIAG_TRIS, meshSearch::mesh(), 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 ensure bb extends slightly beyond wanted elements.

Definition at line 571 of file meshSearch.C.

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

Here is the call graph for this function:

◆ ~meshSearch()

~meshSearch ( )

Destructor.

Definition at line 597 of file meshSearch.C.

Member Function Documentation

◆ ClassName()

ClassName ( "meshSearch"  )

Declare type-name (with debug switch)

◆ mesh()

const polyMesh & mesh ( ) const
inline

Definition at line 195 of file meshSearch.H.

Referenced by meshSearch::meshSearch().

Here is the caller graph for this function:

◆ decompMode()

polyMesh::cellDecomposition decompMode ( ) const
inline

Definition at line 200 of file meshSearch.H.

◆ boundaryTree()

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

Demand-driven reference to octree holding all boundary faces.

Definition at line 628 of file meshSearch.C.

References Foam::identity().

Here is the call graph for this function:

◆ nonCoupledBoundaryTree()

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

Demand-driven reference to octree holding all non-coupled boundary faces

Definition at line 662 of file meshSearch.C.

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

Here is the call graph for this function:

◆ cellTree()

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

Demand-driven reference to octree holding all cells.

Definition at line 707 of file meshSearch.C.

◆ 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 733 of file meshSearch.C.

◆ findNearestFace()

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

Definition at line 756 of file meshSearch.C.

Referenced by mappedPatchBase::findLocalSamples().

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 779 of file meshSearch.C.

Referenced by trackingInverseDistance::markDonors().

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 803 of file meshSearch.C.

References indexedOctree< Type >::bb(), PointHit< PointType >::distance(), f(), PointIndexHit< PointType >::hit(), PointIndexHit< PointType >::index(), Foam::magSqr(), boundBox::max(), boundBox::min(), indexedOctree< Type >::shapes(), and Foam::sqr().

Here is the call 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 869 of file meshSearch.C.

References PointIndexHit< PointType >::hit(), PointIndexHit< PointType >::index(), and PointIndexHit< PointType >::setIndex().

Here is the call 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 886 of file meshSearch.C.

References DynamicList< T, SizeMin >::append(), PointIndexHit< PointType >::hit(), PointIndexHit< PointType >::index(), PointIndexHit< PointType >::setIndex(), and DynamicList< T, SizeMin >::shrink().

Here is the call graph for this function:

◆ isInside()

bool isInside ( const point p) const

Determine inside/outside status.

Definition at line 913 of file meshSearch.C.

References volumeType::INSIDE, and p.

◆ clearOut()

void clearOut ( )

Delete all storage.

Definition at line 919 of file meshSearch.C.

◆ correct()

void correct ( )

Correct for mesh geom/topo changes.

Definition at line 927 of file meshSearch.C.

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: