ESyS-Particle  4.0.1
DampingIGP.h
00001 
00002 //                                                         //
00003 // Copyright (c) 2003-2011 by The University of Queensland //
00004 // Earth Systems Science Computational Centre (ESSCC)      //
00005 // http://www.uq.edu.au/esscc                              //
00006 //                                                         //
00007 // Primary Business: Brisbane, Queensland, Australia       //
00008 // Licensed under the Open Software License version 3.0    //
00009 // http://www.opensource.org/licenses/osl-3.0.php          //
00010 //                                                         //
00012 
00013 #ifndef __DAMPING_IGP_H
00014 #define __DAMPING_IGP_H
00015 
00016 // -- project includes --
00017 #include "Model/IGParam.h"
00018 #include "Foundation/vec3.h"
00019 // -- STL includes --
00020 #include <string>
00021 
00022 using std::string;
00023  
00027 class CDampingIGP : public AIGParam
00028 {
00029 protected:
00030   string m_type; // type of damping (rot/lin)
00031   Vec3 m_vref; 
00032   double m_visc; 
00033   double m_dt;   
00034   int m_max_iter; 
00035 
00036 public:
00037   CDampingIGP();
00038   CDampingIGP(const string& type,
00039     const string &name,
00040     double viscosity,
00041     double dt,
00042     int maxIteractions,
00043     const Vec3 &refVelocity = Vec3::ZERO
00044   );
00045   
00046   virtual void  packInto(CVarMPIBuffer*) const;
00047   void setType(const string& type){m_type=type;}
00048   void setVRef(const Vec3 V){m_vref=V;}
00049   Vec3 getVRef()const{return m_vref;}
00050   void setVisc(double v){m_visc=v;}
00051   double getVisc()const{return m_visc;}
00052   void setTimeStep(double t){m_dt=t;}
00053   void setTimeStepSize(double t){setTimeStep(t);}
00054   double getTimeStep()const{return m_dt;}
00055   void setMaxIter(int mi){m_max_iter=mi;}
00056   int getMaxIter()const {return m_max_iter;}
00057   
00058   virtual std::string getTypeString() const {return m_type;}
00059 };
00060 
00061 CDampingIGP* extractDampingIGP(AMPIBuffer*);
00062 
00063 #endif //__DAMPING_IGP_H