sinusprod_laplace.h

The sinus product function – right-hand-side and boundary condition for the Poisson problem with Neumann boundary condition

#include "sinusprod.h"
struct f {
Float operator() (const point& x) const { return d*sqr(pi)*_u(x); }
f(size_t d1) : d(d1), _u(d1), pi(acos(Float(-1))) {}
size_t d;
u_exact _u; Float pi;
};
struct g {
Float operator() (const point& x) const {
switch (d) {
case 0: return 0;
case 1: return -pi;
case 2: return -pi*(sin(pi*x[0]) + sin(pi*x[1]));
default: return -pi*( sin(pi*x[0])*sin(pi*x[1])
+ sin(pi*x[1])*sin(pi*x[2])
+ sin(pi*x[2])*sin(pi*x[0]));
}
}
g(size_t d1) : d(d1), pi(acos(Float(-1))) {}
size_t d; Float pi;
};
sinusprod.h
The sinus product function.
g::g
g()
Definition: taylor.h:29
g::d
size_t d
Definition: sinusprod_helmholtz.h:45
f::d
size_t d
Definition: cosinusprod_dirichlet.h:30
g::pi
const Float pi
Definition: cosinusprod_laplace.h:35
f::operator()
point operator()(const point &x) const
Definition: cavity_dg.h:30
Float
see the Float page for the full documentation
f::f
f()
Definition: taylor.h:34
f::_u
u_exact _u
Definition: sinusprod_dirichlet.h:30
u_exact
Definition: interpolate_RTk_polynom.icc:125
point
see the point page for the full documentation
f::pi
const Float pi
Definition: cosinusprod_dirichlet.h:30
g::operator()
point operator()(const point &x) const
Definition: cavity_dg.h:26
g
Definition: cavity_dg.h:25
f
Definition: cavity_dg.h:29