27 std::string
name()
const override {
return "spatial_integral"; }
48 :
SpatialIntegralForm(variable_to_simulations, std::move(state), std::move(diff_cache), args)
52 auto tmp_ids = args[
"volume_selection"].get<std::vector<int>>();
53 ids_ = std::set(tmp_ids.begin(), tmp_ids.end());
56 std::string
name()
const override {
return "elastic_energy"; }
68 :
SpatialIntegralForm(variable_to_simulations, std::move(state), std::move(diff_cache), args)
72 auto tmp_ids = args[
"volume_selection"].get<std::vector<int>>();
73 ids_ = std::set(tmp_ids.begin(), tmp_ids.end());
75 if (args[
"power"] > 0)
79 std::string
name()
const override {
return "stress_norm"; }
94 :
SpatialIntegralForm(variable_to_simulations, std::move(state), std::move(diff_cache), args)
97 std::string formulation =
state_->formulation();
98 if (!(formulation ==
"Laplacian" || formulation ==
"Electrostatics"))
103 auto tmp_ids = args[
"volume_selection"].get<std::vector<int>>();
104 ids_ = std::set(tmp_ids.begin(), tmp_ids.end());
107 std::string
name()
const override {
return "dirichlet_energy"; }
119 :
SpatialIntegralForm(variable_to_simulations, std::move(state), std::move(diff_cache), args)
123 auto tmp_ids = args[
"volume_selection"].get<std::vector<int>>();
124 ids_ = std::set(tmp_ids.begin(), tmp_ids.end());
127 std::string
name()
const override {
return "compliance"; }
139 :
SpatialIntegralForm(variable_to_simulations, std::move(state), std::move(diff_cache), args)
143 auto tmp_ids = args[
"volume_selection"].get<std::vector<int>>();
144 ids_ = std::set(tmp_ids.begin(), tmp_ids.end());
162 :
SpatialIntegralForm(variable_to_simulations, std::move(state), std::move(diff_cache), args)
166 auto tmp_ids = args[
"volume_selection"].get<std::vector<int>>();
167 ids_ = std::set(tmp_ids.begin(), tmp_ids.end());
169 set_dim(args[
"dim"].get<int>());
185 :
SpatialIntegralForm(variable_to_simulations, std::move(state), std::move(diff_cache), args)
189 auto tmp_ids = args[
"volume_selection"].get<std::vector<int>>();
190 ids_ = std::set(tmp_ids.begin(), tmp_ids.end());
201 :
SpatialIntegralForm(variable_to_simulations, std::move(state), std::move(diff_cache), args)
205 auto tmp_ids = args[
"volume_selection"].get<std::vector<int>>();
206 ids_ = std::set(tmp_ids.begin(), tmp_ids.end());
208 dimensions_ = args[
"dimensions"].get<std::vector<int>>();
211 std::string
name()
const override {
return "stress"; }
225 :
SpatialIntegralForm(variable_to_simulations, std::move(state), std::move(diff_cache), args)
229 auto tmp_ids = args[
"volume_selection"].get<std::vector<int>>();
230 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
A collection of VariableToSimulation.
void log_and_throw_adjoint_error(const std::string &msg)