#include <Grid3D.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< 3, real > | vec3 |
Public Member Functions | |
| Grid3D () | |
| ~Grid3D () | |
| void | clear (int _nx, int _ny, int _nz) |
| int | clamp_x (int x) |
| int | clamp_y (int y) |
| int | clamp_z (int z) |
| int | clamp_in_x (int x) |
| int | clamp_in_y (int y) |
| int | clamp_in_z (int z) |
| int | index (int x, int y, int z) const |
| int | index (const vec3 &p) const |
| Cell * | get (int x, int y, int z, Cell *base) const |
| const Cell * | get (int x, int y, int z, const Cell *base) const |
| Cell * | get (int x, int y, int z) |
| const Cell * | get (int x, int y, int z) const |
| Cell * | get (const vec3 &p) |
| const Cell * | get (const vec3 &p) const |
| template<int C> | |
| real | interp (const Cell *base, real fx, real fy, real fz) const |
| template<int C> | |
| real | interp (vec3 p) const |
| vec3 | interp (vec3 p) const |
| template<int C> | |
| void | impulse (Cell *base, real fx, real fy, real fz, real i) |
| template<int C> | |
| void | impulse (vec3 p, real i) |
| void | impulse (const vec3 &p, const vec3 &i) |
| real * | getpressure (int x, int y, int z) |
| real | getpressure (vec3 p) |
| real * | getlevelset (int x, int y, int z) |
| real | getlevelset (vec3 p) |
| void | seed (real height) |
| void | seed (real height, vec3 normal) |
| void | seed (vec3 p0, vec3 p1, vec3 velocity=vec3(0, 0, 0)) |
| void | step (Grid3D *prev, Grid3D *temp, real dt=0.04, real diff=0.00001) |
| void | step_init (const Grid3D *prev, Grid3D *temp, real dt, real diff) |
| void | step_levelset (Grid3D *prev, Grid3D *temp, real dt, real diff) |
| void | step_forces (const Grid3D *prev, Grid3D *temp, real dt, real diff, real scale=1.0) |
| void | step_surface (const Grid3D *prev, Grid3D *temp, real dt, real diff) |
| void | step_advect (const Grid3D *prev, Grid3D *temp, real dt, real diff) |
| void | step_diffuse (const Grid3D *prev, Grid3D *temp, real dt, real diff) |
| void | step_project (const Grid3D *prev, Grid3D *temp, real dt, real diff) |
| void | step_color (const Grid3D *prev, Grid3D *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 | nz |
| int | nxny |
| int | ncell |
| Cell * | fdata |
| real * | pressure |
| real * | levelset |
| real | t |
| real | tend |
| real | max_pressure |
| Cell | bcell |
| vec3 | gravity |
| 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 Grid3D.h.
| sofa::component::behaviormodel::eulerianfluid::Grid3D::Grid3D | ( | ) |
Definition at line 94 of file Grid3D.cpp.
References bcell, sofa::defaulttype::Vec< N, real >::clear(), sofa::component::behaviormodel::eulerianfluid::Grid3D::Cell::type, and sofa::component::behaviormodel::eulerianfluid::Grid3D::Cell::u.
| sofa::component::behaviormodel::eulerianfluid::Grid3D::~Grid3D | ( | ) |
Definition at line 108 of file Grid3D.cpp.
References fdata, fmm_heap, fmm_status, levelset, and pressure.
Definition at line 117 of file Grid3D.cpp.
References fdata, fmm_heap, fmm_status, levelset, ncell, nx, nxny, ny, nz, pressure, t, and tend.
Referenced by sofa::component::behaviormodel::eulerianfluid::Fluid3D::init().
| int sofa::component::behaviormodel::eulerianfluid::Grid3D::fmm_pop | ( | ) |
Definition at line 501 of file Grid3D.cpp.
References fmm_heap, fmm_heap_size, FMM_KNOWN, fmm_status, fmm_swap(), levelset, nx, and nxny.
| void sofa::component::behaviormodel::eulerianfluid::Grid3D::fmm_push | ( | int | index | ) |
Definition at line 557 of file Grid3D.cpp.
References FMM_FRONT0, fmm_heap, fmm_heap_size, fmm_status, fmm_swap(), levelset, nx, and nxny.
| void sofa::component::behaviormodel::eulerianfluid::Grid3D::fmm_swap | ( | int | entry1, | |
| int | entry2 | |||
| ) | [inline] |
Definition at line 491 of file Grid3D.cpp.
References FMM_FRONT0, fmm_heap, and fmm_status.
Referenced by fmm_pop(), and fmm_push().
| Cell* sofa::component::behaviormodel::eulerianfluid::Grid3D::get | ( | int | x, | |
| int | y, | |||
| int | z, | |||
| Cell * | base | |||
| ) | const [inline] |
Definition at line 138 of file Grid3D.h.
References index().
Referenced by sofa::component::behaviormodel::eulerianfluid::Fluid3D::drawVisual().
Definition at line 261 of file Grid3D.h.
References getlevelset(), index(), lerp(), and sofa::helper::rfloor().
| real* sofa::component::behaviormodel::eulerianfluid::Grid3D::getlevelset | ( | int | x, | |
| int | y, | |||
| int | z | |||
| ) | [inline] |
Definition at line 256 of file Grid3D.h.
References index(), and levelset.
Referenced by sofa::component::behaviormodel::eulerianfluid::Fluid3D::drawVisual(), getlevelset(), and step_levelset().
Definition at line 240 of file Grid3D.h.
References getpressure(), index(), lerp(), and sofa::helper::rfloor().
| real* sofa::component::behaviormodel::eulerianfluid::Grid3D::getpressure | ( | int | x, | |
| int | y, | |||
| int | z | |||
| ) | [inline] |
Definition at line 235 of file Grid3D.h.
References index(), and pressure.
Referenced by getpressure().
| int sofa::component::behaviormodel::eulerianfluid::Grid3D::index | ( | int | x, | |
| int | y, | |||
| int | z | |||
| ) | const [inline] |
Definition at line 128 of file Grid3D.h.
Referenced by get(), getlevelset(), getpressure(), index(), step_advect(), step_diffuse(), step_forces(), step_project(), and step_surface().
| void sofa::component::behaviormodel::eulerianfluid::Grid3D::seed | ( | vec3 | p0, | |
| vec3 | p1, | |||
| vec3 | velocity = vec3(0,0,0) | |||
| ) |
Definition at line 172 of file Grid3D.cpp.
References fdata, FOR_ALL_CELLS, levelset, sofa::defaulttype::Vec< N, real >::norm(), nx, ny, nz, sofa::helper::rabs(), sofa::helper::rmax(), and sofa::component::behaviormodel::eulerianfluid::Grid3D::Cell::u.
Definition at line 162 of file Grid3D.cpp.
References fdata, FOR_ALL_CELLS, levelset, and sofa::defaulttype::Vec< N, real >::normalize().
| void sofa::component::behaviormodel::eulerianfluid::Grid3D::seed | ( | real | height | ) |
Definition at line 152 of file Grid3D.cpp.
References fdata, FOR_ALL_CELLS, and levelset.
Referenced by sofa::component::behaviormodel::eulerianfluid::Fluid3D::init().
| void sofa::component::behaviormodel::eulerianfluid::Grid3D::step | ( | Grid3D * | prev, | |
| Grid3D * | temp, | |||
| real | dt = 0.04, |
|||
| real | diff = 0.00001 | |||
| ) |
Definition at line 210 of file Grid3D.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::Fluid3D::updatePosition().
| void sofa::component::behaviormodel::eulerianfluid::Grid3D::step_advect | ( | const Grid3D * | prev, | |
| Grid3D * | temp, | |||
| real | dt, | |||
| real | diff | |||
| ) |
Definition at line 867 of file Grid3D.cpp.
References fdata, FOR_INNER_CELLS, index(), ncell, and sofa::component::behaviormodel::eulerianfluid::Grid3D::Cell::u.
Referenced by step().
| void sofa::component::behaviormodel::eulerianfluid::Grid3D::step_color | ( | const Grid3D * | prev, | |
| Grid3D * | temp, | |||
| real | dt, | |||
| real | diff | |||
| ) |
| void sofa::component::behaviormodel::eulerianfluid::Grid3D::step_diffuse | ( | const Grid3D * | prev, | |
| Grid3D * | temp, | |||
| real | dt, | |||
| real | diff | |||
| ) |
Definition at line 900 of file Grid3D.cpp.
References fdata, FOR_INNER_CELLS, index(), ncell, and sofa::component::behaviormodel::eulerianfluid::Grid3D::Cell::u.
Referenced by step().
| void sofa::component::behaviormodel::eulerianfluid::Grid3D::step_forces | ( | const Grid3D * | prev, | |
| Grid3D * | temp, | |||
| real | dt, | |||
| real | diff, | |||
| real | scale = 1.0 | |||
| ) |
Definition at line 634 of file Grid3D.cpp.
References sofa::defaulttype::Vec< N, real >::clear(), fdata, FOR_INNER_CELLS, gravity, index(), levelset, LEVELSET_MARGIN, PART_EMPTY, PART_FULL, sofa::helper::rceil(), t, tend, sofa::component::behaviormodel::eulerianfluid::Grid3D::Cell::type, and sofa::component::behaviormodel::eulerianfluid::Grid3D::Cell::u.
Referenced by step().
| void sofa::component::behaviormodel::eulerianfluid::Grid3D::step_init | ( | const Grid3D * | prev, | |
| Grid3D * | temp, | |||
| real | dt, | |||
| real | diff | |||
| ) |
Definition at line 237 of file Grid3D.cpp.
References fdata, FOR_ALL_CELLS, levelset, LEVELSET_MARGIN, nx, ny, nz, obstacles, PART_EMPTY, PART_FULL, PART_WALL, and sofa::component::behaviormodel::eulerianfluid::Grid3D::Cell::type.
Referenced by step().
| void sofa::component::behaviormodel::eulerianfluid::Grid3D::step_levelset | ( | Grid3D * | prev, | |
| Grid3D * | temp, | |||
| real | dt, | |||
| real | diff | |||
| ) |
Definition at line 280 of file Grid3D.cpp.
References FOR_INNER_CELLS, getlevelset(), interp(), levelset, and sofa::helper::rabs().
Referenced by step().
| void sofa::component::behaviormodel::eulerianfluid::Grid3D::step_project | ( | const Grid3D * | prev, | |
| Grid3D * | temp, | |||
| real | dt, | |||
| real | diff | |||
| ) |
Definition at line 927 of file Grid3D.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::Grid3D::Cell::type, and sofa::component::behaviormodel::eulerianfluid::Grid3D::Cell::u.
Referenced by step().
| void sofa::component::behaviormodel::eulerianfluid::Grid3D::step_surface | ( | const Grid3D * | prev, | |
| Grid3D * | temp, | |||
| real | dt, | |||
| real | diff | |||
| ) |
Definition at line 736 of file Grid3D.cpp.
References fdata, FOR_SURFACE_CELLS, index(), and sofa::component::behaviormodel::eulerianfluid::Grid3D::Cell::u.
Referenced by step().
Definition at line 75 of file Grid3D.h.
Referenced by clear(), get(), seed(), step_advect(), step_diffuse(), step_forces(), step_init(), step_project(), step_surface(), and ~Grid3D().
Definition at line 300 of file Grid3D.h.
Referenced by clear(), fmm_pop(), fmm_push(), fmm_swap(), and ~Grid3D().
Definition at line 299 of file Grid3D.h.
Referenced by clear(), fmm_pop(), fmm_push(), fmm_swap(), and ~Grid3D().
Definition at line 86 of file Grid3D.h.
Referenced by step_forces(), and sofa::component::behaviormodel::eulerianfluid::Fluid3D::updatePosition().
Definition at line 77 of file Grid3D.h.
Referenced by clear(), fmm_pop(), fmm_push(), getlevelset(), seed(), step_forces(), step_init(), step_levelset(), sofa::component::behaviormodel::eulerianfluid::Fluid3D::updateVisual(), and ~Grid3D().
Definition at line 71 of file Grid3D.h.
Referenced by clear(), step_advect(), step_diffuse(), and step_project().
Definition at line 71 of file Grid3D.h.
Referenced by clamp_in_x(), clamp_x(), clear(), fmm_pop(), fmm_push(), get(), index(), seed(), and step_init().
Definition at line 71 of file Grid3D.h.
Referenced by clamp_in_y(), clamp_y(), clear(), get(), seed(), and step_init().
Definition at line 71 of file Grid3D.h.
Referenced by clamp_in_z(), clamp_z(), clear(), get(), seed(), and step_init().
const unsigned long * sofa::component::behaviormodel::eulerianfluid::Grid3D::obstacles = NULL [static] |
Definition at line 76 of file Grid3D.h.
Referenced by clear(), getpressure(), step_project(), and ~Grid3D().
Definition at line 80 of file Grid3D.h.
Referenced by clear(), sofa::component::behaviormodel::eulerianfluid::Fluid3D::init(), step(), and step_forces().
Definition at line 81 of file Grid3D.h.
Referenced by clear(), sofa::component::behaviormodel::eulerianfluid::Fluid3D::init(), step(), and step_forces().
1.5.7.1