00001 #ifndef OPENTISSUE_DYNAMICS_MBD_MBD_STEPPER_INTERFACE_H 00002 #define OPENTISSUE_DYNAMICS_MBD_MBD_STEPPER_INTERFACE_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 namespace OpenTissue 00013 { 00014 namespace mbd 00015 { 00016 00017 template< typename mbd_types > 00018 class StepperInterface 00019 { 00020 protected: 00021 00022 typedef typename mbd_types::configuration_type configuration_type; 00023 typedef typename mbd_types::math_policy::real_type real_type; 00024 typedef typename mbd_types::group_type group_type; 00025 00026 protected: 00027 00028 configuration_type * m_configuration; 00029 00030 00031 public: 00032 00033 StepperInterface() 00034 : m_configuration(0) 00035 {} 00036 00037 virtual ~StepperInterface(){} 00038 00039 public: 00040 00041 00042 void connect(configuration_type & configuration) 00043 { 00044 m_configuration = &configuration; 00045 } 00046 00047 void clear() 00048 { 00049 this->m_configuration = 0; 00050 } 00051 00052 public: 00053 00054 virtual void resolve_collisions(group_type & group) = 0; 00055 virtual void error_correction(group_type & group) = 0; 00056 virtual void run(group_type & group,real_type const & time_step) = 0; 00057 00058 }; 00059 00060 } // namespace mbd 00061 } // namespace OpenTissue 00062 // OPENTISSUE_DYNAMICS_MBD_MBD_STEPPER_INTERFACE_H 00063 #endif