PolyFEM
|
A collection of VariableToSimulation. More...
#include <VariableToSimulation.hpp>
Public Types | |
using | ValueType = std::shared_ptr< VariableToSimulation > |
typedef std::vector< ValueType >::const_iterator | const_iterator |
Public Member Functions | |
VariableToSimulationGroup ()=default | |
virtual | ~VariableToSimulationGroup ()=default |
void | init (const json &args, const std::vector< std::shared_ptr< State > > &states, const std::vector< int > &variable_sizes) |
void | update (const Eigen::VectorXd &x) |
Update parameters in simulators. | |
void | compute_state_variable (const ParameterType type, const State *state_ptr, const Eigen::VectorXd &x, Eigen::VectorXd &state_variable) const |
Evaluate the variable to simulations and overwrite the state_variable based on x. | |
Eigen::VectorXd | compute_adjoint_term (const Eigen::VectorXd &x) const |
Computes the sum of adjoint terms for all VariableToSimulation. | |
virtual Eigen::VectorXd | apply_parametrization_jacobian (const ParameterType type, const State *state_ptr, const Eigen::VectorXd &x, const std::function< Eigen::VectorXd()> &grad) const |
Maps the partial gradient wrt. | |
ValueType & | operator[] (size_t i) |
const ValueType & | operator[] (size_t i) const |
const_iterator | begin () const |
const_iterator | end () const |
void | push_back (const ValueType &v2s) |
void | clear () |
Private Attributes | |
std::vector< ValueType > | L |
A collection of VariableToSimulation.
Definition at line 50 of file VariableToSimulation.hpp.
typedef std::vector<ValueType>::const_iterator polyfem::solver::VariableToSimulationGroup::const_iterator |
Definition at line 86 of file VariableToSimulation.hpp.
using polyfem::solver::VariableToSimulationGroup::ValueType = std::shared_ptr<VariableToSimulation> |
Definition at line 53 of file VariableToSimulation.hpp.
|
default |
|
virtualdefault |
|
virtual |
Maps the partial gradient wrt.
the state variable to the partial gradient wrt. the optimization variable
type | Type of state variable |
state_ptr | The state that stores the state variable |
x | Optimization variable |
grad | Partial gradient wrt. the state variable, lambda function to allow lazy evaluation of the gradient |
Definition at line 127 of file VariableToSimulation.cpp.
Referenced by polyfem::solver::AMIPSForm::compute_partial_gradient(), polyfem::solver::CollisionBarrierForm::compute_partial_gradient(), polyfem::solver::DeformedCollisionBarrierForm::compute_partial_gradient(), polyfem::solver::BoundarySmoothingForm::compute_partial_gradient(), polyfem::solver::SpatialIntegralForm::compute_partial_gradient_step(), polyfem::solver::ElasticEnergyForm::compute_partial_gradient_step(), polyfem::solver::StressNormForm::compute_partial_gradient_step(), polyfem::solver::ComplianceForm::compute_partial_gradient_step(), polyfem::solver::StressForm::compute_partial_gradient_step(), polyfem::solver::ProxyContactForceForm::compute_partial_gradient_step(), and polyfem::solver::NodeTargetForm::compute_partial_gradient_step().
|
inline |
Definition at line 90 of file VariableToSimulation.hpp.
References L.
|
inline |
Definition at line 93 of file VariableToSimulation.hpp.
References L.
Eigen::VectorXd polyfem::solver::VariableToSimulationGroup::compute_adjoint_term | ( | const Eigen::VectorXd & | x | ) | const |
Computes the sum of adjoint terms for all VariableToSimulation.
x | Optimization variable |
Definition at line 101 of file VariableToSimulation.cpp.
Referenced by polyfem::solver::AdjointForm::first_derivative().
void polyfem::solver::VariableToSimulationGroup::compute_state_variable | ( | const ParameterType | type, |
const State * | state_ptr, | ||
const Eigen::VectorXd & | x, | ||
Eigen::VectorXd & | state_variable | ||
) | const |
Evaluate the variable to simulations and overwrite the state_variable based on x.
x | Optimization variable |
state_variable | The state variable in state_ptr with type |
Definition at line 109 of file VariableToSimulation.cpp.
Referenced by polyfem::solver::AMIPSForm::get_updated_mesh_nodes(), polyfem::solver::CollisionBarrierForm::get_updated_mesh_nodes(), and polyfem::solver::DeformedCollisionBarrierForm::get_updated_mesh_nodes().
|
inline |
Definition at line 91 of file VariableToSimulation.hpp.
References L.
void polyfem::solver::VariableToSimulationGroup::init | ( | const json & | args, |
const std::vector< std::shared_ptr< State > > & | states, | ||
const std::vector< int > & | variable_sizes | ||
) |
Definition at line 94 of file VariableToSimulation.cpp.
References polyfem::solver::AdjointOptUtils::create_variable_to_simulation(), and L.
Referenced by polyfem::OptState::init_variables().
|
inline |
Definition at line 88 of file VariableToSimulation.hpp.
References L.
|
inline |
Definition at line 89 of file VariableToSimulation.hpp.
References L.
|
inline |
Definition at line 92 of file VariableToSimulation.hpp.
References L.
Referenced by polyfem::solver::AdjointOptUtils::create_simple_form().
|
inline |
Update parameters in simulators.
x | Optimization variable |
Definition at line 62 of file VariableToSimulation.hpp.
Referenced by polyfem::OptState::initial_guess().
|
private |
Definition at line 96 of file VariableToSimulation.hpp.
Referenced by apply_parametrization_jacobian(), begin(), clear(), compute_adjoint_term(), compute_state_variable(), end(), init(), operator[](), operator[](), push_back(), and update().