ESyS-Particle
2.2
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
MacroFrictionCalculator.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
14
#ifndef ESYS_LSMMACROFRICTIONCALCULATOR_H
15
#define ESYS_LSMMACROFRICTIONCALCULATOR_H
16
17
#include "
Foundation/vec3.h
"
18
19
#include <vector>
20
21
namespace
esys
22
{
23
namespace
lsm
24
{
25
class
MacroFrictionCalculator
26
{
27
public
:
28
typedef
std::pair<Vec3,Vec3>
WallForcePair
;
29
typedef
std::vector<double>
FrictionVector
;
30
31
MacroFrictionCalculator
(
int
normalDimIndex,
int
shearDimIndex)
32
:
m_normalDimIndex
(normalDimIndex),
33
m_shearDimIndex
(shearDimIndex),
34
m_frictionVector
()
35
{
36
}
37
38
double
getFriction
(
const
WallForcePair
&forcePair)
const
39
{
40
const
double
normalStress = (forcePair.first[
m_normalDimIndex
] - forcePair.second[
m_normalDimIndex
]);
41
if
(normalStress != 0.0) {
42
const
double
shearStress = forcePair.first[
m_shearDimIndex
] - forcePair.second[
m_shearDimIndex
];
43
return
shearStress/normalStress;
44
}
45
return
0.0;
46
}
47
48
void
add
(
const
WallForcePair
&forcePair)
49
{
50
m_frictionVector
.push_back(
getFriction
(forcePair));
51
}
52
53
template
<
typename
TmplIterator>
54
void
add
(TmplIterator it)
55
{
56
while
(it.hasNext())
57
{
58
add
(it.next());
59
}
60
}
61
62
const
FrictionVector
&
getFrictionVector
()
const
63
{
64
return
m_frictionVector
;
65
}
66
67
private
:
68
int
m_normalDimIndex
;
69
int
m_shearDimIndex
;
70
FrictionVector
m_frictionVector
;
71
};
72
}
73
}
74
75
#endif
Tools
MacroFrictionCalculator
MacroFrictionCalculator.h
Generated on Mon May 6 2013 23:26:31 for ESyS-Particle by
1.8.3.1