28 std::string
name()
const override {
return "spatial_integral"; }
39 std::shared_ptr<const legacy::State>
state_;
49 :
SpatialIntegralForm(variable_to_simulations, std::move(state), std::move(diff_cache), args)
53 auto tmp_ids = args[
"volume_selection"].get<std::vector<int>>();
54 ids_ = std::set(tmp_ids.begin(), tmp_ids.end());
57 std::string
name()
const override {
return "elastic_energy"; }
69 :
SpatialIntegralForm(variable_to_simulations, std::move(state), std::move(diff_cache), args)
73 auto tmp_ids = args[
"volume_selection"].get<std::vector<int>>();
74 ids_ = std::set(tmp_ids.begin(), tmp_ids.end());
76 if (args[
"power"] > 0)
80 std::string
name()
const override {
return "stress_norm"; }
95 :
SpatialIntegralForm(variable_to_simulations, std::move(state), std::move(diff_cache), args)
98 std::string formulation =
state_->formulation();
99 if (!(formulation ==
"Laplacian" || formulation ==
"Electrostatics"))
104 auto tmp_ids = args[
"volume_selection"].get<std::vector<int>>();
105 ids_ = std::set(tmp_ids.begin(), tmp_ids.end());
108 std::string
name()
const override {
return "dirichlet_energy"; }
120 :
SpatialIntegralForm(variable_to_simulations, std::move(state), std::move(diff_cache), args)
124 auto tmp_ids = args[
"volume_selection"].get<std::vector<int>>();
125 ids_ = std::set(tmp_ids.begin(), tmp_ids.end());
128 std::string
name()
const override {
return "compliance"; }
140 :
SpatialIntegralForm(variable_to_simulations, std::move(state), std::move(diff_cache), args)
144 auto tmp_ids = args[
"volume_selection"].get<std::vector<int>>();
145 ids_ = std::set(tmp_ids.begin(), tmp_ids.end());
163 :
SpatialIntegralForm(variable_to_simulations, std::move(state), std::move(diff_cache), args)
167 auto tmp_ids = args[
"volume_selection"].get<std::vector<int>>();
168 ids_ = std::set(tmp_ids.begin(), tmp_ids.end());
170 set_dim(args[
"dim"].get<int>());
186 :
SpatialIntegralForm(variable_to_simulations, std::move(state), std::move(diff_cache), args)
190 auto tmp_ids = args[
"volume_selection"].get<std::vector<int>>();
191 ids_ = std::set(tmp_ids.begin(), tmp_ids.end());
202 :
SpatialIntegralForm(variable_to_simulations, std::move(state), std::move(diff_cache), args)
206 auto tmp_ids = args[
"volume_selection"].get<std::vector<int>>();
207 ids_ = std::set(tmp_ids.begin(), tmp_ids.end());
209 dimensions_ = args[
"dimensions"].get<std::vector<int>>();
212 std::string
name()
const override {
return "stress"; }
226 :
SpatialIntegralForm(variable_to_simulations, std::move(state), std::move(diff_cache), args)
230 auto tmp_ids = args[
"volume_selection"].get<std::vector<int>>();
231 ids_ = std::set(tmp_ids.begin(), tmp_ids.end());
Storage for additional data required by differntial code.
main class that contains the polyfem solver and all its state
void log_and_throw_adjoint_error(const std::string &msg)