leveque.h

The Leveque benchmark – function definition

struct u {
point operator() (const point& x) const {
return cos(pi*t/tf)
*point (-sqr(sin(pi*x[0]))*sin(2*pi*x[1]),
sqr(sin(pi*x[1]))*sin(2*pi*x[0]));
}
u (size_t d, Float t1) : t(t1), pi(acos(Float(-1))) {}
static Float period() { return tf; }
protected:
Float t, pi;
static constexpr Float tf = 8; // time period
};
struct phi0 {
Float operator() (const point& x) const {
return sqrt(sqr(x[0]-x0) + sqr(x[1]-y0)) - r;
}
phi0(size_t d) { check_macro(d==2, "3D: not yet, sorry"); }
protected:
static constexpr Float
r = 0.15, // circle radius
x0 = 0.5, // circle center
y0 = 0.75;
};
Float
see the Float page for the full documentation
point
see the point page for the full documentation
check_macro
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
mkgeo_ball.d
int d
Definition: mkgeo_ball.sh:154
phi0
Definition: leveque.h:37
phi0::phi0
phi0()
Definition: zalesak.h:116
phi0::r
static constexpr Float r
Definition: leveque.h:44
phi0::y0
static constexpr Float y0
Definition: leveque.h:46
phi0::x0
static constexpr Float x0
Definition: leveque.h:45
phi0::operator()
Float operator()(const point &x) const
Definition: leveque.h:38
u
Definition: leveque.h:25
u::tf
static constexpr Float tf
Definition: leveque.h:35
u::d
size_t d
Definition: rotating-hill.h:29
u::operator()
point operator()(const point &x) const
Definition: leveque.h:26
u::t
Float t
Definition: leveque.h:34
u::period
static Float period()
Definition: leveque.h:32
u::u
u()
Definition: zalesak.h:33
u::pi
Float pi
Definition: leveque.h:34