mantaflow  0.10
A framework for fluid simulation
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
Manta::Grid4d< T > Class Template Reference

#include <grid4d.h>

Inheritance diagram for Manta::Grid4d< T >:
Manta::Grid4dBase

Public Types

typedef T BASETYPE
 
typedef Grid4dBase BASETYPE_GRID
 
- Public Types inherited from Manta::Grid4dBase
enum  Grid4dType {
  TypeNone = 0, TypeReal = 1, TypeInt = 2, TypeVec3 = 4,
  TypeVec4 = 8
}
 

Public Member Functions

 PYTHON () Grid4d(FluidSolver *parent
 init new grid, values are set to zero More...
 
 Grid4d (const Grid4d< T > &a)
 create new & copy content from another grid
 
virtual ~Grid4d ()
 return memory to solver
 
get (int i, int j, int k, int t) const
 
T & get (int i, int j, int k, int t)
 access data
 
get (IndexInt idx) const
 access data
 
get (const Vec4i &pos) const
 access data
 
T & operator() (int i, int j, int k, int t)
 access data
 
operator() (int i, int j, int k, int t) const
 access data
 
T & operator() (IndexInt idx)
 access data
 
operator() (IndexInt idx) const
 access data
 
T & operator() (const Vec4i &pos)
 access data
 
operator() (const Vec4i &pos) const
 access data
 
T & operator[] (IndexInt idx)
 access data
 
const T operator[] (IndexInt idx) const
 access data
 
getInterpolated (const Vec4 &pos) const
 
 PYTHON () Grid4d< T > &copyFrom(const Grid4d< T > &a
 warning - do not use "=" for grids in python, this copies the reference! not the grid content... More...
 
 PYTHON () void add(const Grid4d< T > &a)
 add/subtract other grid
 
 PYTHON () void sub(const Grid4d< 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 Grid4d< T > &a
 add scaled other grid to current one (note, only "Real" factor, "T" type not supported here!)
 
 PYTHON () void mult(const Grid4d< 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 () 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 () 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 () void printGrid(int zSlice
 debugging helper, print grid from Python
 
template<class S >
Grid4d< T > & operator+= (const Grid4d< S > &a)
 
template<class S >
Grid4d< T > & operator+= (const S &a)
 
template<class S >
Grid4d< T > & operator-= (const Grid4d< S > &a)
 
template<class S >
Grid4d< T > & operator-= (const S &a)
 
template<class S >
Grid4d< T > & operator*= (const Grid4d< S > &a)
 
template<class S >
Grid4d< T > & operator*= (const S &a)
 
template<class S >
Grid4d< T > & operator/= (const Grid4d< S > &a)
 
template<class S >
Grid4d< T > & operator/= (const S &a)
 
Grid4d< T > & safeDivide (const Grid4d< T > &a)
 
void swap (Grid4d< T > &other)
 Swap data with another grid (no actual data is moved)
 
template<>
Real getMax ()
 
template<>
Real getMax ()
 
template<>
Real getMax ()
 
template<>
Real getMax ()
 
- Public Member Functions inherited from Manta::Grid4dBase
 PYTHON () Grid4dBase(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.
 
int getSizeT () const
 Get the grids T dimension.
 
Vec4i 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.
 
IndexInt getStrideT () const
 Get Stride in T dimension.
 
Real getDx ()
 
void checkIndex (int i, int j, int k, int t) 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 Vec4i &p, int bnd) const
 Check if index is within given boundaries.
 
bool isInBounds (const Vec4i &p) const
 Check if index is within given boundaries.
 
bool isInBounds (const Vec4 &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.
 
Grid4dType getType () const
 Get the type of grid.
 
bool is3D () const
 Check dimensionality.
 
bool is4D () const
 
bool isInBounds (int i, int j, int k, int t, int bnd) const
 3d compatibility
 
IndexInt index (int i, int j, int k, int t) const
 Get index into the data.
 
IndexInt index (const Vec4i &pos) const
 Get index into the data.
 

Public Attributes

bool show = true)
 
bool copyType =true )
 
const T & factor
 
Real max
 
int boundaryWidth =1)
 
int tSlice =-1
 
int bool printIndex =false
 
int bool int bnd =0)
 

Protected Attributes

T * mData
 
- Protected Attributes inherited from Manta::Grid4dBase
Grid4dType mType
 
Vec4i mSize
 
Real mDx
 
IndexInt mStrideZ
 
IndexInt mStrideT
 

Detailed Description

template<class T>
class Manta::Grid4d< T >

Grid class

Member Function Documentation

◆ get()

template<class T>
T Manta::Grid4d< T >::get ( int  i,
int  j,
int  k,
int  t 
) const
inline

all kinds of access functions, use grid(), grid[] or grid.get() access data

◆ PYTHON() [1/2]

template<class T>
Manta::Grid4d< T >::PYTHON ( )

init new grid, values are set to zero

set all cells to zero

◆ PYTHON() [2/2]

template<class T>
Manta::Grid4d< 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= !)


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