ESyS-Particle
2.2
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
RotElasticInteraction.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 __ROTELASTICINTERACTION_H
14
#define __ROTELASTICINTERACTION_H
15
16
#include "
Model/RotPairInteraction.h
"
17
#include "
Model/RotParticle.h
"
18
#include "
Model/IGParam.h
"
19
20
24
class
CRotElasticIGP
:
public
AIGParam
25
{
26
protected
:
27
public
:
28
CRotElasticIGP
();
29
CRotElasticIGP
(
const
std::string &name,
double
kr,
bool
scaling);
30
31
double
m_kr
;
32
bool
m_scaling
;
33
34
virtual
void
packInto
(
CVarMPIBuffer
*)
const
;
35
void
setNormalSpringConst
(
double
k){
m_kr
=k;};
36
double
getNormalSpringConst
()
const
{
return
m_kr
;};
37
38
virtual
std::string
getTypeString
()
const
{
return
"RotElastic"
;}
39
40
friend
ostream&
operator<<
(ostream&,
const
CRotElasticIGP
&);
41
};
42
43
CRotElasticIGP
*
extractRotElasticIGP
(
AMPIBuffer
*);
44
CRotElasticIGP
*
extractRotElasticIGP_p
(
AMPIBuffer
*);
45
50
class
CRotElasticInteraction
:
public
ARotPairInteraction
51
{
52
public
:
53
typedef
double (
CRotElasticInteraction
::*
ScalarFieldFunction
)()
const
;
54
typedef
pair<bool,double> (
CRotElasticInteraction
::*
CheckedScalarFieldFunction
)()
const
;
55
typedef
Vec3
(
CRotElasticInteraction
::*
VectorFieldFunction
)()
const
;
56
57
static
ScalarFieldFunction
getScalarFieldFunction
(
const
string
&);
58
static
CheckedScalarFieldFunction
getCheckedScalarFieldFunction
(
const
string
&);
59
static
VectorFieldFunction
getVectorFieldFunction
(
const
string
&);
60
61
private
:
62
double
m_kr
;
63
Vec3
m_force
;
64
double
m_nForce
;
65
Vec3
m_cpos
;
66
Vec3
m_D
;
67
bool
m_scaling
;
68
69
public
:
70
typedef
CRotElasticIGP
ParameterType
;
71
72
CRotElasticInteraction
();
73
CRotElasticInteraction
(
CRotParticle
*,
CRotParticle
*,
const
CRotElasticIGP
&);
74
virtual
~CRotElasticInteraction
(){};
75
76
virtual
Vec3
getPos
()
const
{
return
m_cpos
;}
77
78
static
string
getType
(){
return
"RotElastic"
;}
79
80
virtual
void
calcForces
();
81
82
Vec3
getForce
()
const
;
83
double
getPotentialEnergy
()
const
;
84
85
friend
ostream&
operator<<
(ostream&,
const
CRotElasticInteraction
&);
86
87
// save/load of restart parameters
88
virtual
void
saveRestartData
(std::ostream &oStream);
89
virtual
void
loadRestartData
(std::istream &iStream);
90
};
91
#endif //__ELASTICINTERACTION_H
Model
RotElasticInteraction.h
Generated on Mon May 6 2013 23:26:30 for ESyS-Particle by
1.8.3.1