ESyS-Particle
4.0.1
Main Page
Related Pages
Namespaces
Classes
Files
File List
Model
ABCDamping.hpp
1
2
// //
3
// Copyright (c) 2003-2011 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 MODEL_ABCDAMPING_HPP
14
#define MODEL_ABCDAMPING_HPP
15
16
#include<cmath>
17
using
std::fabs;
18
using
std::exp;
19
20
21
28
template
<
class
ParticleType>
29
ABCDamping<ParticleType>::ABCDamping
(ParticleType* P,
ABCDampingIGP
* param)
30
:
CDamping
<ParticleType>(P,param)
31
{
32
// calc local viscosity
33
Vec3
pos=param->getPos();
34
Vec3
normal=param->getNormal();
35
double
c1=param->getC1();
36
double
v_0=this->
m_visc
;
37
double
dist=fabs((this->
m_p
->getInitPos()-pos)*normal);
38
double
v_new=v_0/exp(dist*c1);
39
this->
m_visc
=v_new;
40
}
41
42
template
<
class
ParticleType>
43
ABCDamping<ParticleType>::~ABCDamping
()
44
{}
45
46
47
/* Get the particle member function which returns a scalar field of a given name.
48
49
\param name the name of the field
50
*/
51
template
<
class
T>
52
typename
ABCDamping<T>::ScalarFieldFunction
ABCDamping<T>::getScalarFieldFunction
(
const
string
& name)
53
{
54
typename
ABCDamping<T>::ScalarFieldFunction
sf;
55
56
sf=NULL;
57
cerr <<
"ERROR - invalid name for interaction scalar access function"
<< endl;
58
59
return
sf;
60
}
61
62
68
template
<
class
T>
69
typename
ABCDamping<T>::CheckedScalarFieldFunction
ABCDamping<T>::getCheckedScalarFieldFunction
(
const
string
& name)
70
{
71
typename
ABCDamping<T>::CheckedScalarFieldFunction
sf;
72
73
sf=NULL;
74
cerr <<
"ERROR - invalid name for interaction scalar access function"
<< endl;
75
76
return
sf;
77
}
78
79
85
template
<
class
T>
86
typename
ABCDamping<T>::VectorFieldFunction
ABCDamping<T>::getVectorFieldFunction
(
const
string
& name)
87
{
88
typename
ABCDamping<T>::VectorFieldFunction
vf;
89
90
vf=NULL;
91
cerr <<
"ERROR - invalid name for interaction vector access function"
<< endl;
92
93
return
vf;
94
}
95
96
#endif //MODEL_ABCDAMPING_HPP
Generated on Sun Apr 13 2014 05:18:50 for ESyS-Particle by
1.8.1.2