KrisLibrary
1.0.0
|
A 2D array over an axis-aligned 2D box, containing Real values. More...
#include <AreaGrid.h>
Public Types | |
typedef AreaGridTemplate< T > | MyT |
typedef AreaGridIterator< T > | iterator |
Public Member Functions | |
bool | IsEmpty () const |
void | Resize (int m, int n) |
void | ResizeByResolution (const Vector2 &res) |
template<class T2 > | |
void | MakeSimilar (const AreaGridTemplate< T2 > &grid) |
template<class T2 > | |
bool | IsSimilar (const AreaGridTemplate< T2 > &grid) const |
void | GetCell (int i, int j, AABB2D &cell) const |
void | GetCellCenter (int i, int j, Vector2 ¢er) const |
Vector2 | GetCellSize () const |
void | GetIndex (const Vector2 &pt, int &i, int &j) const |
void | GetIndexAndParams (const Vector2 &pt, IntPair &index, Vector2 ¶ms) const |
void | GetIndexRange (const AABB2D &range, IntPair &imin, IntPair &imax) const |
void | GetCell (const IntPair &index, AABB2D &cell) const |
void | GetCenter (const IntPair &index, Vector2 ¢er) const |
void | GetIndex (const Vector2 &pt, IntPair &index) const |
void | SetValue (int i, int j, const T &v) |
void | SetValue (const Vector2 &pt, const T &v) |
T | GetValue (int i, int j) const |
T | GetValue (const Vector2 &pt) const |
T | BilinearInterpolate (const Vector2 &pt) const |
Computes the trilinear interpolation of the field at pt, assuming values are sampled exactly at cell centers. | |
T | Average (const AABB2D &range) const |
Average value of the range. Each cell's value is weighted by the volume overlap with range. | |
void | ResampleBilinear (const MyT &grid) |
Resamples the given volume grid onto the current grid, taking trilinear interpolation at cell centers. | |
void | ResampleAverage (const MyT &grid) |
Resamples the given volume grid onto the current grid, taking averages over grid cells. | |
void | Gradient_ForwardDifference (const IntPair &index, Vector2 &grad) const |
Returns the gradient estimated using forward differencing. | |
void | Gradient_CenteredDifference (const IntPair &index, Vector2 &grad) const |
Returns the gradient estimated using centered differencing. | |
void | Gradient (const Vector2 &pt, Vector2 &grad) const |
void | Add (const MyT &grid) |
void | Subtract (const MyT &grid) |
void | Multiply (const MyT &grid) |
void | Max (const MyT &grid) |
void | Min (const MyT &grid) |
void | Add (T val) |
void | Multiply (T val) |
void | Max (T val) |
void | Min (T val) |
iterator | getIterator () const |
Public Attributes | |
Array2D< T > | value |
AABB2D | bb |
A 2D array over an axis-aligned 2D box, containing Real values.
GetIndex returns the cell containing a 2D point. GetIndexAndParams returns the cell containing a 2D point, and its coordinates within that cell.
Cells can be quickly iterated over using the iterator class.
Values are interpreted so they are defined over an entire cell, not the vertices.
Most methods just clamp their arguments to the domain rather than doing bounds checks.
void Meshing::AreaGridTemplate< T >::Gradient | ( | const Vector2 & | pt, |
Vector2 & | grad | ||
) | const |
Returns the trilinear interpolated gradient. If any element of pt is on a cell boundary the gradient estimated using centered differencing
NOTE: THIS CALCULATION IS SUSPECT