Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search. More...
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 polyMesh & | mesh () 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< pointIndexHit > | intersections (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... | |
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Definition at line 60 of file meshSearch.H.
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 552 of file meshSearch.C.
References polyMesh::CELL_TETS, polyMesh::FACE_DIAG_TRIS, mesh, and polyMesh::tetBasePtIs().
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 573 of file meshSearch.C.
References polyMesh::CELL_TETS, polyMesh::FACE_DIAG_TRIS, mesh, and polyMesh::tetBasePtIs().
~meshSearch | ( | ) |
Destructor.
Definition at line 598 of file meshSearch.C.
ClassName | ( | "meshSearch" | ) |
|
inline |
Definition at line 188 of file meshSearch.H.
|
inline |
Definition at line 193 of file meshSearch.H.
const Foam::indexedOctree< Foam::treeDataFace > & boundaryTree | ( | ) | const |
Get (demand driven) reference to octree holding all.
boundary faces
Definition at line 607 of file meshSearch.C.
References Foam::constant::electromagnetic::e, treeBoundBox::extend(), Foam::identity(), boundBox::max(), boundBox::min(), and rndGen.
const Foam::indexedOctree< Foam::treeDataCell > & cellTree | ( | ) | const |
Get (demand driven) reference to octree holding all cells.
Definition at line 659 of file meshSearch.C.
References Foam::constant::electromagnetic::e, treeBoundBox::extend(), boundBox::max(), boundBox::min(), and rndGen.
Foam::label findNearestCell | ( | const point & | location, |
const label | seedCelli = -1 , |
||
const bool | useTreeSearch = true |
||
) | const |
Find nearest cell in terms of cell centre.
Options:
Definition at line 705 of file meshSearch.C.
Foam::label findNearestFace | ( | const point & | location, |
const label | seedFacei = -1 , |
||
const bool | useTreeSearch = true |
||
) | const |
Definition at line 728 of file meshSearch.C.
Referenced by mappedPatchBase::findSamples().
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 751 of file meshSearch.C.
Referenced by trackingInverseDistance::markDonors().
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 775 of file meshSearch.C.
References indexedOctree< Type >::bb(), PointHit< Point >::distance(), f(), treeDataFace::faceLabels(), PointIndexHit< Point >::hit(), PointIndexHit< Point >::index(), Foam::magSqr(), boundBox::max(), boundBox::min(), 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 841 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 |
Find all intersections of boundary within segment pStart .. pEnd.
Always octree for now
Definition at line 858 of file meshSearch.C.
References DynamicList< T, SizeMin >::append(), PointIndexHit< Point >::hit(), PointIndexHit< Point >::index(), PointIndexHit< Point >::setIndex(), and DynamicList< T, SizeMin >::shrink().
Determine inside/outside status.
Definition at line 884 of file meshSearch.C.
References volumeType::INSIDE, and p.
void clearOut | ( | ) |
Delete all storage.
Definition at line 890 of file meshSearch.C.
void correct | ( | ) |
Correct for mesh geom/topo changes.
Definition at line 898 of file meshSearch.C.
|
static |
Tolerance on linear dimensions.
Definition at line 157 of file meshSearch.H.