PolyFEM
Loading...
Searching...
No Matches
LaggedRegForm.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "Form.hpp"
4
6
7namespace polyfem::solver
8{
10 class LaggedRegForm : public Form
11 {
12 public:
14 LaggedRegForm(const int n_lagging_iters);
15
16 std::string name() const override { return "lagged-regularization"; }
17
18 protected:
22 double value_unweighted(const Eigen::VectorXd &x) const override;
23
27 void first_derivative_unweighted(const Eigen::VectorXd &x, Eigen::VectorXd &gradv) const override;
28
32 void second_derivative_unweighted(const Eigen::VectorXd &x, StiffnessMatrix &hessian) const override;
33
34 public:
37 void init_lagging(const Eigen::VectorXd &x) override;
38
42 void update_lagging(const Eigen::VectorXd &x, const int iter_num) override;
43
46 bool uses_lagging() const override { return true; }
47
48 private:
50 Eigen::VectorXd x_lagged_;
51 };
52} // namespace polyfem::solver
int x
Tikonov regularization form between x and x_lagged.
void init_lagging(const Eigen::VectorXd &x) override
Initialize lagged fields.
void update_lagging(const Eigen::VectorXd &x, const int iter_num) override
Update lagged fields.
void second_derivative_unweighted(const Eigen::VectorXd &x, StiffnessMatrix &hessian) const override
Compute the second derivative of the value wrt x.
int n_lagging_iters_
Number of iterations to lag for.
bool uses_lagging() const override
Does this form require lagging?
double value_unweighted(const Eigen::VectorXd &x) const override
Compute the value of the form.
void first_derivative_unweighted(const Eigen::VectorXd &x, Eigen::VectorXd &gradv) const override
Compute the first derivative of the value wrt x.
Eigen::VectorXd x_lagged_
The full variables from the previous lagging solve.
std::string name() const override
Eigen::SparseMatrix< double, Eigen::ColMajor > StiffnessMatrix
Definition Types.hpp:22