|
PolyFEM
|
#include <AdjointNLProblem.hpp>
Public Member Functions | |
| AdjointNLProblem (std::shared_ptr< AdjointForm > form, const VariableToSimulationGroup &variables_to_simulation, const std::vector< std::shared_ptr< State > > &all_states, const std::vector< std::shared_ptr< DiffCache > > &all_diff_caches, const json &args) | |
| AdjointNLProblem (std::shared_ptr< AdjointForm > form, const std::vector< std::shared_ptr< AdjointForm > > &stopping_conditions, const VariableToSimulationGroup &variables_to_simulation, const std::vector< std::shared_ptr< State > > &all_states, const std::vector< std::shared_ptr< DiffCache > > &all_diff_caches, const json &args) | |
| double | value (const Eigen::VectorXd &x) override |
| void | gradient (const Eigen::VectorXd &x, Eigen::VectorXd &gradv) override |
| void | hessian (const Eigen::VectorXd &x, StiffnessMatrix &hessian) override |
| void | save_to_file (const int iter_num, const Eigen::VectorXd &x0) |
| bool | is_step_valid (const Eigen::VectorXd &x0, const Eigen::VectorXd &x1) override |
| bool | is_step_collision_free (const Eigen::VectorXd &x0, const Eigen::VectorXd &x1) override |
| double | max_step_size (const Eigen::VectorXd &x0, const Eigen::VectorXd &x1) override |
| void | line_search_begin (const Eigen::VectorXd &x0, const Eigen::VectorXd &x1) override |
| void | line_search_end () override |
| void | post_step (const polysolve::nonlinear::PostStepData &data) override |
| bool | stop (const TVector &x) override |
| void | solution_changed (const Eigen::VectorXd &new_x) override |
| bool | after_line_search_custom_operation (const Eigen::VectorXd &x0, const Eigen::VectorXd &x1) override |
| void | solve_pde () |
Public Member Functions inherited from polyfem::solver::FullNLProblem | |
| FullNLProblem (const std::vector< std::shared_ptr< Form > > &forms) | |
| virtual | ~FullNLProblem ()=default |
| virtual void | init (const TVector &x0) override |
| virtual double | value (const TVector &x) override |
| virtual void | gradient (const TVector &x, TVector &gradv) override |
| virtual void | hessian (const TVector &x, THessian &hessian) override |
| virtual bool | is_step_valid (const TVector &x0, const TVector &x1) override |
| virtual bool | is_step_collision_free (const TVector &x0, const TVector &x1) |
| virtual double | max_step_size (const TVector &x0, const TVector &x1) override |
| virtual void | line_search_begin (const TVector &x0, const TVector &x1) override |
| virtual void | set_project_to_psd (bool val) override |
| virtual void | solution_changed (const TVector &new_x) override |
| virtual void | init_lagging (const TVector &x) |
| virtual void | update_lagging (const TVector &x, const int iter_num) |
| int | max_lagging_iterations () const |
| bool | uses_lagging () const |
| std::vector< std::shared_ptr< Form > > & | forms () |
| void | finish () |
| virtual double | normalize_forms () |
Private Attributes | |
| std::shared_ptr< AdjointForm > | form_ |
| VariableToSimulationGroup | variables_to_simulation_ |
| std::vector< std::shared_ptr< State > > | all_states_ |
| std::vector< std::shared_ptr< DiffCache > > | all_diff_caches_ |
| std::vector< bool > | active_state_mask |
| Eigen::VectorXd | cur_grad |
| Eigen::VectorXd | curr_x |
| int | save_freq |
| std::ofstream | solution_ostream |
| bool | enable_slim |
| bool | smooth_line_search |
| bool | solve_in_parallel |
| std::vector< int > | solve_in_order |
| int | save_iter = 0 |
| std::vector< std::shared_ptr< AdjointForm > > | stopping_conditions_ |
Additional Inherited Members | |
Protected Attributes inherited from polyfem::solver::FullNLProblem | |
| std::vector< std::shared_ptr< Form > > | forms_ |
Definition at line 24 of file AdjointNLProblem.hpp.
| polyfem::solver::AdjointNLProblem::AdjointNLProblem | ( | std::shared_ptr< AdjointForm > | form, |
| const VariableToSimulationGroup & | variables_to_simulation, | ||
| const std::vector< std::shared_ptr< State > > & | all_states, | ||
| const std::vector< std::shared_ptr< DiffCache > > & | all_diff_caches, | ||
| const json & | args | ||
| ) |
Definition at line 131 of file AdjointNLProblem.cpp.
| polyfem::solver::AdjointNLProblem::AdjointNLProblem | ( | std::shared_ptr< AdjointForm > | form, |
| const std::vector< std::shared_ptr< AdjointForm > > & | stopping_conditions, | ||
| const VariableToSimulationGroup & | variables_to_simulation, | ||
| const std::vector< std::shared_ptr< State > > & | all_states, | ||
| const std::vector< std::shared_ptr< DiffCache > > & | all_diff_caches, | ||
| const json & | args | ||
| ) |
Definition at line 191 of file AdjointNLProblem.cpp.
References stopping_conditions_.
|
override |
Definition at line 406 of file AdjointNLProblem.cpp.
References polyfem::adjoint_logger(), all_states_, polyfem::mesh::apply_slim(), polyfem::solver::VariableToSimulationGroup::data, enable_slim, polyfem::F, polyfem::log_and_throw_adjoint_error(), V, and variables_to_simulation_.
|
override |
Definition at line 211 of file AdjointNLProblem.cpp.
References polyfem::adjoint_logger(), all_diff_caches_, all_states_, cur_grad, form_, POLYFEM_SCOPED_TIMER, polyfem::solve_adjoint_cached(), and x.
|
override |
Definition at line 201 of file AdjointNLProblem.cpp.
References polyfem::log_and_throw_adjoint_error().
|
override |
Definition at line 287 of file AdjointNLProblem.cpp.
References form_.
|
override |
Definition at line 239 of file AdjointNLProblem.cpp.
References polyfem::adjoint_logger(), all_states_, polyfem::mesh::apply_slim(), polyfem::solver::VariableToSimulationGroup::data, polyfem::F, form_, polyfem::utils::is_flipped(), polyfem::solver::PeriodicShape, polyfem::solver::Shape, smooth_line_search, polyfem::utils::unflatten(), polyfem::mesh::V0, polyfem::mesh::V1, and variables_to_simulation_.
|
override |
Definition at line 297 of file AdjointNLProblem.cpp.
References form_.
|
overridevirtual |
Reimplemented from polyfem::solver::FullNLProblem.
Definition at line 302 of file AdjointNLProblem.cpp.
References form_.
|
override |
Definition at line 292 of file AdjointNLProblem.cpp.
References form_.
|
overridevirtual |
Reimplemented from polyfem::solver::FullNLProblem.
Definition at line 307 of file AdjointNLProblem.cpp.
References form_, save_iter, and save_to_file().
| void polyfem::solver::AdjointNLProblem::save_to_file | ( | const int | iter_num, |
| const Eigen::VectorXd & | x0 | ||
| ) |
Definition at line 314 of file AdjointNLProblem.cpp.
References polyfem::adjoint_logger(), all_diff_caches_, all_states_, polyfem::F, save_freq, solution_ostream, V, polyfem::io::OBJWriter::write(), and polyfem::io::MshWriter::write().
Referenced by post_step().
|
override |
Definition at line 380 of file AdjointNLProblem.cpp.
References all_states_, curr_x, polyfem::solver::VariableToSimulationGroup::data, form_, polyfem::solver::PeriodicShape, polyfem::solver::Shape, solve_pde(), and variables_to_simulation_.
| void polyfem::solver::AdjointNLProblem::solve_pde | ( | ) |
Definition at line 447 of file AdjointNLProblem.cpp.
References polyfem::adjoint_logger(), all_states_, polyfem::utils::maybe_parallel_for(), and solve_in_parallel.
Referenced by solution_changed().
|
overridevirtual |
Reimplemented from polyfem::solver::FullNLProblem.
Definition at line 507 of file AdjointNLProblem.cpp.
References stopping_conditions_, and x.
|
override |
Definition at line 206 of file AdjointNLProblem.cpp.
|
private |
Definition at line 63 of file AdjointNLProblem.hpp.
|
private |
Definition at line 62 of file AdjointNLProblem.hpp.
Referenced by gradient(), and save_to_file().
|
private |
Definition at line 61 of file AdjointNLProblem.hpp.
Referenced by after_line_search_custom_operation(), gradient(), is_step_valid(), save_to_file(), solution_changed(), and solve_pde().
|
private |
Definition at line 64 of file AdjointNLProblem.hpp.
Referenced by gradient().
|
private |
Definition at line 65 of file AdjointNLProblem.hpp.
Referenced by solution_changed().
|
private |
Definition at line 70 of file AdjointNLProblem.hpp.
Referenced by after_line_search_custom_operation().
|
private |
Definition at line 59 of file AdjointNLProblem.hpp.
Referenced by gradient(), is_step_collision_free(), is_step_valid(), line_search_begin(), line_search_end(), max_step_size(), post_step(), solution_changed(), and value().
|
private |
Definition at line 67 of file AdjointNLProblem.hpp.
Referenced by save_to_file().
|
private |
Definition at line 76 of file AdjointNLProblem.hpp.
Referenced by post_step().
|
private |
Definition at line 71 of file AdjointNLProblem.hpp.
Referenced by is_step_valid().
|
private |
Definition at line 68 of file AdjointNLProblem.hpp.
Referenced by save_to_file().
|
private |
Definition at line 74 of file AdjointNLProblem.hpp.
|
private |
Definition at line 73 of file AdjointNLProblem.hpp.
Referenced by solve_pde().
|
private |
Definition at line 78 of file AdjointNLProblem.hpp.
Referenced by AdjointNLProblem(), and stop().
|
private |
Definition at line 60 of file AdjointNLProblem.hpp.
Referenced by after_line_search_custom_operation(), is_step_valid(), and solution_changed().