PolyFEM
Loading...
Searching...
No Matches
MooneyRivlinElasticity.cpp
Go to the documentation of this file.
2
3namespace polyfem::assembler
4{
6 : c1_("c1"), c2_("c2"), k_("k")
7 {
8 }
9
10 void MooneyRivlinElasticity::add_multimaterial(const int index, const json &params, const Units &units)
11 {
12 c1_.add_multimaterial(index, params, units.stress());
13 c2_.add_multimaterial(index, params, units.stress());
14 k_.add_multimaterial(index, params, units.stress());
15 }
16
17 std::map<std::string, Assembler::ParamFunc> MooneyRivlinElasticity::parameters() const
18 {
19 std::map<std::string, ParamFunc> res;
20 const auto &c1 = this->c1();
21 const auto &c2 = this->c2();
22 const auto &k = this->k();
23
24 res["c1"] = [&c1](const RowVectorNd &, const RowVectorNd &p, double t, int e) {
25 return c1(p, t, e);
26 };
27
28 res["c2"] = [&c2](const RowVectorNd &, const RowVectorNd &p, double t, int e) {
29 return c2(p, t, e);
30 };
31
32 res["k"] = [&k](const RowVectorNd &, const RowVectorNd &p, double t, int e) {
33 return k(p, t, e);
34 };
35
36 return res;
37 }
38} // namespace polyfem::assembler
std::string stress() const
Definition Units.hpp:25
void add_multimaterial(const int index, const json &params, const std::string &unit_type)
Definition MatParams.cpp:28
void add_multimaterial(const int index, const json &params, const Units &units) override
std::map< std::string, ParamFunc > parameters() const override
Used for test only.
nlohmann::json json
Definition Common.hpp:9
Eigen::Matrix< double, 1, Eigen::Dynamic, Eigen::RowMajor, 1, 3 > RowVectorNd
Definition Types.hpp:13