12 T linear_fun(T
x, T
y)
18 T quadratic_fun(T
x, T
y)
28 return v * v * v * v + 0.1;
34 return sin(
x * 10) * sin(
y * 10);
38 T sine_fun(T
x, T
y, T
z)
40 return sin(
x * 10) * sin(
y * 10) * sin(
z * 10);
46 return (1 -
x) *
x *
x *
y * (1 -
y) * (1 -
y);
50 T zero_bc(T
x, T
y, T
z)
52 return (1 -
x) *
x *
x *
y * (1 -
y) * (1 -
y) *
z * (1 -
z);
64 res(0) = linear_fun(pt(0), pt(1));
72 res(0) = linear_fun(pt(0), pt(1));
80 res(0) = linear_fun(pt(0), pt(1));
93 res(0) = quadratic_fun(pt(0), pt(1));
101 res(0) = quadratic_fun(pt(0), pt(1));
109 res(0) = quadratic_fun(pt(0), pt(1));
122 res(0) = cubic_fun(pt(0), pt(1));
130 res(0) = cubic_fun(pt(0), pt(1));
138 res(0) = cubic_fun(pt(0), pt(1));
152 res(0) = sine_fun(pt(0), pt(1));
153 else if (pt.size() == 3)
154 res(0) = sine_fun(pt(0), pt(1), pt(2));
166 res(0) = sine_fun(pt(0), pt(1));
167 else if (pt.size() == 3)
168 res(0) = sine_fun(pt(0), pt(1), pt(2));
180 res(0) = sine_fun(pt(0), pt(1));
181 else if (pt.size() == 3)
182 res(0) = sine_fun(pt(0), pt(1), pt(2));
198 res(0) = zero_bc(pt(0), pt(1));
199 else if (pt.size() == 3)
200 res(0) = zero_bc(pt(0), pt(1), pt(2));
211 res(0) = zero_bc(pt(0), pt(1));
212 else if (pt.size() == 3)
213 res(0) = zero_bc(pt(0), pt(1), pt(2));
224 res(0) = zero_bc(pt(0), pt(1));
225 else if (pt.size() == 3)
226 res(0) = zero_bc(pt(0), pt(1), pt(2));
240 val = -10 * Eigen::MatrixXd::Ones(pts.rows(), 1);
245 val = Eigen::MatrixXd::Zero(pts.rows(), 1);
255 val = Eigen::MatrixXd::Ones(pts.rows(), 1);
260 val = Eigen::MatrixXd::Zero(pts.rows(), 1);
265 val = Eigen::MatrixXd::Zero(pts.rows(), 1);
281 if (params.contains(
"func"))
283 func_ = params[
"func"];
290 const double tt =
func_ == 0 ? t : t * t;
291 res(0) = pt(0) * pt(0) + pt(1) * pt(1) + tt;
297 const double tt =
func_ == 0 ? t : t * t;
298 res(0) = pt(0) * pt(0) + pt(1) * pt(1) + tt;
304 const double tt =
func_ == 0 ? t : t * t;
305 res(0) = pt(0) * pt(0) + pt(1) * pt(1) + tt;
315 val.array() -= 2 * t;
Abstract mesh class to capture 2d/3d conforming and non-conforming meshes.
VectorNd eval_fun(const VectorNd &pt, const double t) const override
CubicProblem(const std::string &name)
GenericScalarProblemExact(const std::string &name)
VectorNd eval_fun(const VectorNd &pt, double t) const override
void rhs(const assembler::Assembler &assembler, const Eigen::MatrixXd &pts, const double t, Eigen::MatrixXd &val) const override
void set_parameters(const json ¶ms) override
void initial_solution(const mesh::Mesh &mesh, const Eigen::MatrixXi &global_ids, const Eigen::MatrixXd &pts, Eigen::MatrixXd &val) const override
LinearProblem(const std::string &name)
VectorNd eval_fun(const VectorNd &pt, const double t) const override
MinSurfProblem(const std::string &name)
void dirichlet_bc(const mesh::Mesh &mesh, const Eigen::MatrixXi &global_ids, const Eigen::MatrixXd &uv, const Eigen::MatrixXd &pts, const double t, Eigen::MatrixXd &val) const override
void rhs(const assembler::Assembler &assembler, const Eigen::MatrixXd &pts, const double t, Eigen::MatrixXd &val) const override
virtual void rhs(const assembler::Assembler &assembler, const Eigen::MatrixXd &pts, const double t, Eigen::MatrixXd &val) const override
virtual void exact(const Eigen::MatrixXd &pts, const double t, Eigen::MatrixXd &val) const override
QuadraticProblem(const std::string &name)
VectorNd eval_fun(const VectorNd &pt, const double t) const override
VectorNd eval_fun(const VectorNd &pt, const double t) const override
SineProblem(const std::string &name)
void rhs(const assembler::Assembler &assembler, const Eigen::MatrixXd &pts, const double t, Eigen::MatrixXd &val) const override
TimeDependentProblem(const std::string &name)
void initial_solution(const mesh::Mesh &mesh, const Eigen::MatrixXi &global_ids, const Eigen::MatrixXd &pts, Eigen::MatrixXd &val) const override
void dirichlet_bc(const mesh::Mesh &mesh, const Eigen::MatrixXi &global_ids, const Eigen::MatrixXd &uv, const Eigen::MatrixXd &pts, const double t, Eigen::MatrixXd &val) const override
ZeroBCProblem(const std::string &name)
VectorNd eval_fun(const VectorNd &pt, const double t) const override
Eigen::Matrix< AutodiffScalarHessian, Eigen::Dynamic, 1, 0, 3, 1 > AutodiffHessianPt
Eigen::Matrix< double, Eigen::Dynamic, 1, 0, 3, 1 > VectorNd
Eigen::Matrix< AutodiffScalarGrad, Eigen::Dynamic, 1, 0, 3, 1 > AutodiffGradPt