ESyS-Particle
2.3.4
BWallInteraction.hpp
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 MODEL_BWALLINTERACTION_HPP
14
#define MODEL_BWALLINTERACTION_HPP
15
16
template
<
class
T>
17
CBondedWallInteraction<T>::CBondedWallInteraction
(T* p,
CWall
* w,
double
k,
bool
iflag):
18
AWallInteraction
<T>(p,w,iflag)
19
{
20
// scale stiffness to particle cross section
21
double
scale;
22
if
(
CParticle::getDo2dCalculations
()){
// 2D
23
// scale=2.0*this->m_p->getRad();
24
scale=1.0;
25
}
else
{
// 3D
26
// scale=3.1415926536*this->m_p->getRad()*this->m_p->getRad();
27
scale=3.1415926536*this->
m_p
->getRad();
28
}
29
30
m_k
=k*scale;
31
}
32
37
template
<
class
T>
38
void
CBondedWallInteraction<T>::calcForces
()
39
{
40
Vec3
D=(this->m_p->getTotalDisplacement()-this->m_wall->getTotalDisplacement());
41
//double dist=sqrt(D*D);
42
43
Vec3
force=D*m_k;
44
Vec3
pos=this->m_p->getPos();
45
46
this->m_p->applyForce(-1.0*force,pos);
47
if
(this->m_inner_flag) this->m_wall->addForce(force);
48
}
49
53
template
<
class
T>
54
Vec3
CBondedWallInteraction<T>::getForce
()
55
{
56
Vec3
D=(this->m_p->getTotalDisplacement()-this->m_wall->getTotalDisplacement());
57
//const double dist=sqrt(D*D);
58
59
return
D*m_k;
60
}
61
62
#endif
CWall
base class for all walls
Definition:
Wall.h:40
CBondedWallInteraction::getForce
virtual Vec3 getForce()
Definition:
BWallInteraction.hpp:54
AWallInteraction
Abstract base for all interactions between a particle and a wall.
Definition:
WallInteraction.h:30
CBondedWallInteraction::m_k
double m_k
spring constant
Definition:
BWallInteraction.h:32
Vec3
Definition:
vec3.h:47
CParticle::getDo2dCalculations
static bool getDo2dCalculations()
Definition:
Particle.h:181
AWallInteraction::m_p
T * m_p
Definition:
WallInteraction.h:32
CBondedWallInteraction::CBondedWallInteraction
CBondedWallInteraction(T *, CWall *, double, bool)
Definition:
BWallInteraction.hpp:17
CBondedWallInteraction::calcForces
virtual void calcForces()
Definition:
BWallInteraction.hpp:38
Model
BWallInteraction.hpp
Generated by
1.8.20