#include <swe_shallow_water_equation.h>
List of all members.
Public Types |
typedef real_type_ | real_type |
typedef boost::multi_array
< real_type, 2 > | array_type |
typedef unsigned int | index_type |
typedef
ublas::compressed_matrix
< real_type > | matrix_type |
typedef ublas::vector< real_type > | vector_type |
Public Member Functions |
| ShallowWaterEquations () |
| ~ShallowWaterEquations () |
void | init (const unsigned int M, const unsigned int N, const real_type width, const real_type height) |
void | clear () |
void | draw (const bool debugMode) const |
void | run (const real_type time_step, bool statistics=false) |
void | setSeaVelocity (const unsigned int i, const unsigned int j, const real_type vx, const real_type vy) |
void | setSeaHeight (const unsigned int i, const unsigned int j, const real_type height) |
void | setSeaBottom (const unsigned int i, const unsigned int j, const real_type bottom) |
void | setShore (const unsigned int i, const unsigned int j, const bool shore) |
Protected Member Functions |
void | set_height (vector_type &h_new) |
void | assemble (matrix_type &A, vector_type &rhs) const |
void | compute_depth () |
void | compute_departure_points () |
void | compute_value_at_departure_points (array_type &value, array_type &value_tilde) |
void | update_u () |
void | update_v () |
void | apply_velocity_constraints () |
void | nullify () |
Protected Attributes |
real_type | g |
| Gravitation constant.
|
real_type | timestep |
| The current timestep size used.
|
unsigned int | X |
| Number of grid nodes along the x-direction.
|
unsigned int | Y |
| Number of grid nodes along the y-direction.
|
real_type | dx |
| Step size between two neighboring nodes in the x-direction.
|
real_type | dy |
| Step size between two neighboring nodes in the y-direction.
|
array_type | water |
| Boolean flag indicating which grid nodes are water and which ones are solid ``earth''.
|
array_type | b |
| Bottom height.
|
array_type | h |
| Water height.
|
array_type | u |
| Water velocity in x-direction.
|
array_type | v |
| Water velocity in y-direction.
|
array_type | d |
| Water Depth Grid, defined as: d = h - b.
|
array_type | h_tilde |
| Water height at departure points.
|
array_type | u_tilde |
| Water velocity in x-direction at departure points.
|
array_type | v_tilde |
| Water velocity in y-direction at departure points.
|
array_type | x_tilde |
| The x-coordinate of the departure points.
|
array_type | y_tilde |
| The y-coordinate of the departure points.
|
matrix_type | A |
vector_type | hnew |
vector_type | rhs |
Detailed Description
template<typename real_type_ = double>
class OpenTissue::swe::ShallowWaterEquations< real_type_ >
Shallow Water Equations.
Implementation is based on the paper:
Anita T. Layton and Michiel van de Panne, `` A Numerically Efficient and Stable Algorithm for Animating Water Waves ,'' the Visual Computer, Vol. 18, No. 1, pp. 41-53, 2002
http://www.amath.unc.edu/Faculty/layton/research/water/index.html
Member Typedef Documentation
template<typename real_type_ = double>
template<typename real_type_ = double>
template<typename real_type_ = double>
template<typename real_type_ = double>
template<typename real_type_ = double>
Constructor & Destructor Documentation
template<typename real_type_ = double>
template<typename real_type_ = double>
Member Function Documentation
template<typename real_type_ = double>
Constaint velocities along wall's to have zero normal component
template<typename real_type_ = double>
template<typename real_type_ = double>
template<typename real_type_ = double>
Computes departure points, implicitly assumes that velocities have been computed prior to invocation
template<typename real_type_ = double>
Computes water depth, assumes that water height have been computed prior to invocation.
template<typename real_type_ = double>
Implicitly assumes that departure points have been computed prior to invocation
template<typename real_type_ = double>
Draw water height field
- Parameters:
-
| debugMode | Boolean variable indicating wheter the water simulation is drawn in debug mode or not. |
template<typename real_type_ = double>
template<typename real_type_ = double>
template<typename real_type_ = double>
template<typename real_type_ = double>
template<typename real_type_ = double>
Set Bottom Height
- Parameters:
-
| i | The index of water node grid along x-axe direction |
| j | The index of water node grid along x-axe direction |
| height | The new bottom height value of the (i,j) water grid node. |
template<typename real_type_ = double>
Set Water Height
- Parameters:
-
| i | The index of water node grid along x-axe direction |
| j | The index of water node grid along x-axe direction |
| height | The new height value of the (i,j) water grid node. |
template<typename real_type_ = double>
Set Water Velocity
- Parameters:
-
| i | The index of water node grid along x-axe direction |
| j | The index of water node grid along x-axe direction |
| vx | The new x-direction velocity of the (i,j) water grid node. |
| vy | The new x-direction velocity of the (i,j) water grid node. |
template<typename real_type_ = double>
Set Shore
- Parameters:
-
| i | The index of water node grid along x-axe direction |
| j | The index of water node grid along x-axe direction |
| shore | If true the (i,j) grid node is set to be shore if false the node is water. |
template<typename real_type_ = double>
Implicitly assumes that new height field have been stored.
template<typename real_type_ = double>
Implicitly assumes that new height field have been stored.
Member Data Documentation
template<typename real_type_ = double>
template<typename real_type_ = double>
template<typename real_type_ = double>
Water Depth Grid, defined as: d = h - b.
template<typename real_type_ = double>
Step size between two neighboring nodes in the x-direction.
template<typename real_type_ = double>
Step size between two neighboring nodes in the y-direction.
template<typename real_type_ = double>
template<typename real_type_ = double>
template<typename real_type_ = double>
Water height at departure points.
template<typename real_type_ = double>
template<typename real_type_ = double>
template<typename real_type_ = double>
The current timestep size used.
template<typename real_type_ = double>
Water velocity in x-direction.
template<typename real_type_ = double>
Water velocity in x-direction at departure points.
template<typename real_type_ = double>
Water velocity in y-direction.
template<typename real_type_ = double>
Water velocity in y-direction at departure points.
template<typename real_type_ = double>
Boolean flag indicating which grid nodes are water and which ones are solid ``earth''.
template<typename real_type_ = double>
Number of grid nodes along the x-direction.
template<typename real_type_ = double>
The x-coordinate of the departure points.
template<typename real_type_ = double>
Number of grid nodes along the y-direction.
template<typename real_type_ = double>
The y-coordinate of the departure points.
The documentation for this class was generated from the following file: