12#ifndef MFEM_LOR_MMS_HPP
13#define MFEM_LOR_MMS_HPP
18static constexpr real_t pi = M_PI,
pi2 = M_PI*M_PI;
25 const real_t x = pi*xvec[0], y = pi*xvec[1];
26 if (
dim == 2) {
return sin(x)*sin(y); }
27 else {
const real_t z = pi*xvec[2];
return sin(x)*sin(y)*sin(z); }
32 return [mass_coeff](
const Vector &xvec)
34 const int dim = xvec.Size();
35 const real_t x = pi*xvec[0], y = pi*xvec[1];
38 return mass_coeff*sin(x)*sin(y) + 2*
pi2*sin(x)*sin(y);
42 const real_t z = pi*xvec[2];
43 return mass_coeff*sin(x)*sin(y)*sin(z) + 3*
pi2*sin(x)*sin(y)*sin(z);
53 const real_t x = pi*xvec[0], y = pi*xvec[1];
61 const real_t 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);
73 const real_t 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 real_t 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 real_t 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.
real_t u(const Vector &xvec)
void u_vec(const Vector &xvec, Vector &u)
std::function< void(const Vector &, Vector &)> f_vec(bool grad_div_problem)
std::function< real_t(const Vector &)> f(real_t mass_coeff)