Rheolef
7.1
an efficient C++ finite element environment
rotating-hill.h
Convection-diffusion equation – the rotating hill benchmark
struct
u
{
point
operator()
(
const
point
& x)
const
{
return
(
d
== 1) ?
point
(
u0
) :
point
(x[1], -x[0]); }
u
(
size_t
d1) :
d
(d1),
u0
(0.5/acos(
Float
(-1))) {}
protected
:
size_t
d
;
Float
u0
;
};
struct
phi
{
Float
operator()
(
const
point
& x)
const
{
return
exp
(-4*
nu
*(
t
/
t0
) -
dist2
(x,
x0t
())/(
t0
+4*
nu
*
t
)); }
phi
(
size_t
d1,
Float
nu1,
Float
t1=0) :
d
(d1),
nu
(nu1),
t
(t1),
u0
(0.5/acos(
Float
(-1))),
x0
(-0.5,0) {}
static
Float
sigma
(
size_t
d
,
Float
nu1,
Float
t
=0) {
return
4*nu1/
t0
- 2*
d
*nu1/(
t0
+ 4*nu1*
t
); }
point
x0t
()
const
{
if
(
d
== 1)
return
point
(
x0
[0] +
u0
*
t
);
return
point
(
x0
[0]*cos(
t
) +
x0
[1]*sin(
t
),
-
x0
[0]*sin(
t
) +
x0
[1]*cos(
t
)); }
point
d_x0t_dt
()
const
{
if
(
d
== 1)
return
point
(
u0
);
return
point
(-
x0
[0]*sin(
t
) +
x0
[1]*cos(
t
),
-
x0
[0]*cos(
t
) -
x0
[1]*sin(
t
)); }
protected
:
size_t
d
;
Float
nu
,
t
,
u0
;
point
x0
;
static
constexpr
Float
t0
= 0.2;
};
u::operator()
point operator()(const point &x) const
Definition:
leveque.h:26
phi::t
Float t
Definition:
rotating-hill.h:46
phi::d
size_t d
Definition:
rotating-hill.h:46
nu
Definition:
nu.h:26
phi
Definition:
phi.h:25
phi::d_x0t_dt
point d_x0t_dt() const
Definition:
rotating-hill.h:42
phi::operator()
Float operator()(const Float &x) const
Definition:
phi.h:27
u::u
u()
Definition:
zalesak.h:33
u::d
size_t d
Definition:
rotating-hill.h:29
rheolef::exp
tensor_basic< T > exp(const tensor_basic< T > &a, size_t d)
Definition:
tensor-exp.cc:92
phi::x0
point x0
Definition:
rotating-hill.h:46
u::u0
Float u0
Definition:
rotating-hill.h:29
u
Definition:
leveque.h:25
phi::u0
Float u0
Definition:
rotating-hill.h:46
Float
see the Float page for the full documentation
point
see the point page for the full documentation
phi::x0t
point x0t() const
Definition:
rotating-hill.h:38
phi::sigma
Float sigma
Definition:
transport_dg_error.cc:27
phi::nu
Float nu
Definition:
rotating-hill.h:46
rheolef::dist2
T dist2(const point_basic< T > &x, const point_basic< T > &y)
Definition:
point.h:293
phi::phi
phi(Float n1=2, Float c1=1, Float r1=0)
Definition:
phi.h:26
phi::t0
static constexpr Float t0
Definition:
rotating-hill.h:47