PolyFEM
|
Maps the optimization variable to the state variable. More...
#include <VariableToSimulation.hpp>
Public Member Functions | |
VariableToSimulation (const std::vector< std::shared_ptr< State > > &states, const CompositeParametrization ¶metrization) | |
VariableToSimulation (const std::shared_ptr< State > &state, const CompositeParametrization ¶metrization) | |
virtual | ~VariableToSimulation () |
virtual void | update (const Eigen::VectorXd &x) |
virtual std::string | name () const =0 |
int | n_states () const |
const std::vector< std::shared_ptr< State > > & | get_states () const |
CompositeParametrization & | get_parametrization () |
virtual ParameterType | get_parameter_type () const =0 |
virtual Eigen::VectorXd | compute_adjoint_term (const Eigen::VectorXd &x) const =0 |
virtual Eigen::VectorXd | inverse_eval () |
virtual void | set_output_indexing (const json &args) |
Eigen::VectorXi | get_output_indexing (const Eigen::VectorXd &x) const |
virtual Eigen::VectorXd | apply_parametrization_jacobian (const Eigen::VectorXd &term, const Eigen::VectorXd &x) const |
Static Public Member Functions | |
static std::unique_ptr< VariableToSimulation > | create (const std::string &type, const std::vector< std::shared_ptr< State > > &states, CompositeParametrization &¶metrization) |
Protected Member Functions | |
virtual void | update_state (const Eigen::VectorXd &state_variable, const Eigen::VectorXi &indices) |
Protected Attributes | |
const std::vector< std::shared_ptr< State > > | states_ |
CompositeParametrization | parametrization_ |
Eigen::VectorXi | output_indexing_ |
Maps the optimization variable to the state variable.
Definition at line 12 of file VariableToSimulation.hpp.
|
inline |
Definition at line 15 of file VariableToSimulation.hpp.
|
inline |
Definition at line 16 of file VariableToSimulation.hpp.
|
inlinevirtual |
Definition at line 17 of file VariableToSimulation.hpp.
|
virtual |
Reimplemented in polyfem::solver::PeriodicShapeVariableToSimulation.
Definition at line 78 of file VariableToSimulation.cpp.
References polyfem::solver::CompositeParametrization::apply_jacobian(), get_output_indexing(), parametrization_, and x.
Referenced by polyfem::solver::ShapeVariableToSimulation::compute_adjoint_term(), polyfem::solver::ElasticVariableToSimulation::compute_adjoint_term(), polyfem::solver::FrictionCoeffientVariableToSimulation::compute_adjoint_term(), polyfem::solver::DampingCoeffientVariableToSimulation::compute_adjoint_term(), polyfem::solver::InitialConditionVariableToSimulation::compute_adjoint_term(), polyfem::solver::DirichletVariableToSimulation::compute_adjoint_term(), polyfem::solver::PressureVariableToSimulation::compute_adjoint_term(), and polyfem::solver::PeriodicShapeVariableToSimulation::compute_adjoint_term().
|
pure virtual |
Implemented in polyfem::solver::ShapeVariableToSimulation, polyfem::solver::ElasticVariableToSimulation, polyfem::solver::FrictionCoeffientVariableToSimulation, polyfem::solver::DampingCoeffientVariableToSimulation, polyfem::solver::InitialConditionVariableToSimulation, polyfem::solver::DirichletVariableToSimulation, polyfem::solver::PressureVariableToSimulation, and polyfem::solver::PeriodicShapeVariableToSimulation.
|
static |
Definition at line 14 of file VariableToSimulation.cpp.
References polyfem::log_and_throw_adjoint_error().
Referenced by polyfem::solver::AdjointOptUtils::create_simple_form(), and polyfem::solver::AdjointOptUtils::create_variable_to_simulation().
Eigen::VectorXi polyfem::solver::VariableToSimulation::get_output_indexing | ( | const Eigen::VectorXd & | x | ) | const |
Definition at line 62 of file VariableToSimulation.cpp.
References polyfem::log_and_throw_adjoint_error(), name(), output_indexing_, parametrization_, polyfem::solver::CompositeParametrization::size(), and x.
Referenced by apply_parametrization_jacobian(), polyfem::solver::ShapeVariableToSimulation::inverse_eval(), and update().
|
pure virtual |
Implemented in polyfem::solver::ShapeVariableToSimulation, polyfem::solver::ElasticVariableToSimulation, polyfem::solver::FrictionCoeffientVariableToSimulation, polyfem::solver::DampingCoeffientVariableToSimulation, polyfem::solver::InitialConditionVariableToSimulation, polyfem::solver::DirichletVariableToSimulation, polyfem::solver::PressureVariableToSimulation, and polyfem::solver::PeriodicShapeVariableToSimulation.
|
inline |
Definition at line 31 of file VariableToSimulation.hpp.
References parametrization_.
|
inline |
Definition at line 29 of file VariableToSimulation.hpp.
References states_.
|
virtual |
Reimplemented in polyfem::solver::ShapeVariableToSimulation, polyfem::solver::ElasticVariableToSimulation, polyfem::solver::FrictionCoeffientVariableToSimulation, polyfem::solver::DampingCoeffientVariableToSimulation, polyfem::solver::InitialConditionVariableToSimulation, polyfem::solver::DirichletVariableToSimulation, polyfem::solver::PressureVariableToSimulation, and polyfem::solver::PeriodicShapeVariableToSimulation.
Definition at line 83 of file VariableToSimulation.cpp.
References polyfem::log_and_throw_adjoint_error(), and name().
|
inline |
Definition at line 28 of file VariableToSimulation.hpp.
References states_.
|
pure virtual |
Implemented in polyfem::solver::ShapeVariableToSimulation, polyfem::solver::ElasticVariableToSimulation, polyfem::solver::FrictionCoeffientVariableToSimulation, polyfem::solver::DampingCoeffientVariableToSimulation, polyfem::solver::InitialConditionVariableToSimulation, polyfem::solver::DirichletVariableToSimulation, polyfem::solver::PressureVariableToSimulation, and polyfem::solver::PeriodicShapeVariableToSimulation.
Referenced by get_output_indexing(), inverse_eval(), and update_state().
|
virtual |
Reimplemented in polyfem::solver::ShapeVariableToSimulation, polyfem::solver::DirichletVariableToSimulation, and polyfem::solver::PressureVariableToSimulation.
Definition at line 37 of file VariableToSimulation.cpp.
References polyfem::log_and_throw_adjoint_error(), output_indexing_, polyfem::io::read_matrix(), polyfem::State::resolve_input_path(), states_, and tmp_mat.
Referenced by polyfem::solver::ShapeVariableToSimulation::set_output_indexing(), polyfem::solver::DirichletVariableToSimulation::set_output_indexing(), and polyfem::solver::PressureVariableToSimulation::set_output_indexing().
|
inlinevirtual |
Reimplemented in polyfem::solver::PeriodicShapeVariableToSimulation.
Definition at line 21 of file VariableToSimulation.hpp.
References polyfem::solver::CompositeParametrization::eval(), get_output_indexing(), parametrization_, update_state(), and x.
|
protectedvirtual |
Reimplemented in polyfem::solver::ShapeVariableToSimulation, polyfem::solver::ElasticVariableToSimulation, polyfem::solver::FrictionCoeffientVariableToSimulation, polyfem::solver::DampingCoeffientVariableToSimulation, polyfem::solver::InitialConditionVariableToSimulation, polyfem::solver::DirichletVariableToSimulation, and polyfem::solver::PressureVariableToSimulation.
Definition at line 89 of file VariableToSimulation.cpp.
References polyfem::log_and_throw_adjoint_error(), and name().
Referenced by update().
|
protected |
Definition at line 46 of file VariableToSimulation.hpp.
Referenced by get_output_indexing(), set_output_indexing(), polyfem::solver::ShapeVariableToSimulation::set_output_indexing(), polyfem::solver::DirichletVariableToSimulation::set_output_indexing(), and polyfem::solver::PressureVariableToSimulation::set_output_indexing().
|
protected |
Definition at line 44 of file VariableToSimulation.hpp.
Referenced by apply_parametrization_jacobian(), polyfem::solver::PeriodicShapeVariableToSimulation::apply_parametrization_jacobian(), get_output_indexing(), get_parametrization(), polyfem::solver::ShapeVariableToSimulation::inverse_eval(), polyfem::solver::ElasticVariableToSimulation::inverse_eval(), polyfem::solver::DirichletVariableToSimulation::inverse_eval(), polyfem::solver::PressureVariableToSimulation::inverse_eval(), polyfem::solver::PeriodicShapeVariableToSimulation::inverse_eval(), update(), and polyfem::solver::PeriodicShapeVariableToSimulation::update().
|
protected |
Definition at line 43 of file VariableToSimulation.hpp.
Referenced by polyfem::solver::ShapeVariableToSimulation::compute_adjoint_term(), polyfem::solver::ElasticVariableToSimulation::compute_adjoint_term(), polyfem::solver::FrictionCoeffientVariableToSimulation::compute_adjoint_term(), polyfem::solver::DampingCoeffientVariableToSimulation::compute_adjoint_term(), polyfem::solver::InitialConditionVariableToSimulation::compute_adjoint_term(), polyfem::solver::DirichletVariableToSimulation::compute_adjoint_term(), polyfem::solver::PressureVariableToSimulation::compute_adjoint_term(), polyfem::solver::PeriodicShapeVariableToSimulation::compute_adjoint_term(), get_states(), polyfem::solver::ShapeVariableToSimulation::inverse_eval(), polyfem::solver::ElasticVariableToSimulation::inverse_eval(), polyfem::solver::InitialConditionVariableToSimulation::inverse_eval(), polyfem::solver::DirichletVariableToSimulation::inverse_eval(), polyfem::solver::PressureVariableToSimulation::inverse_eval(), polyfem::solver::PeriodicShapeVariableToSimulation::inverse_eval(), n_states(), set_output_indexing(), polyfem::solver::ShapeVariableToSimulation::set_output_indexing(), polyfem::solver::DirichletVariableToSimulation::set_output_indexing(), polyfem::solver::PressureVariableToSimulation::set_output_indexing(), polyfem::solver::PeriodicShapeVariableToSimulation::update(), polyfem::solver::ShapeVariableToSimulation::update_state(), polyfem::solver::ElasticVariableToSimulation::update_state(), polyfem::solver::FrictionCoeffientVariableToSimulation::update_state(), polyfem::solver::DampingCoeffientVariableToSimulation::update_state(), polyfem::solver::InitialConditionVariableToSimulation::update_state(), polyfem::solver::DirichletVariableToSimulation::update_state(), and polyfem::solver::PressureVariableToSimulation::update_state().