FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
Public Member Functions | Static Public Member Functions | List of all members
TreeCellMapper Class Reference

Helper class for computing local coordinates of a curvilinear block. More...

#include <TreeCellMapper.hpp>

Inheritance diagram for TreeCellMapper:

Public Member Functions

 TreeCellMapper (RefPtr< MemArray< 3, point > > crds, tvector range_scale=tvector(1., 1., 1.), double epsilon=1./50, unsigned spread=13)
 Computed cell diagonal maximum and sets up the KDTree if not already found in the interface of the coordinate array.
 
unsigned localCoordinates (point &uvw, tvector &cell_size, const point &p)
 Function to compute local coordaintes based on the projective method ( planar faces only!! ).
 
void setQueryScale (tvector &scale)
 

Static Public Member Functions

static double maxi (const double a, const double b)
 
static void maxVec (double &max_len, tvector &max_vec, const tvector &v)
 

Detailed Description

Helper class for computing local coordinates of a curvilinear block.

Search is sped up by using a KDTree for cell finding. Cell-MultiIndices are inserted into a tree at cell mid-points and are queried by the half of the maximum of all the cell diagonals. An epsilon widens the range check of a valid local coordinate to -eps ... 1+eps.

Author
: marcel

Constructor & Destructor Documentation

◆ TreeCellMapper()

TreeCellMapper::TreeCellMapper ( RefPtr< MemArray< 3, point > >  crds,
tvector  range_scale = tvector(1.,1.,1.),
double  epsilon = 1./50,
unsigned  spread = 13 
)

Computed cell diagonal maximum and sets up the KDTree if not already found in the interface of the coordinate array.

Parameters
[in]crds3D curvilinear coordinates of a block.
[in]epsilonEpsilon to widen valid local coordinates.

References std::cout, and std::endl().

Member Function Documentation

◆ localCoordinates()

unsigned TreeCellMapper::localCoordinates ( point uvw,
tvector &  cell_size,
const point p 
)

Function to compute local coordaintes based on the projective method ( planar faces only!! ).

It uses aeries cuboidToCube() function. Local coordinates at the block boundary in the epsilon region are corrected to being located directly on the boundary.

Parameters
[in]pPoint in world coordinates.
[out]uvwPoint in local array coordaintes.
Returns
Return 0 if not found, 1 if found, 2 block boundary corrected (epsilon shifted).

References std::abs(), std::cout, and std::endl().