mantaflow
0.10
A framework for fluid simulation
|
#include <grid.h>
Public Types | |
typedef T | BASETYPE |
typedef GridBase | BASETYPE_GRID |
Public Types inherited from Manta::GridBase | |
enum | GridType { TypeNone = 0, TypeReal = 1, TypeInt = 2, TypeVec3 = 4, TypeMAC = 8, TypeLevelset = 16, TypeFlags = 32 } |
Public Member Functions | |
PYTHON () Grid(FluidSolver *parent | |
init new grid, values are set to zero More... | |
Grid (const Grid< T > &a) | |
create new & copy content from another grid | |
virtual | ~Grid () |
return memory to solver | |
T | get (int i, int j, int k) const |
T & | get (int i, int j, int k) |
access data | |
T | get (IndexInt idx) const |
access data | |
T | get (const Vec3i &pos) const |
access data | |
T & | operator() (int i, int j, int k) |
access data | |
T | operator() (int i, int j, int k) const |
access data | |
T & | operator() (IndexInt idx) |
access data | |
T | operator() (IndexInt idx) const |
access data | |
T & | operator() (const Vec3i &pos) |
access data | |
T | operator() (const Vec3i &pos) const |
access data | |
T & | operator[] (IndexInt idx) |
access data | |
const T | operator[] (IndexInt idx) const |
access data | |
T | getInterpolated (const Vec3 &pos) const |
void | setInterpolated (const Vec3 &pos, const T &val, Grid< Real > &sumBuffer) const |
T | getInterpolatedHi (const Vec3 &pos, int order) const |
PYTHON () Grid< T > ©From(const Grid< T > &a | |
warning - do not use "=" for grids in python, this copies the reference! not the grid content... More... | |
PYTHON () void add(const Grid< T > &a) | |
add/subtract other grid | |
PYTHON () void sub(const Grid< T > &a) | |
PYTHON () void setConst(T s) | |
set all cells to constant value | |
PYTHON () void addConst(T s) | |
add constant to all grid cells | |
PYTHON () void addScaled(const Grid< T > &a | |
add scaled other grid to current one (note, only "Real" factor, "T" type not supported here!) | |
PYTHON () void mult(const Grid< T > &a) | |
multiply contents of grid | |
PYTHON () void multConst(T s) | |
multiply each cell by a constant scalar value | |
PYTHON () void clamp(Real min | |
clamp content to range (for vec3, clamps each component separately) | |
PYTHON () void stomp(const T &threshold) | |
reduce small values to zero | |
PYTHON () Real getMaxAbs() | |
get absolute max value in grid | |
PYTHON () Real getMax() | |
get max value in grid | |
PYTHON () Real getMin() | |
get min value in grid | |
PYTHON () Real getL1(int bnd=0) | |
calculate L1 norm of grid content | |
PYTHON () Real getL2(int bnd=0) | |
calculate L2 norm of grid content | |
PYTHON () void setBound(T value | |
set all boundary cells to constant value (Dirichlet) | |
PYTHON () void setBoundNeumann(int boundaryWidth | |
set all boundary cells to last inner value (Neumann) | |
PYTHON() std | PYTHON () void printGrid(int zSlice |
get data pointer of grid More... | |
template<class S > | |
Grid< T > & | operator+= (const Grid< S > &a) |
template<class S > | |
Grid< T > & | operator+= (const S &a) |
template<class S > | |
Grid< T > & | operator-= (const Grid< S > &a) |
template<class S > | |
Grid< T > & | operator-= (const S &a) |
template<class S > | |
Grid< T > & | operator*= (const Grid< S > &a) |
template<class S > | |
Grid< T > & | operator*= (const S &a) |
template<class S > | |
Grid< T > & | operator/= (const Grid< S > &a) |
template<class S > | |
Grid< T > & | operator/= (const S &a) |
Grid< T > & | safeDivide (const Grid< T > &a) |
void | swap (Grid< T > &other) |
Swap data with another grid (no actual data is moved) | |
T & | operator() (int i, int j, int k, int unused) |
grid4d compatibility functions | |
T | operator() (int i, int j, int k, int unused) const |
template<> | |
Real | getMax () |
template<> | |
Real | getMax () |
template<> | |
Real | getMax () |
Public Member Functions inherited from Manta::GridBase | |
PYTHON () GridBase(FluidSolver *parent) | |
int | getSizeX () const |
Get the grids X dimension. | |
int | getSizeY () const |
Get the grids Y dimension. | |
int | getSizeZ () const |
Get the grids Z dimension. | |
Vec3i | getSize () const |
Get the grids dimensions. | |
IndexInt | getStrideX () const |
Get Stride in X dimension. | |
IndexInt | getStrideY () const |
Get Stride in Y dimension. | |
IndexInt | getStrideZ () const |
Get Stride in Z dimension. | |
Real | getDx () |
void | checkIndex (int i, int j, int k) const |
Check if indices are within bounds, otherwise error (should only be called when debugging) | |
void | checkIndex (IndexInt idx) const |
Check if indices are within bounds, otherwise error (should only be called when debugging) | |
bool | isInBounds (const Vec3i &p, int bnd) const |
Check if index is within given boundaries. | |
bool | isInBounds (const Vec3i &p) const |
Check if index is within given boundaries. | |
bool | isInBounds (const Vec3 &p, int bnd=0) const |
Check if index is within given boundaries. | |
bool | isInBounds (IndexInt idx) const |
Check if linear index is in the range of the array. | |
GridType | getType () const |
Get the type of grid. | |
bool | is3D () const |
Check dimensionality. | |
IndexInt | index (int i, int j, int k) const |
Get index into the data. | |
IndexInt | index (const Vec3i &pos) const |
Get index into the data. | |
bool | is4D () const |
grid4d compatibility functions | |
int | getSizeT () const |
int | getStrideT () const |
int | index (int i, int j, int k, int unused) const |
bool | isInBounds (int i, int j, int k, int t, int bnd) const |
Public Attributes | |
bool | show = true) |
bool | copyType =true ) |
const T & | factor |
Real | max |
int | boundaryWidth =1) |
PYTHON() std bool | printIndex =false) |
Protected Attributes | |
T * | mData |
Protected Attributes inherited from Manta::GridBase | |
GridType | mType |
Vec3i | mSize |
Real | mDx |
bool | m3D |
IndexInt | mStrideZ |
Grid class
|
inline |
all kinds of access functions, use grid(), grid[] or grid.get() access data
Manta::Grid< T >::PYTHON | ( | ) |
init new grid, values are set to zero
set all cells to zero
Manta::Grid< T >::PYTHON | ( | ) | const & |
warning - do not use "=" for grids in python, this copies the reference! not the grid content...
copy content from other grid (use this one instead of operator= !)
PYTHON () std Manta::Grid< T >::PYTHON | ( | ) |
get data pointer of grid
debugging helper, print grid from python