ESyS-Particle
2.2
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
BondedInteraction.h
Go to the documentation of this file.
1
2
// //
3
// Copyright (c) 2003-2013 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 __BONDEDINTERACTION_H
14
#define __BONDEDINTERACTION_H
15
16
// -- project includes --
17
#include "
Model/IGParam.h
"
// keep this one first - it drags in mpi.h
18
#include "
Model/Interaction.h
"
19
#include "
Model/Particle.h
"
20
#include "
Model/BondedInteractionCpData.h
"
21
#include "
Foundation/vec3.h
"
22
23
// -- I/O includes --
24
#include <iostream>
25
using
std::ostream;
26
27
// -- STL includes --
28
#include <utility>
29
30
using
std::pair;
31
39
class
CBondedIGP
:
public
AIGParam
40
{
41
public
:
42
CBondedIGP
();
43
44
CBondedIGP
(
const
std::string &name,
int
tag
,
double
normalK,
double
breakDistance,
bool
scaling=
true
);
45
46
virtual
std::string
getTypeString
()
const
47
{
48
return
"Bonded"
;
49
}
50
51
double
k
;
52
double
rbreak
;
53
int
tag
;
54
bool
m_scaling
;
55
};
56
64
class
CBondedInteraction
:
public
APairInteraction
65
{
66
public
:
// types
67
typedef
CBondedIGP
ParameterType
;
71
typedef
BondedInteractionCpData
CheckPointable
;
72
73
typedef
double (
CBondedInteraction
::*
ScalarFieldFunction
)()
const
;
74
typedef
pair<bool,double> (
CBondedInteraction
::*
CheckedScalarFieldFunction
)()
const
;
75
typedef
Vec3
(
CBondedInteraction
::*
VectorFieldFunction
)()
const
;
76
77
protected
:
78
double
m_k
;
79
double
m_r0
;
80
double
m_dist
;
81
double
m_break
;
82
Vec3
m_force
;
83
Vec3
m_cpos
;
84
int
m_tag
;
85
bool
m_scaling
;
86
87
CBondedInteraction
(
CParticle
*,
CParticle
*);
88
89
public
:
90
CBondedInteraction
();
91
CBondedInteraction
(
92
CParticle
*particle1,
93
CParticle
*particle2,
94
const
CBondedIGP
¶ms
95
);
96
97
virtual
~CBondedInteraction
();
98
99
static
ScalarFieldFunction
getScalarFieldFunction
(
const
string
&);
100
static
CheckedScalarFieldFunction
getCheckedScalarFieldFunction
(
const
string
&);
101
static
VectorFieldFunction
getVectorFieldFunction
(
const
string
&);
102
103
static
string
getType
() {
return
"Bonded"
;};
104
105
virtual
void
calcForces
();
106
void
setBreak
(
double
);
107
bool
broken
();
108
109
inline
int
getTag
()
const
{
return
m_tag
;}
110
inline
void
setTag
(
int
tag) {
m_tag
= tag;}
111
112
double
getCriterion
()
const
;
113
double
getPotentialEnergy
()
const
;
114
double
getStrain
()
const
;
115
Vec3
getForce
()
const
;
116
117
virtual
Vec3
getPos
()
const
{
return
m_cpos
;};
118
virtual
void
saveCheckPointData
(std::ostream &oStream);
119
120
friend
ostream&
operator<<
(ostream&,
const
CBondedInteraction
&);
121
friend
class
TML_PackedMessageInterface
;
122
123
// save/load of restart parameters
124
virtual
void
saveRestartData
(std::ostream &oStream);
125
virtual
void
loadRestartData
(std::istream &iStream);
126
};
127
128
#endif //__BONDEDINTERACTION_H
Model
BondedInteraction.h
Generated on Mon May 6 2013 23:26:30 for ESyS-Particle by
1.8.3.1