ESyS-Particle  2.3.4
RotThermBondedInteraction.h
Go to the documentation of this file.
1 // //
3 // Copyright (c) 2003-2017 by The University of Queensland //
4 // Centre for Geoscience Computing //
5 // http://earth.uq.edu.au/centre-geoscience-computing //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.apache.org/licenses/LICENSE-2.0 //
10 // //
12 
13 #ifndef __ROTTHERMBONDEDINTERACTION_H
14 #define __ROTTHERMBONDEDINTERACTION_H
15 
16 // -- project includes --
18 #include "Model/RotThermParticle.h"
19 #include "Model/InteractionParam.h"
21 #include "Foundation/vec3.h"
22 #include "Model/IGParam.h"
23 
24 // -- I/O includes --
25 #include <iostream>
26 using std::ostream;
27 
32  double calc_angle( double , double ) ;
33 
35 {
38  const std::string &name,
39  double kr,
40  double ks,
41  double kt,
42  double kb,
43  double max_nForce,
44  double max_shForce,
45  double max_tMoment,
46  double max_bMoment,
47  double diffusivity,
48  int tag
49  );
50 
51  double kr,ks,kt,kb ;
53  double diffusivity ;
54  int tag;
55 
56  virtual std::string getTypeString() const
57  {
58  return "RotThermBonded";
59  }
60 };
61 
67 {
68  public: // types
70 
75 
76  typedef double (CRotThermBondedInteraction::* ScalarFieldFunction)() const;
77  typedef pair<bool,double> (CRotThermBondedInteraction::* CheckedScalarFieldFunction)() const;
79 
80  private:
81 
82  // protected:
83  double m_dist;
84  double m_min_r;
85  double m_kr ;
86  double m_ks ;
87  double m_kb ;
88  double m_kt ;
89 
90  double m_diffusivity ;
91 
92 
93  double m_max_nForce; // always >0
94  double m_max_shForce ;
95  double m_max_tMoment ;
96  double m_max_bMoment ;
97 
98  double m_nForce; // >0, pulling; <0 , compressing
99  double m_shForce ; // always >0
100  double m_tMoment ;
101  double m_bMoment ;
102 
105 
106  Vec3 m_cpos; // ?
107  int m_tag;
108 
109  public:
110 
113  virtual ~CRotThermBondedInteraction();
114 
115  static ScalarFieldFunction getScalarFieldFunction(const string&);
117  static VectorFieldFunction getVectorFieldFunction(const string&);
118 
119  static string getType(){return "RotThermBonded";};
120 
121  int getTag() const;
122  void setTag(int tag);
123 
124  void calcForces();
125  void calcHeatTrans() ;
126  //void setBreak(double);
127  bool broken();
128 
129 //26/Mar added !
130  Vec3 getBondedVector1() const;
131  Vec3 getBondedVector2() const;
132 
133  double getPotentialEnergy() const;
134  double getNormalPotentialEnergy() const;
135  double getShearPotentialEnergy() const;
136  double getTwistPotentialEnergy() const;
137  double getBendPotentialEnergy() const;
138  double getCriterion() const;
139  Vec3 getForce() const;
140  virtual Vec3 getPos() const {return m_cpos;};
141 
142  Vec3 getCentrePtDiff() const;
144  Vec3 getInitialMidPoint() const;
145 
146  Vec3 getShearDiff() const;
147 
148  friend ostream& operator<<(ostream&,const CRotThermBondedInteraction&);
150 
151  virtual void saveCheckPointData(std::ostream &oStream);
152 
153  virtual void loadCheckPointData(std::istream &iStream);
154 
155  // save/load of restart parameters
156  virtual void saveRestartData(std::ostream &oStream);
157  virtual void loadRestartData(std::istream &iStream);
158 };
159 
160 #endif //__BONDEDINTERACTION_H
CRotThermBondedInteraction::getBondedVector2
Vec3 getBondedVector2() const
Definition: RotThermBondedInteraction.cpp:811
InteractionParam.h
CRotThermBondedInteraction::m_min_r
double m_min_r
Definition: RotThermBondedInteraction.h:84
CRotThermBondedInteraction::calcForces
void calcForces()
Definition: RotThermBondedInteraction.cpp:560
CRotThermBondedInteraction::loadRestartData
virtual void loadRestartData(std::istream &iStream)
Definition: RotThermBondedInteraction.cpp:982
TML_PackedMessageInterface
Abstract base/interface class for packed messages to be used in TML_Pack.
Definition: packed_message_interface.h:29
CRotThermBondedInteraction::saveCheckPointData
virtual void saveCheckPointData(std::ostream &oStream)
Definition: RotThermBondedInteraction.cpp:885
CRotThermBondedInteraction::m_max_bMoment
double m_max_bMoment
Definition: RotThermBondedInteraction.h:96
CRotThermBondedInteraction::getScalarFieldFunction
static ScalarFieldFunction getScalarFieldFunction(const string &)
Definition: RotThermBondedInteraction.cpp:825
CRotThermBondedInteraction::m_kb
double m_kb
Definition: RotThermBondedInteraction.h:87
Quaternion::return_sca
QUATERNION_INLINE double return_sca() const
Definition: Quaternion.h:81
CRotThermBondedInteraction::getCheckedScalarFieldFunction
static CheckedScalarFieldFunction getCheckedScalarFieldFunction(const string &)
Definition: RotThermBondedInteraction.cpp:875
CRotThermBondedInteraction::VectorFieldFunction
Vec3(CRotThermBondedInteraction::* VectorFieldFunction)() const
Definition: RotThermBondedInteraction.h:78
CRotThermBondedInteraction::getPotentialEnergy
double getPotentialEnergy() const
Definition: RotThermBondedInteraction.cpp:770
calc_angle
double calc_angle(double, double)
Definition: RotBondedInteraction.cpp:22
CRotThermBondedInteraction::CRotThermBondedInteraction
CRotThermBondedInteraction()
Definition: RotThermBondedInteraction.cpp:96
CThermParticle::getTemperature
double getTemperature() const
Definition: ThermParticle.h:81
Console::Debug
Console & Debug()
set verbose level of next message to "dbg"
CRotThermBondedInteraction::getVectorFieldFunction
static VectorFieldFunction getVectorFieldFunction(const string &)
Definition: RotThermBondedInteraction.cpp:856
CParticle::getInitPos
const Vec3 & getInitPos() const
Definition: Particle.h:109
CRotThermBondedInteraction::saveRestartData
virtual void saveRestartData(std::ostream &oStream)
Definition: RotThermBondedInteraction.cpp:960
AInteraction::Count
double Count() const
Definition: Interaction.h:56
CRotThermBondedInteraction::getShearDiff
Vec3 getShearDiff() const
Definition: RotThermBondedInteraction.cpp:385
CRotParticleVi::getQuat
Quaternion getQuat() const
Definition: RotParticleVi.h:169
dot
VEC3_INLINE double dot(const Vec3 &v1, const Vec3 &v2)
Definition: vec3.hpp:196
CRotThermParticle::applyHeatTrans
void applyHeatTrans(const double)
Definition: RotThermParticle.cpp:516
console.h
CRotBondedInteraction::m_kr
double m_kr
spring constant
Definition: RotBondedInteraction.h:114
CRotThermBondedInteraction::m_ks
double m_ks
Definition: RotThermBondedInteraction.h:86
CRotThermBondedInteraction::getPos
virtual Vec3 getPos() const
Definition: RotThermBondedInteraction.h:140
CRotThermBondedInteraction::getType
static string getType()
Definition: RotThermBondedInteraction.h:119
CRotThermBondedInteraction
Definition: RotThermBondedInteraction.h:67
AInteraction::m_init
bool m_init
Definition: Interaction.h:41
TML_PackedMessageInterface::pop_int
virtual int pop_int()=0
CRotThermBondedInteraction::getInitialCentrePtDiff
Vec3 getInitialCentrePtDiff() const
Definition: RotThermBondedInteraction.cpp:360
Matrix3::trans
MATRIX3_INLINE Matrix3 trans() const
return transposed
Definition: Matrix3.hpp:108
CRotThermBondedInteraction::m_nForce
double m_nForce
Definition: RotThermBondedInteraction.h:98
cross
VEC3_INLINE Vec3 cross(const Vec3 &lhs, const Vec3 &rhs)
Definition: vec3.hpp:187
Vec3::norm
VEC3_INLINE double norm() const
Definition: vec3.hpp:211
CRotThermBondedIGP::ks
double ks
Definition: RotThermBondedInteraction.h:51
RotThermParticle.h
CParticle::applyForce
void applyForce(const Vec3 &, const Vec3 &)
Definition: Particle.cpp:384
CParticle::setFlag
void setFlag(bool b=true)
Definition: Particle.h:140
Vec3::X
VEC3_INLINE double & X()
Definition: vec3.h:119
CRotThermBondedInteraction::getInitialMidPoint
Vec3 getInitialMidPoint() const
Definition: RotThermBondedInteraction.cpp:370
CRotThermBondedInteraction::getCentrePtDiff
Vec3 getCentrePtDiff() const
Definition: RotThermBondedInteraction.cpp:365
ARotPairInteraction::m_p2
CRotParticle * m_p2
Definition: RotPairInteraction.h:31
CRotThermBondedInteraction::m_max_shForce
double m_max_shForce
Definition: RotThermBondedInteraction.h:94
CRotThermBondedIGP::getTypeString
virtual std::string getTypeString() const
Definition: RotThermBondedInteraction.h:56
TML_PackedMessageInterface::pop_double
virtual double pop_double()=0
CRotThermBondedInteraction::ParameterType
CRotThermBondedIGP ParameterType
Definition: RotThermBondedInteraction.h:69
CRotThermBondedIGP::kt
double kt
Definition: RotThermBondedInteraction.h:51
ARotThermPairInteraction
Definition: RotThermPairInteraction.h:24
CRotThermBondedIGP::kb
double kb
Definition: RotThermBondedInteraction.h:51
BondedInteractionCpData.h
Vec3::Z
VEC3_INLINE double & Z()
Definition: vec3.h:121
calc_angle
double calc_angle(double s_in, double c_os)
Definition: RotBondedInteraction.cpp:22
CRotThermBondedIGP
Definition: RotThermBondedInteraction.h:35
NULL
#define NULL
Definition: t_list.h:17
BondedInteractionCpData
Definition: BondedInteractionCpData.h:26
CRotThermBondedInteraction::getTag
int getTag() const
Definition: RotThermBondedInteraction.cpp:238
CRotThermBondedInteraction::CheckedScalarFieldFunction
pair< bool, double >(CRotThermBondedInteraction::* CheckedScalarFieldFunction)() const
Definition: RotThermBondedInteraction.h:77
CRotThermBondedIGP::tag
int tag
Definition: RotThermBondedInteraction.h:54
CRotThermBondedInteraction::m_shForce
double m_shForce
Definition: RotThermBondedInteraction.h:99
CRotThermBondedInteraction::getCriterion
double getCriterion() const
Definition: RotThermBondedInteraction.cpp:377
CRotThermBondedInteraction::getForce
Vec3 getForce() const
Definition: RotThermBondedInteraction.cpp:765
CRotThermBondedInteraction::broken
bool broken()
Definition: RotThermBondedInteraction.cpp:282
Quaternion::to_matrix
QUATERNION_INLINE Matrix3 to_matrix() const
Definition: Quaternion.hpp:273
ARotPairInteraction::m_p1
CRotParticle * m_p1
Definition: RotPairInteraction.h:31
operator<<
ostream & operator<<(ostream &ost, const CRotThermBondedInteraction &BI)
Definition: RotThermBondedInteraction.cpp:1001
CRotBondedInteraction::getShearDiff
Vec3 getShearDiff() const
Definition: RotBondedInteraction.cpp:321
CRotThermParticle
Definition: RotThermParticle.h:55
packed_message_interface.h
TML_PackedMessageInterface::append
virtual void append(int)=0
Vec3::Y
VEC3_INLINE double & Y()
Definition: vec3.h:120
CRotThermBondedIGP::diffusivity
double diffusivity
Definition: RotThermBondedInteraction.h:53
CRotThermBondedInteraction::m_force
Vec3 m_force
current force, cached for E_pot calculation
Definition: RotThermBondedInteraction.h:103
CRotThermBondedInteraction::ScalarFieldFunction
double(CRotThermBondedInteraction::* ScalarFieldFunction)() const
Definition: RotThermBondedInteraction.h:76
CRotThermBondedInteraction::m_kt
double m_kt
Definition: RotThermBondedInteraction.h:88
CRotThermBondedInteraction::m_cpos
Vec3 m_cpos
Definition: RotThermBondedInteraction.h:106
ARotThermPairInteraction::m_p1
CRotThermParticle * m_p1
Definition: RotThermPairInteraction.h:26
CRotThermBondedInteraction::operator<<
friend ostream & operator<<(ostream &, const CRotThermBondedInteraction &)
Definition: RotThermBondedInteraction.cpp:1001
Quaternion
Definition: Quaternion.h:30
Vec3
Definition: vec3.h:47
CParticle::getDo2dCalculations
static bool getDo2dCalculations()
Definition: Particle.h:181
CRotThermBondedInteraction::getNormalPotentialEnergy
double getNormalPotentialEnergy() const
Definition: RotThermBondedInteraction.cpp:781
CRotBondedInteraction::calcForces
void calcForces()
Definition: RotBondedInteraction.cpp:372
AIGParam
Abstract base class for InteractionGroup parameters.
Definition: IGParam.h:29
CRotBondedInteraction::getInitialCentrePtDiff
Vec3 getInitialCentrePtDiff() const
Definition: RotBondedInteraction.cpp:294
CRotParticleVi::applyMoment
void applyMoment(const Vec3 &)
Definition: RotParticleVi.cpp:355
CRotThermBondedIGP::max_shForce
double max_shForce
Definition: RotThermBondedInteraction.h:52
CRotThermBondedInteraction::m_kr
double m_kr
spring constant
Definition: RotThermBondedInteraction.h:85
CRotThermBondedInteraction::m_tMoment
double m_tMoment
Definition: RotThermBondedInteraction.h:100
vec3.h
CRotThermBondedInteraction::getBondedVector1
Vec3 getBondedVector1() const
Definition: RotThermBondedInteraction.cpp:801
ARotThermPairInteraction::m_p2
CRotThermParticle * m_p2
Definition: RotThermPairInteraction.h:26
Matrix3
3x3 Matrix
Definition: Matrix3.h:48
Vec3::norm2
VEC3_INLINE double norm2() const
Definition: vec3.hpp:218
CRotThermBondedInteraction::m_bMoment
double m_bMoment
Definition: RotThermBondedInteraction.h:101
CRotThermBondedInteraction::CheckPointable
BondedInteractionCpData CheckPointable
Definition: RotThermBondedInteraction.h:74
CRotThermBondedInteraction::m_moment
Vec3 m_moment
Definition: RotThermBondedInteraction.h:104
CRotThermBondedInteraction::m_max_tMoment
double m_max_tMoment
Definition: RotThermBondedInteraction.h:95
CRotThermBondedInteraction::m_diffusivity
double m_diffusivity
Definition: RotThermBondedInteraction.h:90
RotThermBondedInteraction.h
CRotThermBondedInteraction::loadCheckPointData
virtual void loadCheckPointData(std::istream &iStream)
Definition: RotThermBondedInteraction.cpp:892
CRotThermBondedInteraction::m_max_nForce
double m_max_nForce
Definition: RotThermBondedInteraction.h:93
CBasicParticle::getID
int getID() const
Definition: BasicParticle.h:65
CRotThermBondedInteraction::m_tag
int m_tag
Definition: RotThermBondedInteraction.h:107
CBasicParticle::getRad
double getRad() const
Definition: BasicParticle.h:64
Quaternion::return_vec
QUATERNION_INLINE Vec3 return_vec() const
Definition: Quaternion.h:80
CRotThermBondedInteraction::getBendPotentialEnergy
double getBendPotentialEnergy() const
Definition: RotThermBondedInteraction.cpp:796
console
Console console
Definition: console.cpp:25
CBasicParticle::getPos
Vec3 getPos() const
Definition: BasicParticle.h:62
CRotThermBondedIGP::kr
double kr
Definition: RotThermBondedInteraction.h:51
RotThermPairInteraction.h
AInteraction::m_id
vector< int > m_id
id's of the particles involved
Definition: Interaction.h:39
IGParam.h
CRotThermBondedInteraction::getShearPotentialEnergy
double getShearPotentialEnergy() const
Definition: RotThermBondedInteraction.cpp:786
CRotThermBondedIGP::max_nForce
double max_nForce
Definition: RotThermBondedInteraction.h:52
CRotThermBondedIGP::max_tMoment
double max_tMoment
Definition: RotThermBondedInteraction.h:52
CRotThermBondedIGP::max_bMoment
double max_bMoment
Definition: RotThermBondedInteraction.h:52
CRotThermBondedIGP::CRotThermBondedIGP
CRotThermBondedIGP()
Definition: RotThermBondedInteraction.cpp:55
CRotThermBondedInteraction::calcHeatTrans
void calcHeatTrans()
Definition: RotThermBondedInteraction.cpp:897
CRotThermBondedInteraction::setTag
void setTag(int tag)
Definition: RotThermBondedInteraction.cpp:243
CRotThermBondedInteraction::m_dist
double m_dist
current distance, cached from last calcForces()
Definition: RotThermBondedInteraction.h:83
CRotBondedInteraction::m_nForce
double m_nForce
Definition: RotBondedInteraction.h:124
CRotThermBondedInteraction::getTwistPotentialEnergy
double getTwistPotentialEnergy() const
Definition: RotThermBondedInteraction.cpp:791
CRotThermBondedInteraction::~CRotThermBondedInteraction
virtual ~CRotThermBondedInteraction()
Definition: RotThermBondedInteraction.cpp:250