ESyS-Particle  2.3.2
ABCDamping.hpp
Go to the documentation of this file.
1 
2 // //
3 // Copyright (c) 2003-2014 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.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>
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>
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>
53 {
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>
70 {
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>
87 {
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