00001 #ifndef OPENTISSUE_DYNAMICS_FEM_FEM_NODE_TRAITS_H 00002 #define OPENTISSUE_DYNAMICS_FEM_FEM_NODE_TRAITS_H 00003 // 00004 // OpenTissue Template Library 00005 // - A generic toolbox for physics-based modeling and simulation. 00006 // Copyright (C) 2008 Department of Computer Science, University of Copenhagen. 00007 // 00008 // OTTL is licensed under zlib: http://opensource.org/licenses/zlib-license.php 00009 // 00010 #include <OpenTissue/configuration.h> 00011 00012 #include <map> 00013 00014 namespace OpenTissue 00015 { 00016 namespace fem 00017 { 00018 namespace detail 00019 { 00020 00021 template <typename math_types> 00022 class NodeTraits 00023 { 00024 public: 00025 00026 typedef typename math_types::real_type real_type; 00027 typedef typename math_types::vector3_type vector3_type; 00028 typedef typename math_types::matrix3x3_type matrix3x3_type; 00029 00030 typedef typename std::map<int,matrix3x3_type> matrix_container; 00031 typedef typename matrix_container::iterator matrix_iterator; 00032 00033 public: 00034 00035 matrix_container m_K_row; 00036 matrix_container m_A_row; 00037 vector3_type m_f0; 00038 vector3_type m_b; 00039 00040 bool m_fixed; 00041 00042 vector3_type m_model_coord; 00043 vector3_type m_coord; 00044 00045 vector3_type m_velocity; 00046 real_type m_mass; 00047 vector3_type m_f_external; 00048 00049 // Needed by the ConjugateGradient method 00050 vector3_type m_update; 00051 vector3_type m_prev; 00052 vector3_type m_residual; 00053 00054 public: 00055 00056 matrix_iterator Kbegin() { return m_K_row.begin(); } 00057 matrix_iterator Kend() { return m_K_row.end(); } 00058 matrix_iterator Abegin() { return m_A_row.begin(); } 00059 matrix_iterator Aend() { return m_A_row.end(); } 00060 00061 matrix3x3_type & K(int const & column_idx) { return m_K_row[column_idx]; } 00062 matrix3x3_type & A(int const & column_idx) { return m_A_row[column_idx]; } 00063 00064 public: 00065 00066 NodeTraits() 00067 : m_fixed(false) 00068 {} 00069 00070 }; 00071 00072 } // namespace detail 00073 } // namespace fem 00074 } // namespace OpenTissue 00075 00076 //OPENTISSUE_DYNAMICS_FEM_FEM_NODE_TRAITS_H 00077 #endif