Fast, non-parallel searching in mesh without use of octree. More...
Public Member Functions | |
ClassName ("voxelMeshSearch") | |
voxelMeshSearch (const polyMesh &, const bool doUpdate=true) | |
Construct from mesh; voxels estimated from local number of cells. More... | |
voxelMeshSearch (const polyMesh &, const boundBox &bb, const labelVector &nDivs, const bool doUpdate=true) | |
Construct from mesh and voxel discretisation. More... | |
const labelVector & | nDivs () const |
Number of voxels for local mesh. More... | |
bool | update () |
Update lookup tables for geometry changes. More... | |
label | findCell (const point &) const |
Find a cell. More... | |
autoPtr< fvMesh > | makeMesh (const IOobject &) const |
Debug: construct fvMesh. Note: writes a dummy mesh to. More... | |
Static Public Member Functions | |
static label | index (const labelVector &nDivs, const labelVector &voxel) |
Find cells. Returns number of cells found. More... | |
static labelVector | offset (const labelVector &nDivs) |
Change in combined voxel index for change in components. More... | |
static labelVector | index3 (const labelVector &nDivs, const label voxeli) |
Combined voxel index to individual indices. More... | |
static labelVector | index3 (const boundBox &bb, const labelVector &nDivs, const point &p) |
Coordinate to voxel indices. More... | |
static point | centre (const boundBox &bb, const labelVector &nDivs, const labelVector &voxel) |
Voxel index to voxel centre. More... | |
static label | index (const boundBox &bb, const labelVector &nDivs, const point &p, const bool clip) |
Coordinate to combined voxel index. If clip makes sure. More... | |
template<class Container , class Type > | |
static void | fill (Container &elems, const boundBox &bb, const labelVector &nDivs, const boundBox &subBb, const Type val) |
Fill voxels indicated by bounding box. More... | |
template<class Container , class Type , class CombineOp > | |
static void | fill (Container &elems, const boundBox &bb, const labelVector &nDivs, const boundBox &subBb, const Type val, const CombineOp &cop=eqOp< Type >()) |
Fill voxels indicated by bounding box. More... | |
template<class Container , class Type > | |
static bool | overlaps (const boundBox &bb, const labelVector &nDivs, const boundBox &subBb, const Container &elems, const Type val, const bool isNot=false) |
Check if any voxel inside bounding box is set to val or. More... | |
template<class Container , class Type > | |
static void | write (OBJstream &, const boundBox &bb, const labelVector &nDivs, const Container &elems, const Type val, const bool isNot=false) |
Debug: write points for every set element. More... | |
static void | writeGrid (OBJstream &, const boundBox &, const labelVector &) |
Debug: write all edges. More... | |
Fast, non-parallel searching in mesh without use of octree.
Definition at line 53 of file voxelMeshSearch.H.
voxelMeshSearch | ( | const polyMesh & | mesh, |
const bool | doUpdate = true |
||
) |
Construct from mesh; voxels estimated from local number of cells.
Definition at line 280 of file voxelMeshSearch.C.
References Foam::cbrt(), Foam::ensightOutput::debug, Foam::constant::electromagnetic::e, Foam::endl(), forAll, Foam::max(), OSstream::name(), Foam::Pout, Foam::sqrt(), and update().
voxelMeshSearch | ( | const polyMesh & | mesh, |
const boundBox & | bb, | ||
const labelVector & | nDivs, | ||
const bool | doUpdate = true |
||
) |
Construct from mesh and voxel discretisation.
Definition at line 338 of file voxelMeshSearch.C.
References update().
ClassName | ( | "voxelMeshSearch" | ) |
|
inline |
Number of voxels for local mesh.
Definition at line 123 of file voxelMeshSearch.H.
bool update | ( | ) |
Update lookup tables for geometry changes.
Definition at line 358 of file voxelMeshSearch.C.
References Foam::cmptProduct(), Foam::ensightOutput::debug, Foam::endl(), forAll, OSstream::name(), points, and Foam::Pout.
Foam::label findCell | ( | const point & | p | ) | const |
Find a cell.
Definition at line 402 of file voxelMeshSearch.C.
References Foam::max(), and p.
|
static |
Find cells. Returns number of cells found.
label findCells(const UList<point>&, labelList&) const;
Voxel indices to combined voxel index
Definition at line 50 of file voxelMeshSearch.C.
References Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
|
static |
Change in combined voxel index for change in components.
Definition at line 41 of file voxelMeshSearch.C.
References Vector< Cmpt >::x(), and Vector< Cmpt >::y().
|
static |
Combined voxel index to individual indices.
Definition at line 60 of file voxelMeshSearch.C.
References Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().
|
static |
Coordinate to voxel indices.
Definition at line 78 of file voxelMeshSearch.C.
References Foam::cmptDivide(), g, boundBox::min(), s, and boundBox::span().
|
static |
Voxel index to voxel centre.
Definition at line 138 of file voxelMeshSearch.C.
References Foam::cmptDivide(), g, boundBox::min(), s, and boundBox::span().
|
static |
Coordinate to combined voxel index. If clip makes sure.
components are all inside. If not clip returns -1 if outside bb.
Definition at line 98 of file voxelMeshSearch.C.
References Foam::clip(), Foam::cmptDivide(), g, Foam::max(), boundBox::min(), Foam::min(), s, and boundBox::span().
|
static |
Fill voxels indicated by bounding box.
Definition at line 28 of file voxelMeshSearchTemplates.C.
References k, boundBox::max(), Foam::max(), boundBox::min(), and Foam::min().
|
static |
Fill voxels indicated by bounding box.
Definition at line 72 of file voxelMeshSearchTemplates.C.
References k, boundBox::max(), Foam::max(), boundBox::min(), and Foam::min().
|
static |
Check if any voxel inside bounding box is set to val or.
not set to val (isNot = true)
Definition at line 117 of file voxelMeshSearchTemplates.C.
References Foam::cmptProduct(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, k, boundBox::max(), Foam::max(), boundBox::min(), and Foam::min().
|
static |
Debug: write points for every set element.
Definition at line 177 of file voxelMeshSearchTemplates.C.
References Foam::cmptProduct(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, k, and os().
|
static |
Debug: write all edges.
Definition at line 151 of file voxelMeshSearch.C.
References Foam::cmptDivide(), g, k, boundBox::min(), os(), s, and boundBox::span().
Foam::autoPtr< Foam::fvMesh > makeMesh | ( | const IOobject & | io | ) | const |
Debug: construct fvMesh. Note: writes a dummy mesh to.
io.timeName()! TBD.
Definition at line 488 of file voxelMeshSearch.C.
References dictionary::add(), Foam::constant::physicoChemical::b, boundary, boundaryDicts, cellShapes, fvMeshTools::createDummyFvMeshFiles(), IOobject::db(), patchIdentifier::defaultName(), forAll, cellModel::HEX, Foam::identity(), io(), mesh, IOobjectOption::MUST_READ, IOobject::name(), autoPtr< T >::New(), IOobjectOption::NO_READ, UList< T >::null(), patchNames(), points, cellShape::points(), IOobjectOption::readOpt(), List< T >::setSize(), UList< T >::size(), List< T >::transfer(), and fvMesh::write().