PolyFEM
Loading...
Searching...
No Matches
Optimizations.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <polyfem/Common.hpp>
6
7namespace polyfem
8{
9 class State;
10}
11
13{
14 class Solver;
15}
16
17namespace polyfem::solver
18{
19 class AdjointNLProblem;
20 class AdjointForm;
21 class Parametrization;
22 class VariableToSimulation;
23 class VariableToSimulationGroup;
24
26 {
27 static json apply_opt_json_spec(const json &input_args, bool strict_validation);
28
29 static std::shared_ptr<polysolve::nonlinear::Solver> make_nl_solver(const json &solver_params, const json &linear_solver_params, const double characteristic_length);
30
31 static std::shared_ptr<State> create_state(const json &args, CacheLevel level, const size_t max_threads);
32
33 static std::vector<std::shared_ptr<State>> create_states(const json &state_args, const CacheLevel &level, const size_t max_threads);
34
35 static Eigen::VectorXd inverse_evaluation(const json &args, const int ndof, const std::vector<int> &variable_sizes, VariableToSimulationGroup &var2sim);
36
37 static void solve_pde(State &state);
38
39 static std::shared_ptr<AdjointForm> create_form(const json &args, const VariableToSimulationGroup &var2sim, const std::vector<std::shared_ptr<State>> &states);
40
41 // forms that only depends on one simulator
42 static std::shared_ptr<AdjointForm> create_simple_form(const std::string &obj_type, const std::string &param_type, const std::shared_ptr<State> &state, const json &args);
43
44 static std::shared_ptr<Parametrization> create_parametrization(const json &args, const std::vector<std::shared_ptr<State>> &states, const std::vector<int> &variable_sizes);
45
46 static std::unique_ptr<VariableToSimulation> create_variable_to_simulation(const json &args, const std::vector<std::shared_ptr<State>> &states, const std::vector<int> &variable_sizes);
47
48 static int compute_variable_size(const json &args, const std::vector<std::shared_ptr<State>> &states);
49 };
50} // namespace polyfem::solver
main class that contains the polyfem solver and all its state
Definition State.hpp:79
A collection of VariableToSimulation.
nlohmann::json json
Definition Common.hpp:9
static std::shared_ptr< AdjointForm > create_form(const json &args, const VariableToSimulationGroup &var2sim, const std::vector< std::shared_ptr< State > > &states)
static std::shared_ptr< AdjointForm > create_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< polysolve::nonlinear::Solver > make_nl_solver(const json &solver_params, const json &linear_solver_params, const double characteristic_length)
static std::unique_ptr< VariableToSimulation > create_variable_to_simulation(const json &args, const std::vector< std::shared_ptr< State > > &states, const std::vector< int > &variable_sizes)
static json apply_opt_json_spec(const json &input_args, bool strict_validation)
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< Parametrization > create_parametrization(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)
static std::vector< std::shared_ptr< State > > create_states(const json &state_args, const CacheLevel &level, const size_t max_threads)
static std::shared_ptr< State > create_state(const json &args, CacheLevel level, const size_t max_threads)