PolyFEM
Loading...
Searching...
No Matches
TestProblem.hpp
Go to the documentation of this file.
1#pragma once
2
4
5#include <vector>
6#include <Eigen/Dense>
7
8namespace polyfem
9{
10 namespace problem
11 {
13 {
14 public:
15 TestProblem(const std::string &name);
16
17 VectorNd eval_fun(const VectorNd &pt, const double t) const override { return eval_impl(pt); }
18 AutodiffGradPt eval_fun(const AutodiffGradPt &pt, const double t) const override { return eval_impl(pt); }
19 AutodiffHessianPt eval_fun(const AutodiffHessianPt &pt, const double t) const override { return eval_impl(pt); }
20
21 bool is_scalar() const override { return params_["is_scalar"]; }
22
23 void set_parameters(const json &params) override;
24
25 private:
26 template <typename T>
27 T eval_impl(const T &pt) const;
28
29 private:
31 };
32 } // namespace problem
33} // namespace polyfem
const std::string & name() const
Definition Problem.hpp:23
T eval_impl(const T &pt) const
VectorNd eval_fun(const VectorNd &pt, const double t) const override
bool is_scalar() const override
AutodiffHessianPt eval_fun(const AutodiffHessianPt &pt, const double t) const override
AutodiffGradPt eval_fun(const AutodiffGradPt &pt, const double t) const override
void set_parameters(const json &params) override
Eigen::Matrix< AutodiffScalarHessian, Eigen::Dynamic, 1, 0, 3, 1 > AutodiffHessianPt
Eigen::Matrix< double, Eigen::Dynamic, 1, 0, 3, 1 > VectorNd
Definition Types.hpp:11
nlohmann::json json
Definition Common.hpp:9
Eigen::Matrix< AutodiffScalarGrad, Eigen::Dynamic, 1, 0, 3, 1 > AutodiffGradPt