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

#include <grid.h>

Inheritance diagram for Manta::FlagGrid:
Manta::Grid< int > Manta::GridBase

Public Member Functions

 PYTHON () FlagGrid(FluidSolver *parent
 calculate L1 norm of grid content
 
int getAt (const Vec3 &pos) const
 access for particles
 
bool isObstacle (IndexInt idx) const
 check for different flag types
 
bool isObstacle (int i, int j, int k) const
 
bool isObstacle (const Vec3i &pos) const
 
bool isObstacle (const Vec3 &pos) const
 
bool isFluid (IndexInt idx) const
 
bool isFluid (int i, int j, int k) const
 
bool isFluid (const Vec3i &pos) const
 
bool isFluid (const Vec3 &pos) const
 
bool isInflow (IndexInt idx) const
 
bool isInflow (int i, int j, int k) const
 
bool isInflow (const Vec3i &pos) const
 
bool isInflow (const Vec3 &pos) const
 
bool isEmpty (IndexInt idx) const
 
bool isEmpty (int i, int j, int k) const
 
bool isEmpty (const Vec3i &pos) const
 
bool isEmpty (const Vec3 &pos) const
 
bool isOutflow (IndexInt idx) const
 
bool isOutflow (int i, int j, int k) const
 
bool isOutflow (const Vec3i &pos) const
 
bool isOutflow (const Vec3 &pos) const
 
bool isOpen (IndexInt idx) const
 
bool isOpen (int i, int j, int k) const
 
bool isOpen (const Vec3i &pos) const
 
bool isOpen (const Vec3 &pos) const
 
bool isStick (IndexInt idx) const
 
bool isStick (int i, int j, int k) const
 
bool isStick (const Vec3i &pos) const
 
bool isStick (const Vec3 &pos) const
 
void InitMinXWall (const int &boundaryWidth, Grid< Real > &phiWalls)
 
void InitMaxXWall (const int &boundaryWidth, Grid< Real > &phiWalls)
 
void InitMinYWall (const int &boundaryWidth, Grid< Real > &phiWalls)
 
void InitMaxYWall (const int &boundaryWidth, Grid< Real > &phiWalls)
 
void InitMinZWall (const int &boundaryWidth, Grid< Real > &phiWalls)
 
void InitMaxZWall (const int &boundaryWidth, Grid< Real > &phiWalls)
 
 PYTHON () void initDomain(const int &boundaryWidth=0
 
void initBoundaries (const int &boundaryWidth, const int *types)
 
 PYTHON () void updateFromLevelset(LevelsetGrid &levelset)
 set fluid flags inside levelset (liquids)
 
 PYTHON () void fillGrid(int type
 set all cells (except obs/in/outflow) to type (fluid by default)
 
 PYTHON () int countCells(int flag
 
- Public Member Functions inherited from Manta::Grid< int >
 PYTHON () Grid(FluidSolver *parent
 init new grid, values are set to zero More...
 
 PYTHON () Grid< int > &copyFrom(const Grid< int > &a
 warning - do not use "=" for grids in python, this copies the reference! not the grid content... More...
 
 PYTHON () void add(const Grid< int > &a)
 add/subtract other grid
 
 PYTHON () void sub(const Grid< int > &a)
 
 PYTHON () void setConst(int s)
 set all cells to constant value
 
 PYTHON () void addConst(int s)
 add constant to all grid cells
 
 PYTHON () void addScaled(const Grid< int > &a
 add scaled other grid to current one (note, only "Real" factor, "T" type not supported here!)
 
 PYTHON () void mult(const Grid< int > &a)
 multiply contents of grid
 
 PYTHON () void multConst(int 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 int &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(int 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< int > &a)
 create new & copy content from another grid
 
virtual ~Grid ()
 return memory to solver
 
int get (int i, int j, int k) const
 
int & get (int i, int j, int k)
 access data
 
int get (IndexInt idx) const
 access data
 
int get (const Vec3i &pos) const
 access data
 
int & operator() (int i, int j, int k)
 access data
 
int operator() (int i, int j, int k) const
 access data
 
int & operator() (IndexInt idx)
 access data
 
int operator() (IndexInt idx) const
 access data
 
int & operator() (const Vec3i &pos)
 access data
 
int operator() (const Vec3i &pos) const
 access data
 
int & operator() (int i, int j, int k, int unused)
 grid4d compatibility functions
 
int operator() (int i, int j, int k, int unused) const
 
int & operator[] (IndexInt idx)
 access data
 
const int operator[] (IndexInt idx) const
 access data
 
int getInterpolated (const Vec3 &pos) const
 
void setInterpolated (const Vec3 &pos, const int &val, Grid< Real > &sumBuffer) const
 
int getInterpolatedHi (const Vec3 &pos, int order) const
 
Grid< int > & operator+= (const Grid< S > &a)
 
Grid< int > & operator+= (const S &a)
 
Grid< int > & operator-= (const Grid< S > &a)
 
Grid< int > & operator-= (const S &a)
 
Grid< int > & operator*= (const Grid< S > &a)
 
Grid< int > & operator*= (const S &a)
 
Grid< int > & operator/= (const Grid< S > &a)
 
Grid< int > & operator/= (const S &a)
 
Grid< int > & safeDivide (const Grid< int > &a)
 
void swap (Grid< int > &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

int dim =3
 
int bool show
 
const std::string & wall = "xXyYzZ"
 
const std::string const std::string & open = " "
 
const std::string const std::string const std::string & inflow = " "
 
const std::string const std::string const std::string const std::string & outflow = " "
 
const std::string const std::string const std::string const std::string Grid< Real > * phiWalls = 0x00 )
 
int bnd =0
 
int Grid< Real > * mask =NULL)
 
- Public Attributes inherited from Manta::Grid< int >
bool show
 
bool copyType
 
const int & factor
 
Real max
 
int boundaryWidth
 
PYTHON() std bool printIndex
 

Additional Inherited Members

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

Detailed Description

Special functions for FlagGrid

Member Function Documentation

◆ PYTHON()

Manta::FlagGrid::PYTHON ( )
virtual

count no. of cells matching flags via "AND" warning for large grids! only regular int returned (due to python interface) optionally creates mask in RealGrid (1 where flag matches, 0 otherwise)

Implements Manta::Grid< int >.

Member Data Documentation

◆ show

int bool Manta::FlagGrid::show
Initial value:
=true) : Grid<int>(parent, show) {
mType = (GridType)(TypeFlags | TypeInt); }
enum CellType {
TypeNone = 0,
TypeFluid = 1,
TypeObstacle = 2,
TypeEmpty = 4,
TypeInflow = 8,
TypeOutflow = 16,
TypeOpen = 32,
TypeStick = 64,
TypeReserved = 256,
}

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