rheolef  7.0
rotating-hill.h
Go to the documentation of this file.
1 struct u {
2  point operator() (const point & x) const {
3  return (d == 1) ? point(u0) : point(x[1], -x[0]); }
4  u (size_t d1) : d(d1), u0 (0.5/acos(Float(-1))) {}
5  protected: size_t d; Float u0;
6 };
7 struct phi {
8  static Float sigma(size_t d, Float nu1, Float t) {
9  const Float t0 = 0.2;
10  return 4*nu1/t0 - 2*d*nu1/(t0 + 4*nu1*t); }
11  Float operator() (const point& x) const {
12  point x0t;
13  if (d == 1) { x0t = point(x0[0] + u0*t); }
14  else { x0t = point( x0[0]*cos(t) + x0[1]*sin(t),
15  -x0[0]*sin(t) + x0[1]*cos(t));
16  }
17  return exp(-4*nu*(t/t0) - dist2(x,x0t)/(t0+4*nu*t));
18  }
19  phi (size_t d1, Float nu1, Float t1) : d(d1), nu(nu1), t(t1),
20  t0(0.2), u0 (0.5/acos(Float(-1))), x0(-0.5,0) {}
21  protected: size_t d; Float nu, t, t0, u0; point x0;
22 };
Float u0
Definition: rotating-hill.h:5
static Float sigma(size_t d, Float nu1, Float t)
Definition: rotating-hill.h:8
T dist2(const point_basic< T > &x, const point_basic< T > &y)
Definition: point.h:165
phi(size_t d1, Float nu1, Float t1)
Definition: rotating-hill.h:19
point x0
Definition: rotating-hill.h:21
point operator()(const point &x) const
Definition: rotating-hill.h:2
size_t d
Definition: rotating-hill.h:5
double Float
Definition: compiler.h:160
tensor_basic< T > exp(const tensor_basic< T > &a, size_t d)
Definition: tensor-exp.cc:147
Definition: rotating-hill.h:1
point_basic< Float > point
Definition: point.h:122
u(size_t d1)
Definition: rotating-hill.h:4