Rheolef  7.1
an efficient C++ finite element environment
sinusprod_laplace.h
Go to the documentation of this file.
1 #include "sinusprod.h"
26 struct f {
27  Float operator() (const point& x) const { return d*sqr(pi)*_u(x); }
28  f(size_t d1) : d(d1), _u(d1), pi(acos(Float(-1))) {}
29  size_t d;
30  u_exact _u; Float pi;
31 };
32 struct g {
33  Float operator() (const point& x) const {
34  switch (d) {
35  case 0: return 0;
36  case 1: return -pi;
37  case 2: return -pi*(sin(pi*x[0]) + sin(pi*x[1]));
38  default: return -pi*( sin(pi*x[0])*sin(pi*x[1])
39  + sin(pi*x[1])*sin(pi*x[2])
40  + sin(pi*x[2])*sin(pi*x[0]));
41  }
42  }
43  g(size_t d1) : d(d1), pi(acos(Float(-1))) {}
44  size_t d; Float pi;
45 };
see the Float page for the full documentation
see the point page for the full documentation
The sinus product function.
Definition: cavity_dg.h:29
size_t d
point operator()(const point &x) const
Definition: cavity_dg.h:30
f(size_t d1)
const Float pi
u_exact _u
Definition: cavity_dg.h:25
size_t d
point operator()(const point &x) const
Definition: cavity_dg.h:26
g(size_t d1)
const Float pi
Float pi