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... | |
Private Member Functions | |
label | findNearestCellTree (const point &) const |
Nearest cell centre using octree. More... | |
label | findNearestCellLinear (const point &) const |
Nearest cell centre going through all cells. More... | |
label | findNearestCellWalk (const point &, const label) const |
Walk from seed. Does not 'go around' boundary, just returns. More... | |
label | findCellLinear (const point &) const |
Cell containing location. Linear search. More... | |
label | findCellWalk (const point &, const label) const |
Walk from seed. Does not 'go around' boundary, just returns. More... | |
label | findNearestFaceTree (const point &) const |
label | findNearestFaceLinear (const point &) const |
label | findNearestFaceWalk (const point &, const label) const |
label | findNearestBoundaryFaceWalk (const point &location, const label seedFaceI) const |
Walk from seed to find nearest boundary face. Gets stuck in. More... | |
vector | offset (const point &bPoint, const label bFaceI, const vector &dir) const |
Calculate offset vector in direction dir with as length a. More... | |
meshSearch (const meshSearch &) | |
Disallow default bitwise copy construct. More... | |
void | operator= (const meshSearch &) |
Disallow default bitwise assignment. More... | |
Static Private Member Functions | |
static bool | findNearer (const point &sample, const pointField &points, label &nearestI, scalar &nearestDistSqr) |
Updates nearestI, nearestDistSqr from any closer ones. More... | |
static bool | findNearer (const point &sample, const pointField &points, const labelList &indices, label &nearestI, scalar &nearestDistSqr) |
Updates nearestI, nearestDistSqr from any selected closer ones. More... | |
Private Attributes | |
const polyMesh & | mesh_ |
Reference to mesh. More... | |
const polyMesh::cellDecomposition | cellDecompMode_ |
Whether to use cell decomposition for all geometric tests. More... | |
autoPtr< treeBoundBox > | overallBbPtr_ |
Data bounding box. More... | |
autoPtr< indexedOctree< treeDataFace > > | boundaryTreePtr_ |
Demand driven octrees. More... | |
autoPtr< indexedOctree< treeDataCell > > | cellTreePtr_ |
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Definition at line 57 of file meshSearch.H.
|
private |
Disallow default bitwise copy construct.
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 497 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 519 of file meshSearch.C.
References polyMesh::CELL_TETS, polyMesh::FACE_DIAG_TRIS, mesh, and polyMesh::tetBasePtIs().
~meshSearch | ( | ) |
Destructor.
Definition at line 544 of file meshSearch.C.
|
staticprivate |
Updates nearestI, nearestDistSqr from any closer ones.
Definition at line 47 of file meshSearch.C.
References forAll, Foam::magSqr(), and points.
|
staticprivate |
Updates nearestI, nearestDistSqr from any selected closer ones.
Definition at line 73 of file meshSearch.C.
References forAll, Foam::magSqr(), and points.
|
private |
Nearest cell centre using octree.
Definition at line 102 of file meshSearch.C.
References indexedOctree::bb(), meshSearch::cellTree(), indexedOctree::findNearest(), PointIndexHit< Point >::hit(), PointIndexHit< Point >::index(), Foam::magSqr(), boundBox::max(), boundBox::min(), and Foam::sqr().
|
private |
Nearest cell centre going through all cells.
Definition at line 121 of file meshSearch.C.
References Foam::magSqr().
|
private |
Walk from seed. Does not 'go around' boundary, just returns.
last cell before boundary.
Definition at line 142 of file meshSearch.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::magSqr().
|
private |
|
private |
Walk from seed. Does not 'go around' boundary, just returns.
last cell before boundary.
Definition at line 327 of file meshSearch.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, forAll, and Foam::magSqr().
|
private |
Definition at line 178 of file meshSearch.C.
References indexedOctree::bb(), indexedOctree::findNearest(), PointIndexHit< Point >::hit(), PointIndexHit< Point >::index(), Foam::magSqr(), boundBox::max(), boundBox::min(), and Foam::sqr().
|
private |
Definition at line 218 of file meshSearch.C.
References Foam::magSqr().
|
private |
Definition at line 239 of file meshSearch.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, and Foam::magSqr().
|
private |
Walk from seed to find nearest boundary face. Gets stuck in.
local minimum.
Definition at line 398 of file meshSearch.C.
References PointHit::distance(), Foam::exit(), f(), Foam::FatalError, FatalErrorInFunction, and forAll.
|
private |
Calculate offset vector in direction dir with as length a.
fraction of the cell size (of the cell straddling boundary face)
Definition at line 476 of file meshSearch.C.
References Foam::constant::universal::c, and Foam::mag().
|
private |
Disallow default bitwise assignment.
ClassName | ( | "meshSearch" | ) |
|
inline |
Definition at line 194 of file meshSearch.H.
References meshSearch::mesh_.
|
inline |
Definition at line 199 of file meshSearch.H.
References meshSearch::cellDecompMode_.
Referenced by sampledTriSurfaceMesh::update().
const Foam::indexedOctree< Foam::treeDataFace > & boundaryTree | ( | ) | const |
Get (demand driven) reference to octree holding all.
boundary faces
Definition at line 552 of file meshSearch.C.
References Foam::e, treeBoundBox::extend(), forAll, 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 605 of file meshSearch.C.
References Foam::e, treeBoundBox::extend(), boundBox::max(), boundBox::min(), and rndGen().
Referenced by meshSearch::findNearestCellTree(), and sampledTriSurfaceMesh::update().
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 738 of file meshSearch.C.
Foam::label findNearestFace | ( | const point & | location, |
const label | seedFaceI = -1 , |
||
const bool | useTreeSearch = true |
||
) | const |
Definition at line 763 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 788 of file meshSearch.C.
Referenced by cloudSet::calcSamples(), arraySet::calcSamples(), surfaceToCell::combine(), and cellClassification::markCells().
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 814 of file meshSearch.C.
References indexedOctree::bb(), PointHit::distance(), f(), PointIndexHit< Point >::hit(), PointIndexHit< Point >::index(), Foam::magSqr(), boundBox::max(), boundBox::min(), indexedOctree::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 882 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 899 of file meshSearch.C.
References DynamicList::append(), PointIndexHit< Point >::hit(), PointIndexHit< Point >::hitPoint(), PointIndexHit< Point >::index(), Foam::mag(), DynamicList::shrink(), and Foam::sqrt().
bool isInside | ( | const point & | p | ) | const |
Determine inside/outside status.
Definition at line 946 of file meshSearch.C.
References volumeType::INSIDE, and p.
void clearOut | ( | ) |
Delete all storage.
Definition at line 953 of file meshSearch.C.
void correct | ( | ) |
Correct for mesh geom/topo changes.
Definition at line 961 of file meshSearch.C.
|
private |
|
private |
Whether to use cell decomposition for all geometric tests.
Definition at line 65 of file meshSearch.H.
Referenced by meshSearch::decompMode().
|
mutableprivate |
Data bounding box.
Definition at line 68 of file meshSearch.H.
|
mutableprivate |
Demand driven octrees.
Definition at line 71 of file meshSearch.H.
|
mutableprivate |
Definition at line 72 of file meshSearch.H.
|
static |
Tolerance on linear dimensions.
Definition at line 163 of file meshSearch.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.