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