ESyS-Particle  4.0.1
ShortBondedInteraction.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 __SHORTBONDEDINTERACTION_H
00014 #define __SHORTBONDEDINTERACTION_H
00015 
00016 // -- project includes --
00017 #include "Model/IGParam.h" // keep this one first - it drags in mpi.h
00018 #include "Model/Interaction.h"
00019 #include "Model/Particle.h"
00020 #include "Model/BondedInteraction.h" 
00021 #include "Model/ShortBondedInteractionCpData.h"
00022 #include "Foundation/vec3.h"
00023 
00024 
00032 class CShortBondedInteraction : public CBondedInteraction
00033 {
00034  public: // types
00035   typedef CBondedIGP ParameterType;
00039   typedef ShortBondedInteractionCpData CheckPointable;
00040 
00041   typedef double (CShortBondedInteraction::* ScalarFieldFunction)() const;
00042   typedef pair<bool,double> (CShortBondedInteraction::* CheckedScalarFieldFunction)() const;
00043   typedef Vec3 (CShortBondedInteraction::* VectorFieldFunction)() const;
00044 
00045  private:
00046   
00047  public:
00048   CShortBondedInteraction();
00049   CShortBondedInteraction(CParticle*,CParticle*,const CBondedIGP&);
00050 
00051   virtual ~CShortBondedInteraction();
00052 
00053   static ScalarFieldFunction getScalarFieldFunction(const string&);
00054   static CheckedScalarFieldFunction getCheckedScalarFieldFunction(const string&);
00055   static VectorFieldFunction getVectorFieldFunction(const string&);
00056 
00057   static string getType() {return "ShortBonded";};
00058   double getEquiDist() const {return m_r0;};
00059 
00060   void saveCheckPointData(std::ostream &oStream);
00061   void loadCheckPointData(std::istream &iStream);
00062 
00063   friend ostream& operator<<(ostream&,const CBondedInteraction&);
00064   friend class TML_PackedMessageInterface;
00065 };
00066 
00067 
00068 #endif // __SHORTBONDEDINTERACTION_H