Loading...
Searching...
No Matches
voxelMeshSearch Class Reference

Fast, non-parallel searching in mesh without use of octree. More...

#include <voxelMeshSearch.H>

Public Member Functions

 ClassName ("voxelMeshSearch")
 voxelMeshSearch (const polyMesh &, const bool doUpdate=true)
 Construct from mesh; voxels estimated from local number of cells.
 voxelMeshSearch (const polyMesh &, const boundBox &bb, const labelVector &nDivs, const bool doUpdate=true)
 Construct from mesh and voxel discretisation.
const labelVectornDivs () const
 Number of voxels for local mesh.
bool update ()
 Update lookup tables for geometry changes.
label findCell (const point &) const
 Find a cell.
autoPtr< fvMeshmakeMesh (const IOobject &) const
 Debug: construct fvMesh. Note: writes a dummy mesh to.

Static Public Member Functions

static label index (const labelVector &nDivs, const labelVector &voxel)
 Find cells. Returns number of cells found.
static labelVector offset (const labelVector &nDivs)
 Change in combined voxel index for change in components.
static labelVector index3 (const labelVector &nDivs, const label voxeli)
 Combined voxel index to individual indices.
static labelVector index3 (const boundBox &bb, const labelVector &nDivs, const point &p)
 Coordinate to voxel indices.
static point centre (const boundBox &bb, const labelVector &nDivs, const labelVector &voxel)
 Voxel index to voxel centre.
static label index (const boundBox &bb, const labelVector &nDivs, const point &p, const bool clip)
 Coordinate to combined voxel index. If clip makes sure.
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.
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.
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.
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.
static void writeGrid (OBJstream &, const boundBox &, const labelVector &)
 Debug: write all edges.

Detailed Description

Fast, non-parallel searching in mesh without use of octree.

Source files

Definition at line 53 of file voxelMeshSearch.H.

Constructor & Destructor Documentation

◆ voxelMeshSearch() [1/2]

voxelMeshSearch ( const polyMesh & mesh,
const bool doUpdate = true )

Construct from mesh; voxels estimated from local number of cells.

Definition at line 279 of file voxelMeshSearch.C.

References Foam::cbrt(), e, Foam::endl(), forAll, Foam::max(), VectorSpace< Form, Cmpt, Ncmpts >::max, mesh, nDivs(), Foam::Pout, Foam::sqrt(), and update().

Here is the call graph for this function:

◆ voxelMeshSearch() [2/2]

voxelMeshSearch ( const polyMesh & mesh,
const boundBox & bb,
const labelVector & nDivs,
const bool doUpdate = true )

Construct from mesh and voxel discretisation.

Definition at line 337 of file voxelMeshSearch.C.

References mesh, nDivs(), and update().

Here is the call graph for this function:

Member Function Documentation

◆ ClassName()

ClassName ( "voxelMeshSearch" )

References nDivs().

Here is the call graph for this function:

◆ nDivs()

const labelVector & nDivs ( ) const
inline

Number of voxels for local mesh.

Definition at line 123 of file voxelMeshSearch.H.

Referenced by ClassName(), fill(), fill(), index(), index3(), offset(), overlaps(), voxelMeshSearch(), voxelMeshSearch(), and write().

Here is the caller graph for this function:

◆ update()

bool update ( )

Update lookup tables for geometry changes.

Definition at line 358 of file voxelMeshSearch.C.

References Foam::cmptProduct(), Foam::endl(), fill(), forAll, points, and Foam::Pout.

Referenced by voxelMeshSearch(), and voxelMeshSearch().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findCell()

Foam::label findCell ( const point & p) const

Find a cell.

Definition at line 402 of file voxelMeshSearch.C.

References index(), Foam::max(), and p.

Here is the call graph for this function:

◆ index() [1/2]

Foam::label index ( const labelVector & nDivs,
const labelVector & voxel )
static

Find cells. Returns number of cells found.

label findCells(const UList<point>&, labelList&) const;

Voxel indices to combined voxel index

Definition at line 49 of file voxelMeshSearch.C.

References nDivs(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Referenced by fill(), fill(), findCell(), index(), overlaps(), and write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ offset()

Foam::labelVector offset ( const labelVector & nDivs)
static

Change in combined voxel index for change in components.

Definition at line 40 of file voxelMeshSearch.C.

References nDivs().

Referenced by fill(), fill(), overlaps(), and write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ index3() [1/2]

Foam::labelVector index3 ( const labelVector & nDivs,
const label voxeli )
static

Combined voxel index to individual indices.

Definition at line 59 of file voxelMeshSearch.C.

References nDivs(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Referenced by fill(), fill(), and overlaps().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ index3() [2/2]

Foam::labelVector index3 ( const boundBox & bb,
const labelVector & nDivs,
const point & p )
static

Coordinate to voxel indices.

Definition at line 77 of file voxelMeshSearch.C.

References Foam::cmptDivide(), g, boundBox::min(), s(), boundBox::span(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Here is the call graph for this function:

◆ centre()

Foam::point centre ( const boundBox & bb,
const labelVector & nDivs,
const labelVector & voxel )
static

Voxel index to voxel centre.

Definition at line 137 of file voxelMeshSearch.C.

References Foam::cmptDivide(), g, boundBox::min(), s(), and boundBox::span().

Referenced by write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ index() [2/2]

Foam::label index ( const boundBox & bb,
const labelVector & nDivs,
const point & p,
const bool clip )
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 97 of file voxelMeshSearch.C.

References Foam::clip(), Foam::cmptDivide(), g, index(), Foam::max(), boundBox::min(), Foam::min(), s(), boundBox::span(), Vector< Cmpt >::x(), Vector< Cmpt >::y(), and Vector< Cmpt >::z().

Here is the call graph for this function:

◆ fill() [1/2]

template<class Container, class Type>
void fill ( Container & elems,
const boundBox & bb,
const labelVector & nDivs,
const boundBox & subBb,
const Type val )
static

Fill voxels indicated by bounding box.

Definition at line 27 of file voxelMeshSearchTemplates.C.

References index(), index3(), k, boundBox::max(), Foam::max(), boundBox::min(), Foam::min(), nDivs(), and offset().

Referenced by trackingInverseDistance::markBoundaries(), and update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fill() [2/2]

template<class Container, class Type, class CombineOp>
void fill ( Container & elems,
const boundBox & bb,
const labelVector & nDivs,
const boundBox & subBb,
const Type val,
const CombineOp & cop = eqOp<Type>() )
static

Fill voxels indicated by bounding box.

Definition at line 71 of file voxelMeshSearchTemplates.C.

References index(), index3(), k, boundBox::max(), Foam::max(), boundBox::min(), Foam::min(), nDivs(), and offset().

Here is the call graph for this function:

◆ overlaps()

template<class Container, class Type>
bool overlaps ( const boundBox & bb,
const labelVector & nDivs,
const boundBox & subBb,
const Container & elems,
const Type val,
const bool isNot = false )
static

Check if any voxel inside bounding box is set to val or.

not set to val (isNot = true)

Definition at line 116 of file voxelMeshSearchTemplates.C.

References Foam::cmptProduct(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, index(), index3(), k, boundBox::max(), Foam::max(), boundBox::min(), Foam::min(), nDivs(), and offset().

Referenced by trackingInverseDistance::markBoundaries(), and trackingInverseDistance::markPatchesAsHoles().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ write()

template<class Container, class Type>
void write ( OBJstream & os,
const boundBox & bb,
const labelVector & nDivs,
const Container & elems,
const Type val,
const bool isNot = false )
static

Debug: write points for every set element.

Definition at line 176 of file voxelMeshSearchTemplates.C.

References centre(), Foam::cmptProduct(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, index(), k, nDivs(), offset(), and os().

Here is the call graph for this function:

◆ writeGrid()

void writeGrid ( OBJstream & os,
const boundBox & bb,
const labelVector & g )
static

Debug: write all edges.

Definition at line 150 of file voxelMeshSearch.C.

References Foam::cmptDivide(), g, k, boundBox::min(), os(), s(), and boundBox::span().

Here is the call graph for this function:

◆ makeMesh()


The documentation for this class was generated from the following files: