mantaflow  0.10
A framework for fluid simulation
Public Member Functions | Public Attributes | List of all members
Manta::MACGrid Class Reference

#include <grid.h>

Inheritance diagram for Manta::MACGrid:
Manta::Grid< Vec3 > Manta::GridBase

Public Member Functions

 PYTHON () MACGrid(FluidSolver *parent
 calculate L1 norm of grid content
 
Vec3 getCentered (const Vec3i &pos) const
 
Vec3 getAtMACX (int i, int j, int k) const
 
Vec3 getAtMACY (int i, int j, int k) const
 
Vec3 getAtMACZ (int i, int j, int k) const
 
Vec3 getInterpolated (const Vec3 &pos) const
 
void setInterpolated (const Vec3 &pos, const Vec3 &val, Vec3 *tmp)
 
Vec3 getInterpolatedHi (const Vec3 &pos, int order) const
 
template<int comp>
Real getInterpolatedComponent (Vec3 pos) const
 
template<int comp>
Real getInterpolatedComponentHi (const Vec3 &pos, int order) const
 
 PYTHON () void setBoundMAC(Vec3 value
 
- Public Member Functions inherited from Manta::Grid< Vec3 >
 PYTHON () Grid(FluidSolver *parent
 init new grid, values are set to zero More...
 
 PYTHON () Grid< Vec3 > &copyFrom(const Grid< Vec3 > &a
 warning - do not use "=" for grids in python, this copies the reference! not the grid content... More...
 
 PYTHON () void add(const Grid< Vec3 > &a)
 add/subtract other grid
 
 PYTHON () void sub(const Grid< Vec3 > &a)
 
 PYTHON () void setConst(Vec3 s)
 set all cells to constant value
 
 PYTHON () void addConst(Vec3 s)
 add constant to all grid cells
 
 PYTHON () void addScaled(const Grid< Vec3 > &a
 add scaled other grid to current one (note, only "Real" factor, "T" type not supported here!)
 
 PYTHON () void mult(const Grid< Vec3 > &a)
 multiply contents of grid
 
 PYTHON () void multConst(Vec3 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 Vec3 &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 () void setBound(Vec3 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...
 
 Grid (const Grid< Vec3 > &a)
 create new & copy content from another grid
 
virtual ~Grid ()
 return memory to solver
 
Vec3 get (int i, int j, int k) const
 
Vec3get (int i, int j, int k)
 access data
 
Vec3 get (IndexInt idx) const
 access data
 
Vec3 get (const Vec3i &pos) const
 access data
 
Vec3operator() (int i, int j, int k)
 access data
 
Vec3 operator() (int i, int j, int k) const
 access data
 
Vec3operator() (IndexInt idx)
 access data
 
Vec3 operator() (IndexInt idx) const
 access data
 
Vec3operator() (const Vec3i &pos)
 access data
 
Vec3 operator() (const Vec3i &pos) const
 access data
 
Vec3operator() (int i, int j, int k, int unused)
 grid4d compatibility functions
 
Vec3 operator() (int i, int j, int k, int unused) const
 
Vec3operator[] (IndexInt idx)
 access data
 
const Vec3 operator[] (IndexInt idx) const
 access data
 
Vec3 getInterpolated (const Vec3 &pos) const
 
void setInterpolated (const Vec3 &pos, const Vec3 &val, Grid< Real > &sumBuffer) const
 
Vec3 getInterpolatedHi (const Vec3 &pos, int order) const
 
Grid< Vec3 > & operator+= (const Grid< S > &a)
 
Grid< Vec3 > & operator+= (const S &a)
 
Grid< Vec3 > & operator-= (const Grid< S > &a)
 
Grid< Vec3 > & operator-= (const S &a)
 
Grid< Vec3 > & operator*= (const Grid< S > &a)
 
Grid< Vec3 > & operator*= (const S &a)
 
Grid< Vec3 > & operator/= (const Grid< S > &a)
 
Grid< Vec3 > & operator/= (const S &a)
 
Grid< Vec3 > & safeDivide (const Grid< Vec3 > &a)
 
void swap (Grid< Vec3 > &other)
 Swap data with another grid (no actual data is moved)
 
Real getMax ()
 
Real getMax ()
 
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
 
int boundaryWidth
 
int bool normalOnly =false)
 
- Public Attributes inherited from Manta::Grid< Vec3 >
bool show
 
bool copyType
 
const Vec3factor
 
Real max
 
int boundaryWidth
 
PYTHON() std bool printIndex
 

Additional Inherited Members

- Public Types inherited from Manta::Grid< Vec3 >
typedef Vec3 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
}
 
- Protected Attributes inherited from Manta::Grid< Vec3 >
Vec3mData
 
- Protected Attributes inherited from Manta::GridBase
GridType mType
 
Vec3i mSize
 
Real mDx
 
bool m3D
 
IndexInt mStrideZ
 

Detailed Description

Special function for staggered grids

Member Function Documentation

◆ PYTHON()

Manta::MACGrid::PYTHON ( )
virtual

set all boundary cells of a MAC grid to certain value (Dirchlet). Respects staggered grid locations optionally, only set normal components

Implements Manta::Grid< Vec3 >.

Member Data Documentation

◆ show

bool Manta::MACGrid::show
Initial value:
=true) : Grid<Vec3>(parent, show) {
mType = (GridType)(TypeMAC | TypeVec3); }
inline Vec3 getCentered(int i, int j, int k) const

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