Classes | Public Member Functions | Static Public Member Functions

UniGridMapper Class Reference

The UniGridMapper Maps a cell in a uniform grid to curvilinear cells, which are contained or intersect a unicell. More...

#include <UniGridMapper.hpp>

List of all members.

Classes

Public Member Functions

Static Public Member Functions


Detailed Description

The UniGridMapper Maps a cell in a uniform grid to curvilinear cells, which are contained or intersect a unicell.

This is useful for fast choosing certain candidates of a curvilinear coordinategrid. It is by now a special solution for the 3-dimensional case. Initialisation of the UniGridMapper traverses all cells of the curvi coords grid for each uni cell to build the lookup structure. UniGridMapper is Ref-Pointer-able.


Constructor & Destructor Documentation

UniGridMapper::UniGridMapper ( const RefPtr< CoordsArray_t > &  _CurviCoords,
const double  res_scale = 1.0,
const double  prec_scale = 1.0 
)

Initializes the Mapper.

It tries to choose a similar number of cubish cells as the curvilinear source.

Parameters:
_CurviCoords the curvi linear coordinate grid, the uni grid mapper shalld operate on
res_scale relative scale for the number of cells. Higher scale means more cells in the uni grid.
prec_scale relative scale for the precision for the newton iteration. Initial precision is 1/100 of the average of all edges of the curvi cells.

References add(), and Eagle::norm2().


Member Function Documentation

bool UniGridMapper::localCellCoordinatesFromCell ( point uvw,
const point P,
MultiIndex< 3 > &  it,
const CoordsArray_t Data,
const MultiIndex< 3 > &  max,
const double  prec 
)

This function is the heart of the mapper.

It does an initial guess in the cell. Then it does a taylor approximation and iterates with newton in direction of the given point to calculate the local coordinates. vgl Stalling p.

Returns:
true and the local coordinates of a worldpoint by given cell in curvi index space, false if the point is not locates inside the given curvilinear cell.
Parameters:
uvw returns the local index
P specifies the world point
prec specify the precision until the newton continues

References Eagle::norm2().

Referenced by localCellCoordinatesFromCurviGrid().

unsigned UniGridMapper::localCellCoordinatesFromCurviGrid ( const point p,
point uvw,
double  grid_epsilon = 0.0 
)

This should be called as a 'user' of UniGridMapper.

Given a world point return the local curvi-cell coordinate.

Returns:
0 if the point is not located in a curvi cell, 1 if it is located inside and it is a nice point, 2 if it is located inside but iterated to the outside and was corrected
Parameters:
p world point
uvw returns the local index of the curvi-grid
Todo:
remove the un-nice epsilon grid boundary via neighbourhood

References curviCells(), and localCellCoordinatesFromCell().