PolyFEM
Loading...
Searching...
No Matches
L2ProjectionForm.cpp
Go to the documentation of this file.
1
2
#include "
L2ProjectionForm.hpp
"
3
4
namespace
polyfem::solver
5
{
6
L2ProjectionForm::L2ProjectionForm
(
7
const
StiffnessMatrix
&M,
8
const
StiffnessMatrix
&A,
9
const
Eigen::VectorXd &
y
)
10
: M_(M), rhs_(A *
y
)
11
{
12
}
13
14
double
L2ProjectionForm::value_unweighted
(
const
Eigen::VectorXd &
x
)
const
15
{
16
return
x
.transpose() * (0.5 * (
M_
*
x
) -
rhs_
);
17
}
18
19
void
L2ProjectionForm::first_derivative_unweighted
(
const
Eigen::VectorXd &
x
, Eigen::VectorXd &gradv)
const
20
{
21
gradv =
M_
*
x
-
rhs_
;
22
}
23
24
void
L2ProjectionForm::second_derivative_unweighted
(
const
Eigen::VectorXd &
x
,
StiffnessMatrix
&hessian)
const
25
{
26
hessian =
M_
;
27
}
28
}
// namespace polyfem::solver
L2ProjectionForm.hpp
y
int y
Definition
SplineBasis3d.cpp:55
x
int x
Definition
SplineBasis3d.cpp:55
polyfem::solver::L2ProjectionForm::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
L2ProjectionForm.cpp:19
polyfem::solver::L2ProjectionForm::value_unweighted
double value_unweighted(const Eigen::VectorXd &x) const override
Compute the value of the form.
Definition
L2ProjectionForm.cpp:14
polyfem::solver::L2ProjectionForm::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
L2ProjectionForm.cpp:24
polyfem::solver::L2ProjectionForm::rhs_
Eigen::VectorXd rhs_
Definition
L2ProjectionForm.hpp:38
polyfem::solver::L2ProjectionForm::L2ProjectionForm
L2ProjectionForm(const StiffnessMatrix &M, const StiffnessMatrix &A, const Eigen::VectorXd &y)
Definition
L2ProjectionForm.cpp:6
polyfem::solver::L2ProjectionForm::M_
StiffnessMatrix M_
Definition
L2ProjectionForm.hpp:37
polyfem::solver
Definition
OptState.hpp:16
polyfem::StiffnessMatrix
Eigen::SparseMatrix< double, Eigen::ColMajor > StiffnessMatrix
Definition
Types.hpp:22
src
polyfem
solver
forms
L2ProjectionForm.cpp
Generated by
1.9.8