ESyS-Particle
4.0.1
|
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 __LINEARDASHPOTINTERACTION_H 00014 #define __LINEARDASHPOTINTERACTION_H 00015 00016 #include "Model/IGParam.h" 00017 #include "Model/Interaction.h" 00018 #include "Model/Particle.h" 00019 00020 00024 class CLinearDashpotIGP : public AIGParam 00025 { 00026 public: 00027 double m_damp; 00028 double m_cutoff; 00029 00030 CLinearDashpotIGP(); 00031 CLinearDashpotIGP(const std::string&,double,double); 00032 00033 virtual std::string getTypeString() const {return "LinearDashpot";} 00034 }; 00035 00043 class CLinearDashpotInteraction : public APairInteraction 00044 { 00045 public: 00046 00047 typedef double (CLinearDashpotInteraction::* ScalarFieldFunction)() const; 00048 typedef Vec3 (CLinearDashpotInteraction::* VectorFieldFunction)() const; 00049 typedef pair<bool,double> (CLinearDashpotInteraction::* CheckedScalarFieldFunction)() const; 00050 00051 static ScalarFieldFunction getScalarFieldFunction(const string&); 00052 static VectorFieldFunction getVectorFieldFunction(const string&); 00053 static CheckedScalarFieldFunction getCheckedScalarFieldFunction(const string&); 00054 00055 private: 00056 double m_damp; 00057 double m_cutoff; 00058 double m_cross_section; 00059 Vec3 m_force; // caching force for E_pot 00060 Vec3 m_cpos; // center position 00061 00062 public: 00063 typedef CLinearDashpotIGP ParameterType; 00064 00065 CLinearDashpotInteraction(CParticle*,CParticle*,const CLinearDashpotIGP&); 00066 virtual ~CLinearDashpotInteraction(){}; 00067 00068 virtual Vec3 getPos() const {return m_cpos;}; 00069 double getPotentialEnergy() const; 00070 00071 virtual void calcForces(); 00072 Vec3 getForce() const; 00073 }; 00074 #endif //__HERTZIANELASTICINTERACTION_H