PolyFEM
|
#include <NLProblem.hpp>
Public Member Functions | |
NLProblem (const int full_size, const std::shared_ptr< utils::PeriodicBoundary > &periodic_bc, const double t, const std::vector< std::shared_ptr< Form > > &forms, const std::vector< std::shared_ptr< AugmentedLagrangianForm > > &penalty_forms) | |
virtual | ~NLProblem ()=default |
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) override |
virtual double | max_step_size (const TVector &x0, const TVector &x1) override |
void | line_search_begin (const TVector &x0, const TVector &x1) override |
virtual void | post_step (const polysolve::nonlinear::PostStepData &data) override |
void | solution_changed (const TVector &new_x) override |
void | init_lagging (const TVector &x) override |
void | update_lagging (const TVector &x, const int iter_num) override |
virtual void | update_quantities (const double t, const TVector &x) |
int | full_size () const |
int | reduced_size () const |
void | use_full_size () |
void | use_reduced_size () |
virtual TVector | full_to_reduced (const TVector &full) const |
virtual TVector | full_to_reduced_grad (const TVector &full) const |
virtual void | full_hessian_to_reduced_hessian (const THessian &full, THessian &reduced) const |
virtual TVector | reduced_to_full (const TVector &reduced) const |
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 void | line_search_end () override |
virtual void | set_project_to_psd (bool val) override |
int | max_lagging_iterations () const |
bool | uses_lagging () const |
std::vector< std::shared_ptr< Form > > & | forms () |
virtual bool | stop (const TVector &x) override |
void | finish () |
Protected Types | |
enum class | CurrentSize { FULL_SIZE , REDUCED_SIZE } |
Protected Member Functions | |
NLProblem (const int full_size, const std::vector< std::shared_ptr< Form > > &forms, const std::vector< std::shared_ptr< AugmentedLagrangianForm > > &penalty_forms) | |
virtual Eigen::MatrixXd | constraint_values (const TVector &reduced) const |
int | current_size () const |
Protected Attributes | |
std::vector< int > | constraint_nodes_ |
const int | full_size_ |
Size of the full problem. | |
int | reduced_size_ |
Size of the reduced problem. | |
std::shared_ptr< utils::PeriodicBoundary > | periodic_bc_ |
CurrentSize | current_size_ |
Current size of the problem (either full or reduced size) | |
double | t_ |
Protected Attributes inherited from polyfem::solver::FullNLProblem | |
std::vector< std::shared_ptr< Form > > | forms_ |
Private Member Functions | |
void | setup_constrain_nodes () |
template<class FullMat , class ReducedMat > | |
void | full_to_reduced_aux (const std::vector< int > &constraint_nodes, const int full_size, const int reduced_size, const FullMat &full, ReducedMat &reduced) const |
template<class ReducedMat , class FullMat > | |
void | reduced_to_full_aux (const std::vector< int > &constraint_nodes, const int full_size, const int reduced_size, const ReducedMat &reduced, const Eigen::MatrixXd &rhs, FullMat &full) const |
template<class FullMat , class ReducedMat > | |
void | full_to_reduced_aux_grad (const std::vector< int > &constraint_nodes, const int full_size, const int reduced_size, const FullMat &full, ReducedMat &reduced) const |
Private Attributes | |
std::vector< std::shared_ptr< AugmentedLagrangianForm > > | penalty_forms_ |
Definition at line 9 of file NLProblem.hpp.
|
strongprotected |
Enumerator | |
---|---|
FULL_SIZE | |
REDUCED_SIZE |
Definition at line 70 of file NLProblem.hpp.
|
protected |
Definition at line 22 of file NLProblem.cpp.
References constraint_nodes_, full_size_, reduced_size_, setup_constrain_nodes(), and use_reduced_size().
polyfem::solver::NLProblem::NLProblem | ( | const int | full_size, |
const std::shared_ptr< utils::PeriodicBoundary > & | periodic_bc, | ||
const double | t, | ||
const std::vector< std::shared_ptr< Form > > & | forms, | ||
const std::vector< std::shared_ptr< AugmentedLagrangianForm > > & | penalty_forms | ||
) |
Definition at line 37 of file NLProblem.cpp.
References constraint_nodes_, full_size(), full_size_, reduced_size_, setup_constrain_nodes(), and use_reduced_size().
|
virtualdefault |
|
protectedvirtual |
Reimplemented in polyfem::solver::NLHomoProblem, and polyfem::solver::StaticBoundaryNLProblem.
Definition at line 170 of file NLProblem.cpp.
References full_size(), and penalty_forms_.
Referenced by reduced_to_full().
|
inlineprotected |
Definition at line 76 of file NLProblem.hpp.
References current_size_, full_size(), FULL_SIZE, and reduced_size().
Referenced by full_hessian_to_reduced_hessian(), full_to_reduced(), full_to_reduced_grad(), and reduced_to_full().
|
virtual |
Reimplemented in polyfem::solver::NLHomoProblem.
Definition at line 295 of file NLProblem.cpp.
References constraint_nodes_, current_size(), full_size(), polyfem::utils::full_to_reduced_matrix(), and periodic_bc_.
Referenced by polyfem::solver::NLHomoProblem::extended_hessian_to_reduced_hessian(), polyfem::solver::NLHomoProblem::full_hessian_to_reduced_hessian(), and hessian().
|
inline |
Definition at line 49 of file NLProblem.hpp.
References full_size_.
Referenced by polyfem::solver::NLHomoProblem::constraint_values(), constraint_values(), current_size(), full_hessian_to_reduced_hessian(), full_to_reduced(), full_to_reduced_aux(), full_to_reduced_aux_grad(), full_to_reduced_grad(), NLProblem(), reduced_to_full(), reduced_to_full_aux(), polyfem::solver::ALSolver::solve_al(), and polyfem::solver::ALSolver::solve_reduced().
|
virtual |
Reimplemented in polyfem::solver::NLHomoProblem.
Definition at line 149 of file NLProblem.cpp.
References constraint_nodes_, current_size(), full_size(), and full_to_reduced_aux().
Referenced by polyfem::solver::NLHomoProblem::extended_to_reduced(), polyfem::solver::NLHomoProblem::full_to_reduced(), polyfem::solver::ALSolver::solve_al(), polyfem::solver::ALSolver::solve_reduced(), and polyfem::State::solve_tensor_nonlinear().
|
private |
Definition at line 185 of file NLProblem.cpp.
References full_size(), periodic_bc_, and reduced_size().
Referenced by full_to_reduced().
|
private |
Definition at line 260 of file NLProblem.cpp.
References full_size(), periodic_bc_, and reduced_size().
Referenced by full_to_reduced_grad().
|
virtual |
Reimplemented in polyfem::solver::NLHomoProblem.
Definition at line 156 of file NLProblem.cpp.
References constraint_nodes_, current_size(), full_size(), and full_to_reduced_aux_grad().
Referenced by polyfem::solver::NLHomoProblem::extended_to_reduced_grad(), polyfem::solver::NLHomoProblem::full_to_reduced_grad(), and gradient().
|
overridevirtual |
Reimplemented from polyfem::solver::FullNLProblem.
Reimplemented in polyfem::solver::NLHomoProblem.
Definition at line 114 of file NLProblem.cpp.
References full_to_reduced_grad(), polyfem::solver::FullNLProblem::gradient(), reduced_to_full(), and x.
Referenced by polyfem::solver::NLHomoProblem::gradient(), and polyfem::State::solve_tensor_nonlinear().
|
overridevirtual |
Reimplemented from polyfem::solver::FullNLProblem.
Reimplemented in polyfem::solver::NLHomoProblem.
Definition at line 121 of file NLProblem.cpp.
References full_hessian_to_reduced_hessian(), polyfem::solver::FullNLProblem::hessian(), hessian(), reduced_to_full(), and x.
Referenced by polyfem::solver::NLHomoProblem::hessian(), and hessian().
|
overridevirtual |
Reimplemented from polyfem::solver::FullNLProblem.
Definition at line 70 of file NLProblem.cpp.
References polyfem::solver::FullNLProblem::init_lagging(), reduced_to_full(), and x.
Referenced by polyfem::solver::NLHomoProblem::init_lagging(), and polyfem::State::solve_tensor_nonlinear().
|
overridevirtual |
Reimplemented from polyfem::solver::FullNLProblem.
Reimplemented in polyfem::solver::NLHomoProblem.
Definition at line 103 of file NLProblem.cpp.
References polyfem::solver::FullNLProblem::is_step_collision_free(), and reduced_to_full().
Referenced by polyfem::solver::NLHomoProblem::is_step_collision_free(), polyfem::solver::ALSolver::solve_al(), and polyfem::solver::ALSolver::solve_reduced().
|
overridevirtual |
Reimplemented from polyfem::solver::FullNLProblem.
Reimplemented in polyfem::solver::NLHomoProblem.
Definition at line 98 of file NLProblem.cpp.
References polyfem::solver::FullNLProblem::is_step_valid(), and reduced_to_full().
Referenced by polyfem::solver::NLHomoProblem::is_step_valid(), polyfem::solver::ALSolver::solve_al(), and polyfem::solver::ALSolver::solve_reduced().
|
overridevirtual |
Reimplemented from polyfem::solver::FullNLProblem.
Definition at line 88 of file NLProblem.cpp.
References polyfem::solver::FullNLProblem::line_search_begin(), and reduced_to_full().
Referenced by polyfem::solver::NLHomoProblem::line_search_begin(), polyfem::solver::ALSolver::solve_al(), and polyfem::solver::ALSolver::solve_reduced().
|
overridevirtual |
Reimplemented from polyfem::solver::FullNLProblem.
Reimplemented in polyfem::solver::NLHomoProblem.
Definition at line 93 of file NLProblem.cpp.
References polyfem::solver::FullNLProblem::max_step_size(), and reduced_to_full().
Referenced by polyfem::solver::NLHomoProblem::max_step_size().
|
overridevirtual |
Reimplemented from polyfem::solver::FullNLProblem.
Reimplemented in polyfem::solver::NLHomoProblem.
Definition at line 134 of file NLProblem.cpp.
References polyfem::solver::FullNLProblem::post_step(), and reduced_to_full().
Referenced by polyfem::solver::NLHomoProblem::post_step().
|
inline |
Definition at line 50 of file NLProblem.hpp.
References reduced_size_.
Referenced by current_size(), polyfem::solver::NLHomoProblem::extended_hessian_to_reduced_hessian(), polyfem::solver::NLHomoProblem::extended_to_reduced(), polyfem::solver::NLHomoProblem::extended_to_reduced_grad(), polyfem::solver::NLHomoProblem::full_hessian_to_reduced_hessian(), polyfem::solver::NLHomoProblem::full_to_reduced(), full_to_reduced_aux(), full_to_reduced_aux_grad(), polyfem::solver::NLHomoProblem::full_to_reduced_grad(), polyfem::solver::NLHomoProblem::reduced_to_disp_grad(), polyfem::solver::NLHomoProblem::reduced_to_extended(), polyfem::solver::NLHomoProblem::reduced_to_full(), reduced_to_full_aux(), and polyfem::solver::ALSolver::solve_al().
|
virtual |
Reimplemented in polyfem::solver::NLHomoProblem.
Definition at line 163 of file NLProblem.cpp.
References constraint_nodes_, constraint_values(), current_size(), full_size(), and reduced_to_full_aux().
Referenced by gradient(), hessian(), init_lagging(), is_step_collision_free(), is_step_valid(), line_search_begin(), max_step_size(), post_step(), polyfem::solver::NLHomoProblem::reduced_to_extended(), polyfem::solver::NLHomoProblem::reduced_to_full(), solution_changed(), polyfem::solver::ALSolver::solve_reduced(), polyfem::State::solve_tensor_nonlinear(), update_lagging(), update_quantities(), and value().
|
private |
Definition at line 224 of file NLProblem.cpp.
References full_size(), periodic_bc_, and reduced_size().
Referenced by reduced_to_full().
|
private |
Definition at line 57 of file NLProblem.cpp.
References constraint_nodes_, and penalty_forms_.
Referenced by NLProblem(), and NLProblem().
|
overridevirtual |
Reimplemented from polyfem::solver::FullNLProblem.
Definition at line 129 of file NLProblem.cpp.
References reduced_to_full(), and polyfem::solver::FullNLProblem::solution_changed().
Referenced by polyfem::solver::NLHomoProblem::solution_changed().
|
overridevirtual |
Reimplemented from polyfem::solver::FullNLProblem.
Definition at line 75 of file NLProblem.cpp.
References reduced_to_full(), polyfem::solver::FullNLProblem::update_lagging(), and x.
Referenced by polyfem::State::solve_tensor_nonlinear(), and polyfem::solver::NLHomoProblem::update_lagging().
|
virtual |
Reimplemented in polyfem::solver::NLHomoProblem.
Definition at line 80 of file NLProblem.cpp.
References polyfem::solver::FullNLProblem::forms_, reduced_to_full(), t_, and x.
Referenced by polyfem::solver::NLHomoProblem::update_quantities().
|
inline |
Definition at line 52 of file NLProblem.hpp.
References current_size_, and FULL_SIZE.
Referenced by polyfem::solver::ALSolver::set_al_weight().
|
inline |
Definition at line 53 of file NLProblem.hpp.
References current_size_, and REDUCED_SIZE.
Referenced by NLProblem(), NLProblem(), and polyfem::solver::ALSolver::set_al_weight().
|
overridevirtual |
Reimplemented from polyfem::solver::FullNLProblem.
Reimplemented in polyfem::solver::NLHomoProblem.
Definition at line 108 of file NLProblem.cpp.
References reduced_to_full(), polyfem::solver::FullNLProblem::value(), and x.
Referenced by polyfem::solver::ALSolver::solve_al(), polyfem::solver::ALSolver::solve_reduced(), and polyfem::solver::NLHomoProblem::value().
|
protected |
Definition at line 63 of file NLProblem.hpp.
Referenced by full_hessian_to_reduced_hessian(), full_to_reduced(), full_to_reduced_grad(), NLProblem(), NLProblem(), reduced_to_full(), and setup_constrain_nodes().
|
protected |
Current size of the problem (either full or reduced size)
Definition at line 75 of file NLProblem.hpp.
Referenced by current_size(), use_full_size(), and use_reduced_size().
|
protected |
Size of the full problem.
Definition at line 65 of file NLProblem.hpp.
Referenced by polyfem::solver::NLHomoProblem::constraint_grad(), polyfem::solver::NLHomoProblem::extended_hessian_to_reduced_hessian(), full_size(), NLProblem(), and NLProblem().
|
private |
Definition at line 84 of file NLProblem.hpp.
Referenced by constraint_values(), and setup_constrain_nodes().
|
protected |
Definition at line 68 of file NLProblem.hpp.
Referenced by full_hessian_to_reduced_hessian(), full_to_reduced_aux(), full_to_reduced_aux_grad(), and reduced_to_full_aux().
|
protected |
Size of the reduced problem.
Definition at line 66 of file NLProblem.hpp.
Referenced by NLProblem(), NLProblem(), and reduced_size().
|
protected |
Definition at line 81 of file NLProblem.hpp.
Referenced by polyfem::solver::NLHomoProblem::macro_reduced_to_full(), and update_quantities().