PolyFEM
Loading...
Searching...
No Matches
MooneyRivlin3ParamElasticity.cpp
Go to the documentation of this file.
2
3namespace polyfem::assembler
4{
6 : c1_("c1"), c2_("c2"), c3_("c3"), d1_("d1")
7 {
8 }
9
10 void MooneyRivlin3ParamElasticity::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 c3_.add_multimaterial(index, params, units.stress());
15 d1_.add_multimaterial(index, params, units.stress());
16 }
17
18 std::map<std::string, Assembler::ParamFunc> MooneyRivlin3ParamElasticity::parameters() const
19 {
20 std::map<std::string, ParamFunc> res;
21 const auto &c1 = this->c1();
22 const auto &c2 = this->c2();
23 const auto &c3 = this->c3();
24 const auto &d1 = this->d1();
25
26 res["c1"] = [&c1](const RowVectorNd &, const RowVectorNd &p, double t, int e) {
27 return c1(p, t, e);
28 };
29
30 res["c2"] = [&c2](const RowVectorNd &, const RowVectorNd &p, double t, int e) {
31 return c2(p, t, e);
32 };
33
34 res["c3"] = [&c3](const RowVectorNd &, const RowVectorNd &p, double t, int e) {
35 return c3(p, t, e);
36 };
37
38 res["d1"] = [&d1](const RowVectorNd &, const RowVectorNd &p, double t, int e) {
39 return d1(p, t, e);
40 };
41
42 return res;
43 }
44} // 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
std::map< std::string, ParamFunc > parameters() const override
void add_multimaterial(const int index, const json &params, const Units &units) 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