FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

meshSearch Class Reference

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

#include <meshTools/meshSearch.H>


Detailed Description

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

Source files

Definition at line 59 of file meshSearch.H.

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 polyMesh &  mesh () 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< pointIndexHit >  intersections (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

Constructor & Destructor Documentation

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

Construct from components.

Definition at line 426 of file meshSearch.C.

~meshSearch (  )

Definition at line 439 of file meshSearch.C.


Member Function Documentation

ClassName ( "meshSearch"    )
const polyMesh& mesh (  ) const [inline]

Definition at line 181 of file meshSearch.H.

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

Get (demand driven) reference to octree holding all.

boundary faces

Definition at line 447 of file meshSearch.C.

References E(), and forAll.

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

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

Definition at line 488 of file meshSearch.C.

References E().

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

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

Definition at line 523 of file meshSearch.C.

References E().

Referenced by sampledTriSurfaceMesh::update().

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

References dist, PointHit< Point >::distance(), forAll, intersection::HALF_RAY, PointHit< Point >::hit(), Foam::mag(), intersection::setPlanarTol(), and intersection::VECTOR.

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

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

Definition at line 663 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 688 of file meshSearch.C.

References Particle< ParticleType >::cell(), Foam::endl(), Particle< ParticleType >::face(), PointIndexHit< Point >::hit(), PointIndexHit< Point >::hitPoint(), PointIndexHit< Point >::index(), Foam::mag(), Particle< ParticleType >::onBoundary(), Particle< ParticleType >::position(), Foam::Pout, Foam::sqrt(), Particle< ParticleType >::track(), and PointIndexHit< Point >::write().

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

References indexedOctree< Type >::bb(), PointHit< Point >::distance(), treeDataFace::faceLabels(), PointIndexHit< Point >::hit(), PointIndexHit< Point >::index(), boundBox::mag(), face::nearestPoint(), indexedOctree< Type >::shapes(), and Foam::sqr().

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

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

Foam::List< Foam::pointIndexHit > intersections ( const point &   pStart,
const point &   pEnd  
) const
bool isInside ( const point &   p  ) const

Determine inside/outside status.

Definition at line 934 of file meshSearch.C.

void clearOut (  )

delete all storage

Definition at line 943 of file meshSearch.C.

References Foam::deleteDemandDrivenData().

void correct (  )

Correct for mesh geom/topo changes.

Definition at line 951 of file meshSearch.C.


Member Data Documentation

Foam::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: