#include <Grid2D.h>

Data Structures | |
| struct | Cell |
Public Types | |
| enum | { PART_EMPTY = 0, PART_WALL = -1, PART_FULL = 1 } |
| enum | Status { FMM_FRONT0 = 0, FMM_FAR = -1, FMM_KNOWN = -2, FMM_BORDER = -3 } |
| typedef float | real |
| typedef Vec< 2, real > | vec2 |
Public Member Functions | |
| Grid2D () | |
| ~Grid2D () | |
| void | clear (int _nx, int _ny) |
| int | clamp_x (int x) |
| int | clamp_y (int y) |
| int | clamp_in_x (int x) |
| int | clamp_in_y (int y) |
| int | index (int x, int y) const |
| int | index (const vec2 &p) const |
| Cell * | get (int x, int y, Cell *base) const |
| const Cell * | get (int x, int y, const Cell *base) const |
| Cell * | get (int x, int y) |
| const Cell * | get (int x, int y) const |
| Cell * | get (const vec2 &p) |
| const Cell * | get (const vec2 &p) const |
| template<int C> | |
| real | interp (const Cell *base, real fx, real fy) const |
| template<int C> | |
| real | interp (vec2 p) const |
| vec2 | interp (vec2 p) const |
| template<int C> | |
| void | impulse (Cell *base, real fx, real fy, real i) |
| template<int C> | |
| void | impulse (vec2 p, real i) |
| void | impulse (const vec2 &p, const vec2 &i) |
| real * | getpressure (int x, int y) |
| real | getpressure (vec2 p) |
| real * | getlevelset (int x, int y) |
| real | getlevelset (vec2 p) |
| void | seed (real height) |
| void | seed (real height, vec2 normal) |
| void | seed (vec2 p0, vec2 p1, vec2 velocity=vec2(0, 0)) |
| void | step (Grid2D *prev, Grid2D *temp, real dt=0.04, real diff=0.00001) |
| void | step_init (const Grid2D *prev, Grid2D *temp, real dt, real diff) |
| void | step_levelset (Grid2D *prev, Grid2D *temp, real dt, real diff) |
| void | step_forces (const Grid2D *prev, Grid2D *temp, real dt, real diff, real scale=1.0) |
| void | step_surface (const Grid2D *prev, Grid2D *temp, real dt, real diff) |
| void | step_advect (const Grid2D *prev, Grid2D *temp, real dt, real diff) |
| void | step_diffuse (const Grid2D *prev, Grid2D *temp, real dt, real diff) |
| void | step_project (const Grid2D *prev, Grid2D *temp, real dt, real diff) |
| void | step_color (const Grid2D *prev, Grid2D *temp, real dt, real diff) |
| int | fmm_pop () |
| void | fmm_push (int index) |
| void | fmm_swap (int entry1, int entry2) |
Static Public Member Functions | |
| template<class T > | |
| static T | lerp (T a, T b, real f) |
Data Fields | |
| int | nx |
| int | ny |
| int | ncell |
| Cell * | fdata |
| real * | pressure |
| real * | levelset |
| real | t |
| real | tend |
| real | max_pressure |
| Cell | bcell |
| int * | fmm_status |
| int * | fmm_heap |
| int | fmm_heap_size |
Static Public Attributes | |
| static const unsigned long * | obstacles = NULL |
Definition at line 53 of file Grid2D.h.
| sofa::component::behaviormodel::eulerianfluid::Grid2D::Grid2D | ( | ) |
Definition at line 88 of file Grid2D.cpp.
References bcell, sofa::defaulttype::Vec< N, real >::clear(), sofa::component::behaviormodel::eulerianfluid::Grid2D::Cell::type, and sofa::component::behaviormodel::eulerianfluid::Grid2D::Cell::u.
| sofa::component::behaviormodel::eulerianfluid::Grid2D::~Grid2D | ( | ) |
Definition at line 101 of file Grid2D.cpp.
References fdata, fmm_heap, fmm_status, levelset, and pressure.
Definition at line 110 of file Grid2D.cpp.
References fdata, fmm_heap, fmm_status, levelset, ncell, nx, ny, pressure, t, and tend.
Referenced by sofa::component::behaviormodel::eulerianfluid::Fluid2D::init().
| int sofa::component::behaviormodel::eulerianfluid::Grid2D::fmm_pop | ( | ) |
Definition at line 471 of file Grid2D.cpp.
References fmm_heap, fmm_heap_size, FMM_KNOWN, fmm_status, fmm_swap(), levelset, and nx.
| void sofa::component::behaviormodel::eulerianfluid::Grid2D::fmm_push | ( | int | index | ) |
Definition at line 527 of file Grid2D.cpp.
References FMM_FRONT0, fmm_heap, fmm_heap_size, fmm_status, fmm_swap(), levelset, and nx.
| void sofa::component::behaviormodel::eulerianfluid::Grid2D::fmm_swap | ( | int | entry1, | |
| int | entry2 | |||
| ) | [inline] |
Definition at line 461 of file Grid2D.cpp.
References FMM_FRONT0, fmm_heap, and fmm_status.
Referenced by fmm_pop(), and fmm_push().
| Cell* sofa::component::behaviormodel::eulerianfluid::Grid2D::get | ( | int | x, | |
| int | y, | |||
| Cell * | base | |||
| ) | const [inline] |
Definition at line 127 of file Grid2D.h.
References index().
Referenced by sofa::component::behaviormodel::eulerianfluid::Fluid2D::drawVisual().
Definition at line 235 of file Grid2D.h.
References getlevelset(), index(), lerp(), and sofa::helper::rfloor().
Definition at line 230 of file Grid2D.h.
References index(), and levelset.
Referenced by sofa::component::behaviormodel::eulerianfluid::Fluid2D::drawVisual(), getlevelset(), and step_levelset().
Definition at line 219 of file Grid2D.h.
References getpressure(), index(), lerp(), and sofa::helper::rfloor().
Definition at line 214 of file Grid2D.h.
References index(), and pressure.
Referenced by getpressure().
Definition at line 117 of file Grid2D.h.
References nx.
Referenced by get(), getlevelset(), getpressure(), index(), step_advect(), step_diffuse(), step_forces(), step_project(), and step_surface().
| void sofa::component::behaviormodel::eulerianfluid::Grid2D::seed | ( | vec2 | p0, | |
| vec2 | p1, | |||
| vec2 | velocity = vec2(0,0) | |||
| ) |
Definition at line 165 of file Grid2D.cpp.
References fdata, FOR_ALL_CELLS, levelset, sofa::defaulttype::Vec< N, real >::norm(), nx, ny, sofa::helper::rabs(), sofa::helper::rmax(), and sofa::component::behaviormodel::eulerianfluid::Grid2D::Cell::u.
Definition at line 155 of file Grid2D.cpp.
References fdata, FOR_ALL_CELLS, levelset, and sofa::defaulttype::Vec< N, real >::normalize().
| void sofa::component::behaviormodel::eulerianfluid::Grid2D::seed | ( | real | height | ) |
Definition at line 145 of file Grid2D.cpp.
References fdata, FOR_ALL_CELLS, and levelset.
Referenced by sofa::component::behaviormodel::eulerianfluid::Fluid2D::init().
| void sofa::component::behaviormodel::eulerianfluid::Grid2D::step | ( | Grid2D * | prev, | |
| Grid2D * | temp, | |||
| real | dt = 0.04, |
|||
| real | diff = 0.00001 | |||
| ) |
Definition at line 198 of file Grid2D.cpp.
References step_advect(), step_diffuse(), step_forces(), step_init(), step_levelset(), step_project(), step_surface(), t, and tend.
Referenced by step_project(), and sofa::component::behaviormodel::eulerianfluid::Fluid2D::updatePosition().
| void sofa::component::behaviormodel::eulerianfluid::Grid2D::step_advect | ( | const Grid2D * | prev, | |
| Grid2D * | temp, | |||
| real | dt, | |||
| real | diff | |||
| ) |
Definition at line 756 of file Grid2D.cpp.
References fdata, FOR_INNER_CELLS, index(), ncell, and sofa::component::behaviormodel::eulerianfluid::Grid2D::Cell::u.
Referenced by step().
| void sofa::component::behaviormodel::eulerianfluid::Grid2D::step_color | ( | const Grid2D * | prev, | |
| Grid2D * | temp, | |||
| real | dt, | |||
| real | diff | |||
| ) |
| void sofa::component::behaviormodel::eulerianfluid::Grid2D::step_diffuse | ( | const Grid2D * | prev, | |
| Grid2D * | temp, | |||
| real | dt, | |||
| real | diff | |||
| ) |
Definition at line 782 of file Grid2D.cpp.
References fdata, FOR_INNER_CELLS, index(), ncell, and sofa::component::behaviormodel::eulerianfluid::Grid2D::Cell::u.
Referenced by step().
| void sofa::component::behaviormodel::eulerianfluid::Grid2D::step_forces | ( | const Grid2D * | prev, | |
| Grid2D * | temp, | |||
| real | dt, | |||
| real | diff, | |||
| real | scale = 1.0 | |||
| ) |
Definition at line 604 of file Grid2D.cpp.
References sofa::defaulttype::Vec< N, real >::clear(), fdata, FOR_INNER_CELLS, index(), levelset, PART_EMPTY, PART_FULL, sofa::helper::rceil(), t, tend, sofa::component::behaviormodel::eulerianfluid::Grid2D::Cell::type, and sofa::component::behaviormodel::eulerianfluid::Grid2D::Cell::u.
Referenced by step().
| void sofa::component::behaviormodel::eulerianfluid::Grid2D::step_init | ( | const Grid2D * | prev, | |
| Grid2D * | temp, | |||
| real | dt, | |||
| real | diff | |||
| ) |
Definition at line 224 of file Grid2D.cpp.
References fdata, FOR_ALL_CELLS, levelset, nx, ny, obstacles, PART_EMPTY, PART_WALL, and sofa::component::behaviormodel::eulerianfluid::Grid2D::Cell::type.
Referenced by step().
| void sofa::component::behaviormodel::eulerianfluid::Grid2D::step_levelset | ( | Grid2D * | prev, | |
| Grid2D * | temp, | |||
| real | dt, | |||
| real | diff | |||
| ) |
Definition at line 262 of file Grid2D.cpp.
References FOR_INNER_CELLS, getlevelset(), interp(), levelset, and sofa::helper::rabs().
Referenced by step().
| void sofa::component::behaviormodel::eulerianfluid::Grid2D::step_project | ( | const Grid2D * | prev, | |
| Grid2D * | temp, | |||
| real | dt, | |||
| real | diff | |||
| ) |
Definition at line 808 of file Grid2D.cpp.
References fdata, FOR_ALL_CELLS, FOR_INNER_CELLS, FOR_READ_INNER_CELLS, index(), max_pressure, ncell, PART_EMPTY, pressure, step(), sofa::component::behaviormodel::eulerianfluid::Grid2D::Cell::type, and sofa::component::behaviormodel::eulerianfluid::Grid2D::Cell::u.
Referenced by step().
| void sofa::component::behaviormodel::eulerianfluid::Grid2D::step_surface | ( | const Grid2D * | prev, | |
| Grid2D * | temp, | |||
| real | dt, | |||
| real | diff | |||
| ) |
Definition at line 686 of file Grid2D.cpp.
References fdata, FOR_SURFACE_CELLS, index(), and sofa::component::behaviormodel::eulerianfluid::Grid2D::Cell::u.
Referenced by step().
Definition at line 76 of file Grid2D.h.
Referenced by clear(), get(), seed(), step_advect(), step_diffuse(), step_forces(), step_init(), step_project(), step_surface(), and ~Grid2D().
Definition at line 269 of file Grid2D.h.
Referenced by clear(), fmm_pop(), fmm_push(), fmm_swap(), and ~Grid2D().
Definition at line 268 of file Grid2D.h.
Referenced by clear(), fmm_pop(), fmm_push(), fmm_swap(), and ~Grid2D().
Definition at line 78 of file Grid2D.h.
Referenced by clear(), fmm_pop(), fmm_push(), getlevelset(), seed(), step_forces(), step_init(), step_levelset(), sofa::component::behaviormodel::eulerianfluid::Fluid2D::updateVisual(), and ~Grid2D().
Definition at line 72 of file Grid2D.h.
Referenced by clear(), step_advect(), step_diffuse(), and step_project().
Definition at line 72 of file Grid2D.h.
Referenced by clamp_in_x(), clamp_x(), clear(), fmm_pop(), fmm_push(), get(), index(), seed(), and step_init().
Definition at line 72 of file Grid2D.h.
Referenced by clamp_in_y(), clamp_y(), clear(), get(), seed(), and step_init().
const unsigned long * sofa::component::behaviormodel::eulerianfluid::Grid2D::obstacles = NULL [static] |
Definition at line 77 of file Grid2D.h.
Referenced by clear(), getpressure(), step_project(), and ~Grid2D().
Definition at line 81 of file Grid2D.h.
Referenced by clear(), sofa::component::behaviormodel::eulerianfluid::Fluid2D::init(), step(), and step_forces().
Definition at line 82 of file Grid2D.h.
Referenced by clear(), sofa::component::behaviormodel::eulerianfluid::Fluid2D::init(), step(), and step_forces().
1.5.7.1