12 #ifndef MFEM_LOR_MMS_HPP 13 #define MFEM_LOR_MMS_HPP 18 static constexpr
double pi = M_PI,
pi2 = M_PI*M_PI;
25 const double x = pi*xvec[0], y = pi*xvec[1];
26 if (
dim == 2) {
return sin(x)*sin(y); }
27 else {
const double z = pi*xvec[2];
return sin(x)*sin(y)*sin(z); }
30 std::function<double(const Vector &)>
f(
double mass_coeff)
32 return [mass_coeff](
const Vector &xvec)
34 const int dim = xvec.Size();
35 const double x = pi*xvec[0], y = pi*xvec[1];
38 return mass_coeff*sin(x)*sin(y) + 2*
pi2*sin(x)*sin(y);
42 const double z = pi*xvec[2];
43 return mass_coeff*sin(x)*sin(y)*sin(z) + 3*
pi2*sin(x)*sin(y)*sin(z);
53 const double x = pi*xvec[0], y = pi*xvec[1];
61 const double z = pi*xvec[2];
62 u[0] = cos(x)*sin(y)*sin(z);
63 u[1] = sin(x)*cos(y)*sin(z);
64 u[2] = sin(x)*sin(y)*cos(z);
68 std::function<void(const Vector &, Vector &)>
f_vec(
bool grad_div_problem)
73 const double x = pi*xvec[0], y = pi*xvec[1];
78 f[0] = (1 + 2*
pi2)*cos(x)*sin(y);
79 f[1] = (1 + 2*
pi2)*cos(y)*sin(x);
83 const double z = pi*xvec[2];
84 f[0] = (1 + 3*
pi2)*cos(x)*sin(y)*sin(z);
85 f[1] = (1 + 3*
pi2)*cos(y)*sin(x)*sin(z);
86 f[2] = (1 + 3*
pi2)*cos(z)*sin(x)*sin(y);
98 const double z = pi*xvec[2];
99 f[0] = cos(x)*sin(y)*sin(z);
100 f[1] = sin(x)*cos(y)*sin(z);
101 f[2] = sin(x)*sin(y)*cos(z);
int Size() const
Returns the size of the vector.
std::function< double(const Vector &)> f(double mass_coeff)
void u_vec(const Vector &xvec, Vector &u)
std::function< void(const Vector &, Vector &)> f_vec(bool grad_div_problem)
double u(const Vector &xvec)