PolyFEM
Loading...
Searching...
No Matches
polyfem::solver::VariableToSimulationGroup Class Reference

A collection of VariableToSimulation. More...

#include <VariableToSimulation.hpp>

Public Member Functions

virtual ~VariableToSimulationGroup ()=default
 
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.
 

Public Attributes

std::vector< std::shared_ptr< VariableToSimulation > > data
 

Detailed Description

A collection of VariableToSimulation.

Definition at line 62 of file VariableToSimulation.hpp.

Constructor & Destructor Documentation

◆ ~VariableToSimulationGroup()

virtual polyfem::solver::VariableToSimulationGroup::~VariableToSimulationGroup ( )
virtualdefault

Member Function Documentation

◆ apply_parametrization_jacobian()

Eigen::VectorXd polyfem::solver::VariableToSimulationGroup::apply_parametrization_jacobian ( const ParameterType  type,
const State state_ptr,
const Eigen::VectorXd &  x,
const std::function< Eigen::VectorXd()> &  grad 
) const
virtual

Maps the partial gradient wrt.

the state variable to the partial gradient wrt. the optimization variable

Parameters
typeType of state variable
state_ptrThe state that stores the state variable
xOptimization variable
gradPartial gradient wrt. the state variable, lambda function to allow lazy evaluation of the gradient
Returns
Partial gradient wrt. the optimization variable

Definition at line 110 of file VariableToSimulation.cpp.

References data, and x.

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::SmoothContactForceForm::compute_partial_gradient_step(), polyfem::solver::SpatialIntegralForm::compute_partial_gradient_step(), polyfem::solver::ElasticEnergyForm::compute_partial_gradient_step(), polyfem::solver::StressNormForm::compute_partial_gradient_step(), polyfem::solver::DirichletEnergyForm::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().

Here is the caller graph for this function:

◆ compute_adjoint_term()

Eigen::VectorXd polyfem::solver::VariableToSimulationGroup::compute_adjoint_term ( const Eigen::VectorXd &  x) const

Computes the sum of adjoint terms for all VariableToSimulation.

Parameters
xOptimization variable
Returns
Sum of adjoint terms

Definition at line 84 of file VariableToSimulation.cpp.

References data, and x.

Referenced by polyfem::solver::AdjointForm::first_derivative().

Here is the caller graph for this function:

◆ compute_state_variable()

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.

Parameters
xOptimization variable
state_variableThe state variable in state_ptr with type

Definition at line 92 of file VariableToSimulation.cpp.

References data, and x.

Referenced by polyfem::solver::AMIPSForm::get_updated_mesh_nodes(), polyfem::solver::CollisionBarrierForm::get_updated_mesh_nodes(), and polyfem::solver::DeformedCollisionBarrierForm::get_updated_mesh_nodes().

Here is the caller graph for this function:

◆ update()

void polyfem::solver::VariableToSimulationGroup::update ( const Eigen::VectorXd &  x)
inline

Update parameters in simulators.

Parameters
xOptimization variable

Definition at line 69 of file VariableToSimulation.hpp.

References data, and x.

Referenced by polyfem::OptState::initial_guess().

Here is the caller graph for this function:

Member Data Documentation

◆ data


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