PolyFEM
Loading...
Searching...
No Matches
LaggedRegForm.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
Form.hpp
"
4
5
#include <
polyfem/utils/Types.hpp
>
6
7
namespace
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
:
49
int
n_lagging_iters_
;
50
Eigen::VectorXd
x_lagged_
;
51
};
52
}
// namespace polyfem::solver
Form.hpp
x
int x
Definition
SplineBasis3d.cpp:55
Types.hpp
polyfem::solver::Form
Definition
Form.hpp:11
polyfem::solver::LaggedRegForm
Tikonov regularization form between x and x_lagged.
Definition
LaggedRegForm.hpp:11
polyfem::solver::LaggedRegForm::init_lagging
void init_lagging(const Eigen::VectorXd &x) override
Initialize lagged fields.
Definition
LaggedRegForm.cpp:32
polyfem::solver::LaggedRegForm::update_lagging
void update_lagging(const Eigen::VectorXd &x, const int iter_num) override
Update lagged fields.
Definition
LaggedRegForm.cpp:37
polyfem::solver::LaggedRegForm::second_derivative_unweighted
void second_derivative_unweighted(const Eigen::VectorXd &x, StiffnessMatrix &hessian) const override
Compute the second derivative of the value wrt x.
Definition
LaggedRegForm.cpp:26
polyfem::solver::LaggedRegForm::n_lagging_iters_
int n_lagging_iters_
Number of iterations to lag for.
Definition
LaggedRegForm.hpp:49
polyfem::solver::LaggedRegForm::uses_lagging
bool uses_lagging() const override
Does this form require lagging?
Definition
LaggedRegForm.hpp:46
polyfem::solver::LaggedRegForm::value_unweighted
double value_unweighted(const Eigen::VectorXd &x) const override
Compute the value of the form.
Definition
LaggedRegForm.cpp:16
polyfem::solver::LaggedRegForm::first_derivative_unweighted
void first_derivative_unweighted(const Eigen::VectorXd &x, Eigen::VectorXd &gradv) const override
Compute the first derivative of the value wrt x.
Definition
LaggedRegForm.cpp:21
polyfem::solver::LaggedRegForm::x_lagged_
Eigen::VectorXd x_lagged_
The full variables from the previous lagging solve.
Definition
LaggedRegForm.hpp:50
polyfem::solver::LaggedRegForm::name
std::string name() const override
Definition
LaggedRegForm.hpp:16
polyfem::solver
Definition
OptState.hpp:16
polyfem::StiffnessMatrix
Eigen::SparseMatrix< double, Eigen::ColMajor > StiffnessMatrix
Definition
Types.hpp:22
src
polyfem
solver
forms
LaggedRegForm.hpp
Generated by
1.9.8