6#include <units/units.hpp>
19 unit_type_ = units::unit_from_string(unit_type);
22 expr.set_unit_type(unit_type);
25 void init(
const json &
vals,
const std::string &root_path);
27 void init(
const Eigen::MatrixXd &
val);
28 void init(
const std::string &expr,
const std::string &root_path);
29#ifdef POLYFEM_WITH_PYTHON
30 void init_python(
const std::string &path,
const std::string &function_name);
33 void init(
const std::function<
double(
double x,
double y,
double z)> &func);
34 void init(
const std::function<
double(
double x,
double y,
double z,
double t)> &func);
35 void init(
const std::function<
double(
double x,
double y,
double z,
double t,
int index)> &func);
37 void init(
const std::function<Eigen::MatrixXd(
double x,
double y,
double z)> &func,
const int coo);
38 void init(
const std::function<Eigen::MatrixXd(
double x,
double y,
double z,
double t)> &func,
const int coo);
42 double operator()(
double x,
double y,
double z = 0,
double t = 0,
int index = -1)
const;
66 assert(
mat_.rows() == mat.rows());
67 assert(
mat_.cols() == mat.cols());
77 std::function<double(
double x,
double y,
double z,
double t,
int index)>
sfunc_;
78 std::function<Eigen::MatrixXd(
double x,
double y,
double z,
double t)>
tfunc_;
ElementAssemblyValues vals
void init(const json &vals, const std::string &root_path)
void set_t(const json &t)
std::vector< ExpressionValue > mat_expr_
units::precise_unit unit_
std::function< double(double x, double y, double z, double t, int index)> sfunc_
std::function< Eigen::MatrixXd(double x, double y, double z, double t)> tfunc_
std::map< double, int > t_index_
units::precise_unit unit_type_
void set_unit_type(const std::string &unit_type)
double operator()(double x, double y, double z=0, double t=0, int index=-1) const
const Eigen::MatrixXd & get_mat() const
void set_mat(const Eigen::MatrixXd &mat)