PolyFEM
Loading...
Searching...
No Matches
polyfem::solver::AdjointOptUtils Struct Reference

#include <Optimizations.hpp>

Static Public Member Functions

static json apply_opt_json_spec (const json &input_args, bool strict_validation)
 
static std::shared_ptr< polysolve::nonlinear::Solver > make_nl_solver (const json &solver_params, const json &linear_solver_params, const double characteristic_length)
 
static std::shared_ptr< Statecreate_state (const json &args, CacheLevel level, const size_t max_threads)
 
static std::vector< std::shared_ptr< State > > create_states (const json &state_args, const CacheLevel &level, const size_t max_threads)
 
static Eigen::VectorXd inverse_evaluation (const json &args, const int ndof, const std::vector< int > &variable_sizes, VariableToSimulationGroup &var2sim)
 
static void solve_pde (State &state)
 
static std::shared_ptr< AdjointFormcreate_form (const json &args, const VariableToSimulationGroup &var2sim, const std::vector< std::shared_ptr< State > > &states)
 
static std::shared_ptr< AdjointFormcreate_simple_form (const std::string &obj_type, const std::string &param_type, const std::shared_ptr< State > &state, const json &args)
 
static std::shared_ptr< Parametrizationcreate_parametrization (const json &args, const std::vector< std::shared_ptr< State > > &states, const std::vector< int > &variable_sizes)
 
static std::unique_ptr< VariableToSimulationcreate_variable_to_simulation (const json &args, const std::vector< std::shared_ptr< State > > &states, const std::vector< int > &variable_sizes)
 
static int compute_variable_size (const json &args, const std::vector< std::shared_ptr< State > > &states)
 

Detailed Description

Definition at line 25 of file Optimizations.hpp.

Member Function Documentation

◆ apply_opt_json_spec()

json polyfem::solver::AdjointOptUtils::apply_opt_json_spec ( const json input_args,
bool  strict_validation 
)
static

Definition at line 579 of file Optimizations.cpp.

References polyfem::solver::apply_objective_json_spec(), and polyfem::logger().

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

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

◆ compute_variable_size()

int polyfem::solver::AdjointOptUtils::compute_variable_size ( const json args,
const std::vector< std::shared_ptr< State > > &  states 
)
static

Definition at line 638 of file Optimizations.cpp.

References polyfem::log_and_throw_adjoint_error().

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

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

◆ create_form()

std::shared_ptr< AdjointForm > polyfem::solver::AdjointOptUtils::create_form ( const json args,
const VariableToSimulationGroup var2sim,
const std::vector< std::shared_ptr< State > > &  states 
)
static

Definition at line 128 of file Optimizations.cpp.

References create_form(), create_parametrization(), polyfem::F, polyfem::log_and_throw_adjoint_error(), polyfem::log_and_throw_error(), polyfem::io::OBJReader::read(), and V.

Referenced by create_form(), and polyfem::OptState::create_problem().

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

◆ create_parametrization()

std::shared_ptr< Parametrization > polyfem::solver::AdjointOptUtils::create_parametrization ( const json args,
const std::vector< std::shared_ptr< State > > &  states,
const std::vector< int > &  variable_sizes 
)
static

Definition at line 367 of file Optimizations.cpp.

References polyfem::log_and_throw_adjoint_error(), and vals.

Referenced by create_form(), and create_variable_to_simulation().

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

◆ create_simple_form()

std::shared_ptr< AdjointForm > polyfem::solver::AdjointOptUtils::create_simple_form ( const std::string &  obj_type,
const std::string &  param_type,
const std::shared_ptr< State > &  state,
const json args 
)
static

Definition at line 82 of file Optimizations.cpp.

References polyfem::solver::VariableToSimulation::create(), polyfem::log_and_throw_adjoint_error(), and polyfem::solver::VariableToSimulationGroup::push_back().

Here is the call graph for this function:

◆ create_state()

std::shared_ptr< State > polyfem::solver::AdjointOptUtils::create_state ( const json args,
CacheLevel  level,
const size_t  max_threads 
)
static

Definition at line 497 of file Optimizations.cpp.

Referenced by create_states().

Here is the caller graph for this function:

◆ create_states()

std::vector< std::shared_ptr< State > > polyfem::solver::AdjointOptUtils::create_states ( const json state_args,
const CacheLevel level,
const size_t  max_threads 
)
static

Definition at line 528 of file Optimizations.cpp.

References create_state(), load_json(), and polyfem::log_and_throw_adjoint_error().

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

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

◆ create_variable_to_simulation()

std::unique_ptr< VariableToSimulation > polyfem::solver::AdjointOptUtils::create_variable_to_simulation ( const json args,
const std::vector< std::shared_ptr< State > > &  states,
const std::vector< int > &  variable_sizes 
)
static

Definition at line 446 of file Optimizations.cpp.

References polyfem::solver::VariableToSimulation::create(), and create_parametrization().

Referenced by polyfem::solver::VariableToSimulationGroup::init().

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

◆ inverse_evaluation()

Eigen::VectorXd polyfem::solver::AdjointOptUtils::inverse_evaluation ( const json args,
const int  ndof,
const std::vector< int > &  variable_sizes,
VariableToSimulationGroup var2sim 
)
static

Definition at line 467 of file Optimizations.cpp.

References x.

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

Here is the caller graph for this function:

◆ make_nl_solver()

std::shared_ptr< polysolve::nonlinear::Solver > polyfem::solver::AdjointOptUtils::make_nl_solver ( const json solver_params,
const json linear_solver_params,
const double  characteristic_length 
)
static

Definition at line 69 of file Optimizations.cpp.

References polyfem::adjoint_logger(), and polyfem::log_and_throw_adjoint_error().

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

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

◆ solve_pde()

void polyfem::solver::AdjointOptUtils::solve_pde ( State state)
static

Definition at line 543 of file Optimizations.cpp.

References polyfem::State::assemble_mass_mat(), polyfem::State::assemble_rhs(), and polyfem::State::solve_problem().

Here is the call graph for this function:

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