PolyFEM
Loading...
Searching...
No Matches
ALSolver.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <polysolve/nonlinear/Solver.hpp>
7#include <polyfem/Common.hpp>
8
9#include <Eigen/Core>
10
11#include <functional>
12#include <vector>
13
14namespace polyfem::solver
15{
17 {
18 using NLSolver = polysolve::nonlinear::Solver;
19
20 public:
22 std::shared_ptr<BCLagrangianForm> lagr_form,
23 std::shared_ptr<BCPenaltyForm> pen_form,
24 const double initial_al_weight,
25 const double scaling,
26 const double max_al_weight,
27 const double eta_tol,
28 const std::function<void(const Eigen::VectorXd &)> &update_barrier_stiffness);
29
30 void solve_al(std::shared_ptr<NLSolver> nl_solver, NLProblem &nl_problem, Eigen::MatrixXd &sol);
31 void solve_reduced(std::shared_ptr<NLSolver> nl_solver, NLProblem &nl_problem, Eigen::MatrixXd &sol);
32
33 std::function<void(const double)> post_subsolve = [](const double) {};
34
35 protected:
36 void set_al_weight(NLProblem &nl_problem, const Eigen::VectorXd &x, const double weight);
37
38 std::shared_ptr<BCLagrangianForm> lagr_form;
39 std::shared_ptr<BCPenaltyForm> pen_form;
40 const double initial_al_weight;
41 const double scaling;
42 const double max_al_weight;
43 const double eta_tol;
44
45 // TODO: replace this with a member function
46 std::function<void(const Eigen::VectorXd &)> update_barrier_stiffness;
47 };
48} // namespace polyfem::solver
int x
const double max_al_weight
Definition ALSolver.hpp:42
polysolve::nonlinear::Solver NLSolver
Definition ALSolver.hpp:18
void set_al_weight(NLProblem &nl_problem, const Eigen::VectorXd &x, const double weight)
Definition ALSolver.cpp:126
std::function< void(const Eigen::VectorXd &)> update_barrier_stiffness
Definition ALSolver.hpp:46
std::shared_ptr< BCPenaltyForm > pen_form
Definition ALSolver.hpp:39
std::shared_ptr< BCLagrangianForm > lagr_form
Definition ALSolver.hpp:38
std::function< void(const double)> post_subsolve
Definition ALSolver.hpp:33
const double initial_al_weight
Definition ALSolver.hpp:40
void solve_reduced(std::shared_ptr< NLSolver > nl_solver, NLProblem &nl_problem, Eigen::MatrixXd &sol)
Definition ALSolver.cpp:93
void solve_al(std::shared_ptr< NLSolver > nl_solver, NLProblem &nl_problem, Eigen::MatrixXd &sol)
Definition ALSolver.cpp:25