PolyFEM
Loading...
Searching...
No Matches
VolumePenalty.cpp
Go to the documentation of this file.
1#include "VolumePenalty.hpp"
2
3namespace polyfem::assembler
4{
6 : k_("k")
7 {
8 }
9
10 void VolumePenalty::add_multimaterial(const int index, const json &params, const Units &units)
11 {
12 k_.add_multimaterial(index, params, units.stress());
13 }
14
15 std::map<std::string, Assembler::ParamFunc> VolumePenalty::parameters() const
16 {
17 std::map<std::string, ParamFunc> res;
18
19 res["k"] = [this](const RowVectorNd &, const RowVectorNd &p, double t, int e) {
20 return k_(p, t, e);
21 };
22
23 return res;
24 }
25} // namespace polyfem::assembler
std::string stress() const
Definition Units.hpp:27
void add_multimaterial(const int index, const json &params, const std::string &unit_type)
Definition MatParams.cpp:30
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