PolyFEM
Loading...
Searching...
No Matches
polyfem::solver::VariableToSimulation Class Referenceabstract

Maps the optimization variable to the state variable. More...

#include <VariableToSimulation.hpp>

Inheritance diagram for polyfem::solver::VariableToSimulation:
[legend]
Collaboration diagram for polyfem::solver::VariableToSimulation:
[legend]

Public Member Functions

 VariableToSimulation (const std::vector< std::shared_ptr< State > > &states, const CompositeParametrization &parametrization)
 
 VariableToSimulation (const std::shared_ptr< State > &state, const CompositeParametrization &parametrization)
 
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
 
CompositeParametrizationget_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< VariableToSimulationcreate (const std::string &type, const std::vector< std::shared_ptr< State > > &states, CompositeParametrization &&parametrization)
 

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_
 

Detailed Description

Maps the optimization variable to the state variable.

Definition at line 12 of file VariableToSimulation.hpp.

Constructor & Destructor Documentation

◆ VariableToSimulation() [1/2]

polyfem::solver::VariableToSimulation::VariableToSimulation ( const std::vector< std::shared_ptr< State > > &  states,
const CompositeParametrization parametrization 
)
inline

Definition at line 15 of file VariableToSimulation.hpp.

◆ VariableToSimulation() [2/2]

polyfem::solver::VariableToSimulation::VariableToSimulation ( const std::shared_ptr< State > &  state,
const CompositeParametrization parametrization 
)
inline

Definition at line 16 of file VariableToSimulation.hpp.

◆ ~VariableToSimulation()

virtual polyfem::solver::VariableToSimulation::~VariableToSimulation ( )
inlinevirtual

Definition at line 17 of file VariableToSimulation.hpp.

Member Function Documentation

◆ apply_parametrization_jacobian()

Eigen::VectorXd polyfem::solver::VariableToSimulation::apply_parametrization_jacobian ( const Eigen::VectorXd &  term,
const Eigen::VectorXd &  x 
) const
virtual

◆ compute_adjoint_term()

◆ create()

std::unique_ptr< VariableToSimulation > polyfem::solver::VariableToSimulation::create ( const std::string &  type,
const std::vector< std::shared_ptr< State > > &  states,
CompositeParametrization &&  parametrization 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_output_indexing()

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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_parameter_type()

◆ get_parametrization()

CompositeParametrization & polyfem::solver::VariableToSimulation::get_parametrization ( )
inline

Definition at line 31 of file VariableToSimulation.hpp.

References parametrization_.

◆ get_states()

const std::vector< std::shared_ptr< State > > & polyfem::solver::VariableToSimulation::get_states ( ) const
inline

Definition at line 29 of file VariableToSimulation.hpp.

References states_.

◆ inverse_eval()

Eigen::VectorXd polyfem::solver::VariableToSimulation::inverse_eval ( )
virtual

◆ n_states()

int polyfem::solver::VariableToSimulation::n_states ( ) const
inline

Definition at line 28 of file VariableToSimulation.hpp.

References states_.

◆ name()

◆ set_output_indexing()

void polyfem::solver::VariableToSimulation::set_output_indexing ( const json args)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update()

virtual void polyfem::solver::VariableToSimulation::update ( const Eigen::VectorXd &  x)
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.

Here is the call graph for this function:

◆ update_state()

void polyfem::solver::VariableToSimulation::update_state ( const Eigen::VectorXd &  state_variable,
const Eigen::VectorXi &  indices 
)
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().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ output_indexing_

◆ parametrization_

◆ states_

const std::vector<std::shared_ptr<State> > polyfem::solver::VariableToSimulation::states_
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().


The documentation for this class was generated from the following files: