Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
zalesak.h

The Zalesak slotted disk benchmark – the exact solution.

The Zalesak slotted disk benchmark – the exact solution

struct u {
point operator() (const point& x) const {
return point(-0.5*(x[1]-yc), 0.5*(x[0]-xc));
}
static Float period() {
Float pi = acos (Float(-1));
return 4*pi;
}
u() {}
protected:
static constexpr Float
xc = 0.5, // rotation center
yc = 0.5;
};
struct phi_exact {
Float operator() (const point& x) const {
Float xm = xc + cos(0.5*t)*(x[0]-xc) + sin(0.5*t)*(x[1]-yc);
Float ym = yc - sin(0.5*t)*(x[0]-xc) + cos(0.5*t)*(x[1]-yc);
Float d0 = sqrt((xm-x0)*(xm-x0) + (ym-y0)*(ym-y0)) - r;
if (d0 >= 0) {
Float d2 = sqrt(sqr(xm-x2) + sqr(ym-y2));
Float d3 = sqrt(sqr(xm-x3) + sqr(ym-y3));
if (fabs(xm-x0) < w/2 && ym < y2) {
return min(d2,d3);
} else {
return min(d2,min(d3,d0));
}
}
else {
if (ym < y4) {
if (xm < x2) {
Float d1 = xm - x2;
return max(d0,d1);
} else if (xm > x3) {
Float d1 = x3 - xm;
return max(d0,d1);
} else {
Float d1 = xm - x2;
Float d2 = x3 - xm;
Float d3 = y4 - ym;
return min(d1,min(d2,d3));
}
} else {
Float d1 = sqrt(sqr(xm-x4) + sqr(ym-y4));
Float d2 = sqrt(sqr(xm-x5) + sqr(ym-y5));
if (xm < x2) {
return max(d0,-d1);
} else if (xm > x3) {
return max (d0,-d2);
} else {
Float d3 = y4 - ym;
return max(d3,d0);
}
}
}
}
Float perimeter() const {
Float pi = acos(Float(-1));
Float d24 = sqrt(sqr(x4-x2) + sqr(y4-y2));
Float d45 = w;
Float d53 = d24;
Float theta = asin(0.5*w/r);
Float arc32 = (2*pi - theta)*r;
return d24 + d45 + d53 + arc32;
}
protected:
Float t, x2, y2, x3, y3, x4, y4, x5, y5;
static constexpr Float
xc = 0.5, // rotation center
yc = 0.5,
x0 = 0.50, // circle center
y0 = 0.75,
r = 0.15, // circle radius
w = 0.05, // slot width
l = 0.25; // slot length
};
inline
: t (t1),
x2 (x0 - w/2),
y2 (y0 - sqrt(r*r - (w/2)*(w/2))),
x3 (x0 + w/2),
y3 (y2),
x4 (x2),
y4 (y0 + l - r),
x5 (x3),
y5 (y4)
{}
struct phi0 {
Float operator() (const point& x) const { return _phi(x); }
phi0() : _phi(0) {}
};
see the Float page for the full documentation
see the point page for the full documentation
Definition leveque.h:37
phi0()
Definition zalesak.h:116
phi_exact _phi
Definition zalesak.h:117
Float operator()(const point &x) const
Definition leveque.h:38
Float x4
Definition zalesak.h:92
static constexpr Float x0
Definition zalesak.h:96
Float y5
Definition zalesak.h:92
static constexpr Float r
Definition zalesak.h:98
static constexpr Float y0
Definition zalesak.h:97
Float y4
Definition zalesak.h:92
phi_exact(Float w1)
Float t
Definition zalesak.h:92
static constexpr Float xc
Definition zalesak.h:94
Float x2
Definition zalesak.h:92
Float x3
Definition zalesak.h:92
static constexpr Float yc
Definition zalesak.h:95
Float perimeter() const
Definition zalesak.h:82
Float x5
Definition zalesak.h:92
Float operator()(const point &x) const
Float y2
Definition zalesak.h:92
static constexpr Float l
Definition zalesak.h:100
Float y3
Definition zalesak.h:92
Definition leveque.h:25
point operator()(const point &x) const
Definition leveque.h:26
static constexpr Float xc
Definition zalesak.h:36
static Float period()
Definition leveque.h:32
u()
Definition zalesak.h:33
static constexpr Float yc
Definition zalesak.h:37
Float pi
Definition leveque.h:34