Namespaces | |
namespace | detail |
Classes | |
class | Mesh |
Functions | |
template<typename fem_mesh , typename matrix_type > | |
void | export_K (fem_mesh &mesh, matrix_type &bigK) |
template<typename fem_mesh , typename real_type > | |
void | init (fem_mesh &mesh, real_type const &young, real_type const &poisson, real_type const &density, real_type const &c_yield, real_type const &c_creep, real_type const &c_max) |
template<typename fem_mesh , typename real_type > | |
void | simulate (fem_mesh &mesh, real_type const &time_step, bool use_stiffness_warping) |
template<typename node_iterator > | |
void | update_original_coord (node_iterator const &begin, node_iterator const &end) |
void OpenTissue::fem::export_K | ( | fem_mesh & | mesh, | |
matrix_type & | bigK | |||
) | [inline] |
void OpenTissue::fem::init | ( | fem_mesh & | mesh, | |
real_type const & | young, | |||
real_type const & | poisson, | |||
real_type const & | density, | |||
real_type const & | c_yield, | |||
real_type const & | c_creep, | |||
real_type const & | c_max | |||
) | [inline] |
Initialize Data Structres. Should be invoked at start-up before any calls to animate_warping.
This function assumes that mesh geometry have been set up prior to invokation (i.e. both world coord and orignial coord are initlized and the same).
This method initialized the model with the same material parameters. End user could write his or her own initilization method replacing the steps where young modules, poisson ratio and densities are assigned to the model.
mesh | ||
young | Young Moduls, a value of 500000 seems work quite well. | |
poisson | Poisson ration, a value of 0.33 seems work quite well. | |
density | Mass density, a value of 1000 seems to work quite well. | |
c_yield | Plastic yield. | |
c_creep | Plastic creep. | |
c_max | Plastic max. |
void OpenTissue::fem::simulate | ( | fem_mesh & | mesh, | |
real_type const & | time_step, | |||
bool | use_stiffness_warping | |||
) | [inline] |
Simulate. Note external forces must have been computed prior to invocation.
The dynamic equation has the following form (where u=x-x_0, and x' is derivative wrt. time)
M x'' + Cx' + K (x-x_0) = f_ext
This can be transformed to a system of 2x3n equations of first order derivative:
x' = v M v' = - C v - K (x-x_0) + f_ext
The semi-implicit Euler scheme approximates the above with:
x^(i+1) = x^i + t * v^(i+1) M v^(i+1) = M v^i + t ( - C v^(i+1) - K ( x^i - x_0 ) + f^i_ext
This is solved using implicit integration.
mesh | ||
time_step | ||
use_stiffness_warping |
void OpenTissue::fem::update_original_coord | ( | node_iterator const & | begin, | |
node_iterator const & | end | |||
) | [inline] |
Update original coords with world coords.
Note: This completely destroys any prior initialization of force offset (f0 in stiffness elements initialization). Therefore these must be re-initialized after invocation of this function.
begin | ||
end |