OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

meshSearch Class Reference

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

Collaboration diagram for meshSearch:

List of all members.


Public Member Functions

 ClassName ("meshSearch")
 meshSearch (const polyMesh &mesh, const bool faceDecomp=true)
 Construct from components.
 ~meshSearch ()
const polyMeshmesh () const
const indexedOctree
< treeDataFace > & 
boundaryTree () const
 Get (demand driven) reference to octree holding all.
const indexedOctree
< treeDataCell > & 
cellTree () const
 Get (demand driven) reference to octree holding all cells.
const indexedOctree
< treeDataPoint > & 
cellCentreTree () const
 Get (demand driven) reference to octree holding all cell centres.
bool pointInCell (const point &p, const label celli) const
 test for point in cell. Does not handle cells with center
label findNearestCell (const point &location, const label seedCellI=-1, const bool useTreeSearch=true) const
 Find nearest cell in terms of cell centre.
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 (using pointInCell) location.
label findNearestBoundaryFace (const point &location, const label seedFaceI=-1, const bool useTreeSearch=true) const
 Find nearest boundary face.
pointIndexHit intersection (const point &pStart, const point &pEnd) const
 Find first intersection of boundary in segment [pStart, pEnd].
List< pointIndexHitintersections (const point &pStart, const point &pEnd) const
 Find all intersections of boundary within segment pStart .. pEnd.
bool isInside (const point &) const
 Determine inside/outside status.
void clearOut ()
 delete all storage
void correct ()
 Correct for mesh geom/topo changes.

Static Public Attributes

static scalar tol_ = 1E-3
 tolerance on linear dimensions

Detailed Description

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

Source files

Definition at line 54 of file meshSearch.H.


Constructor & Destructor Documentation

meshSearch ( const polyMesh mesh,
const bool  faceDecomp = true 
)

Construct from components.

Definition at line 418 of file meshSearch.C.

~meshSearch (  ) 

Definition at line 431 of file meshSearch.C.


Member Function Documentation

ClassName ( "meshSearch"   ) 

const polyMesh& mesh (  )  const [inline]

Definition at line 182 of file meshSearch.H.

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

Get (demand driven) reference to octree holding all.

boundary faces

Definition at line 439 of file meshSearch.C.

References meshSearch::clearOut().

Referenced by meshSearch::clearOut(), and meshSearch::intersections().

Here is the call graph for this function:

Here is the caller graph for this function:

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

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

Definition at line 480 of file meshSearch.C.

const Foam::indexedOctree< Foam::treeDataPoint > & cellCentreTree (  )  const

Get (demand driven) reference to octree holding all cell centres.

Definition at line 515 of file meshSearch.C.

bool pointInCell ( const point p,
const label  celli 
) const

test for point in cell. Does not handle cells with center

outside cell.

Definition at line 547 of file meshSearch.C.

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

Find nearest cell in terms of cell centre.

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

Definition at line 635 of file meshSearch.C.

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

Definition at line 660 of file meshSearch.C.

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

Find cell containing (using pointInCell) 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 685 of file meshSearch.C.

Referenced by surfaceSets::getSurfaceSets().

Here is the caller graph for this function:

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

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

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

References meshSearch::boundaryTree().

Here is the call graph for this function:

bool isInside ( const point p  )  const

Determine inside/outside status.

Definition at line 931 of file meshSearch.C.

void clearOut (  ) 

delete all storage

Definition at line 940 of file meshSearch.C.

References meshSearch::boundaryTree().

Referenced by meshSearch::boundaryTree().

Here is the call graph for this function:

Here is the caller graph for this function:

void correct (  ) 

Correct for mesh geom/topo changes.

Definition at line 948 of file meshSearch.C.

References Foam::deleteDemandDrivenData().

Here is the call graph for this function:


Member Data Documentation

Foam::scalar tol_ = 1E-3 [static]

tolerance on linear dimensions

Definition at line 164 of file meshSearch.H.


The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd