ESyS-Particle  4.0.1
RotThermElasticInteraction.h
1 
2 // //
3 // Copyright (c) 2003-2011 by The University of Queensland //
4 // Earth Systems Science Computational Centre (ESSCC) //
5 // http://www.uq.edu.au/esscc //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 #ifndef __ROTTHERMELASTICINTERACTION_H
14 #define __ROTTHERMELASTICINTERACTION_H
15 
16 #include "Model/RotThermPairInteraction.h"
17 #include "Model/RotThermParticle.h"
18 #include "Model/IGParam.h"
19 
24 {
25  protected:
26  public:
28 
30  const std::string &name,
31  double normalK,
32  double diffusivity
33  );
34 
35  double m_kr;
36  double diffusivity ;
37 
38  virtual void packInto(CVarMPIBuffer*) const;
39  void setSpringConst(double k){m_kr=k;};
40  double getSpringConst() const{return m_kr;};
41 
42 
43  void setDiffusivity(double d){diffusivity = d;};
44  double getDiffusivity() const{return diffusivity ; };
45 
46 
47  friend ostream& operator<<(ostream&,const CRotThermElasticIGP&);
48 
49  virtual std::string getTypeString() const
50  {
51  return "RotThermElastic";
52  }
53 };
54 
55 CRotThermElasticIGP* extractRotThermElasticIGP(AMPIBuffer*);
56 CRotThermElasticIGP* extractRotThermElasticIGP_p(AMPIBuffer*);
57 
62 {
63 public:
64  typedef double (CRotThermElasticInteraction::* ScalarFieldFunction)() const;
65  typedef pair<bool,double> (CRotThermElasticInteraction::* CheckedScalarFieldFunction)() const;
66  typedef Vec3 (CRotThermElasticInteraction::* VectorFieldFunction)() const;
67 
68  static ScalarFieldFunction getScalarFieldFunction(const string&);
69  static CheckedScalarFieldFunction getCheckedScalarFieldFunction(const string&);
70  static VectorFieldFunction getVectorFieldFunction(const string&);
71 
72 private:
73  double m_kr;
74  Vec3 m_force;
75  double m_nForce;
76  Vec3 m_cpos;
77  Vec3 m_D;
78  double m_diffusivity;
79 
80 public:
82 
85  virtual ~CRotThermElasticInteraction(){};
86 
87  virtual Vec3 getPos() const {return m_cpos;};
88 
89  static string getType(){return "RotThermElastic";}
90 
91  virtual void calcForces();
92  void calcHeatTrans() ;
93 // void calcHeatFrict(){} ;
94 
95  Vec3 getForce() const;
96  double getPotentialEnergy() const;
97 //26/Mar added
98  Vec3 getBondedVector() const ;
99 
100  friend ostream& operator<<(ostream&,const CRotThermElasticInteraction&);
101 
102  // save/load of restart parameters
103  virtual void saveRestartData(std::ostream &oStream);
104  virtual void loadRestartData(std::istream &iStream);
105 };
106 #endif //__ELASTICINTERACTION_H