Go to the documentation of this file.00001 #ifndef OPENTISSUE_DYNAMICS_FEM_FEM_INITIALIZE_PLASTIC_H
00002 #define OPENTISSUE_DYNAMICS_FEM_FEM_INITIALIZE_PLASTIC_H
00003
00004
00005
00006
00007
00008
00009
00010 #include <OpenTissue/configuration.h>
00011
00012 #include <OpenTissue/dynamics/fem/fem_compute_b.h>
00013 #include <OpenTissue/dynamics/fem/fem_compute_isotropic_elasticity.h>
00014
00015 namespace OpenTissue
00016 {
00017 namespace fem
00018 {
00019 namespace detail
00020 {
00033 template < typename tetrahedron_iterator,typename real_type >
00034 inline void initialize_plastic(
00035 tetrahedron_iterator begin
00036 , tetrahedron_iterator end
00037 , real_type const & c_yield
00038 , real_type const & c_creep
00039 , real_type const & c_max
00040 )
00041 {
00042 assert(c_yield>=0 || !"initialize_plastic(): yield must be non-negative");
00043 assert(c_creep>=0 || !"initialize_plastic(): creep must be non-negative");
00044 assert(c_max>=0 || !"initialize_plastic(): max must be non-negative");
00045
00046 for (tetrahedron_iterator T = begin; T != end; ++T)
00047 {
00048 T->m_yield = c_yield;
00049 T->m_creep = c_creep;
00050 T->m_max = c_max;
00051 for(int i=0;i<6;++i)
00052 T->m_plastic[i] = 0;
00053
00054 compute_B(T->m_e10, T->m_e20, T->m_e30, T->m_V, T->m_B);
00055 compute_isotropic_elasticity_vector (T->m_young, T->m_poisson, T->m_D);
00056 }
00057 }
00058
00059 }
00060 }
00061 }
00062
00063
00064 #endif