PolyFEM
Loading...
Searching...
No Matches
ParametrizationForm.cpp
Go to the documentation of this file.
1
#include "
ParametrizationForm.hpp
"
2
#include <
polyfem/State.hpp
>
3
4
namespace
polyfem::solver
5
{
6
void
ParametrizationForm::init
(
const
Eigen::VectorXd &
x
)
7
{
8
init_with_param
(
apply_parametrizations
(
x
));
9
}
10
11
bool
ParametrizationForm::is_step_valid
(
const
Eigen::VectorXd &x0,
const
Eigen::VectorXd &x1)
const
12
{
13
return
is_step_valid_with_param
(
apply_parametrizations
(x0),
apply_parametrizations
(x1));
14
}
15
16
double
ParametrizationForm::max_step_size
(
const
Eigen::VectorXd &x0,
const
Eigen::VectorXd &x1)
const
17
{
18
return
max_step_size_with_param
(
apply_parametrizations
(x0),
apply_parametrizations
(x1));
19
}
20
21
void
ParametrizationForm::line_search_begin
(
const
Eigen::VectorXd &x0,
const
Eigen::VectorXd &x1)
22
{
23
line_search_begin_with_param
(
apply_parametrizations
(x0),
apply_parametrizations
(x1));
24
}
25
26
void
ParametrizationForm::line_search_end
()
27
{
28
line_search_end_with_param
();
29
}
30
31
void
ParametrizationForm::post_step
(
const
polysolve::nonlinear::PostStepData &data)
32
{
33
post_step_with_param
(polysolve::nonlinear::PostStepData(
34
data.iter_num,
35
data.solver_info,
36
apply_parametrizations
(data.x),
37
parametrizations_
.
apply_jacobian
(data.grad, data.x)));
38
}
39
40
double
ParametrizationForm::value_unweighted
(
const
Eigen::VectorXd &
x
)
const
41
{
42
Eigen::VectorXd
y
=
apply_parametrizations
(
x
);
43
return
value_unweighted_with_param
(
y
);
44
}
45
46
void
ParametrizationForm::solution_changed
(
const
Eigen::VectorXd &new_x)
47
{
48
solution_changed_with_param
(
apply_parametrizations
(new_x));
49
}
50
51
void
ParametrizationForm::compute_partial_gradient
(
const
Eigen::VectorXd &
x
, Eigen::VectorXd &gradv)
const
52
{
53
compute_partial_gradient_with_param
(
apply_parametrizations
(
x
), gradv);
54
gradv =
parametrizations_
.
apply_jacobian
(gradv,
x
);
55
}
56
57
bool
ParametrizationForm::is_step_collision_free
(
const
Eigen::VectorXd &x0,
const
Eigen::VectorXd &x1)
const
58
{
59
return
is_step_collision_free_with_param
(
apply_parametrizations
(x0),
apply_parametrizations
(x1));
60
}
61
}
ParametrizationForm.hpp
y
int y
Definition
SplineBasis3d.cpp:55
x
int x
Definition
SplineBasis3d.cpp:55
State.hpp
polyfem::solver::CompositeParametrization::apply_jacobian
Eigen::VectorXd apply_jacobian(const Eigen::VectorXd &grad_full, const Eigen::VectorXd &x) const override
Definition
Parametrization.cpp:48
polyfem::solver::ParametrizationForm::post_step_with_param
virtual void post_step_with_param(const polysolve::nonlinear::PostStepData &data)
Definition
ParametrizationForm.hpp:38
polyfem::solver::ParametrizationForm::solution_changed_with_param
virtual void solution_changed_with_param(const Eigen::VectorXd &new_x)
Definition
ParametrizationForm.hpp:39
polyfem::solver::ParametrizationForm::parametrizations_
CompositeParametrization parametrizations_
Definition
ParametrizationForm.hpp:45
polyfem::solver::ParametrizationForm::is_step_collision_free
virtual bool is_step_collision_free(const Eigen::VectorXd &x0, const Eigen::VectorXd &x1) const final override
Checks if the step is collision free.
Definition
ParametrizationForm.cpp:57
polyfem::solver::ParametrizationForm::line_search_begin_with_param
virtual void line_search_begin_with_param(const Eigen::VectorXd &x0, const Eigen::VectorXd &x1)
Definition
ParametrizationForm.hpp:36
polyfem::solver::ParametrizationForm::is_step_collision_free_with_param
virtual bool is_step_collision_free_with_param(const Eigen::VectorXd &x0, const Eigen::VectorXd &x1) const
Definition
ParametrizationForm.hpp:40
polyfem::solver::ParametrizationForm::is_step_valid_with_param
virtual bool is_step_valid_with_param(const Eigen::VectorXd &x0, const Eigen::VectorXd &x1) const
Definition
ParametrizationForm.hpp:34
polyfem::solver::ParametrizationForm::solution_changed
virtual void solution_changed(const Eigen::VectorXd &new_x) final override
Update cached fields upon a change in the solution.
Definition
ParametrizationForm.cpp:46
polyfem::solver::ParametrizationForm::value_unweighted
virtual double value_unweighted(const Eigen::VectorXd &x) const final override
Compute the value of the form.
Definition
ParametrizationForm.cpp:40
polyfem::solver::ParametrizationForm::line_search_end_with_param
virtual void line_search_end_with_param()
Definition
ParametrizationForm.hpp:37
polyfem::solver::ParametrizationForm::init
virtual void init(const Eigen::VectorXd &x) final override
Initialize the form.
Definition
ParametrizationForm.cpp:6
polyfem::solver::ParametrizationForm::post_step
virtual void post_step(const polysolve::nonlinear::PostStepData &data) final override
Update fields after a step in the optimization.
Definition
ParametrizationForm.cpp:31
polyfem::solver::ParametrizationForm::compute_partial_gradient
virtual void compute_partial_gradient(const Eigen::VectorXd &x, Eigen::VectorXd &gradv) const final override
Definition
ParametrizationForm.cpp:51
polyfem::solver::ParametrizationForm::init_with_param
virtual void init_with_param(const Eigen::VectorXd &x)
Definition
ParametrizationForm.hpp:33
polyfem::solver::ParametrizationForm::max_step_size_with_param
virtual double max_step_size_with_param(const Eigen::VectorXd &x0, const Eigen::VectorXd &x1) const
Definition
ParametrizationForm.hpp:35
polyfem::solver::ParametrizationForm::value_unweighted_with_param
virtual double value_unweighted_with_param(const Eigen::VectorXd &x) const
Definition
ParametrizationForm.hpp:41
polyfem::solver::ParametrizationForm::compute_partial_gradient_with_param
virtual void compute_partial_gradient_with_param(const Eigen::VectorXd &x, Eigen::VectorXd &gradv) const =0
polyfem::solver::ParametrizationForm::max_step_size
virtual double max_step_size(const Eigen::VectorXd &x0, const Eigen::VectorXd &x1) const final
Determine the maximum step size allowable between the current and next solution.
Definition
ParametrizationForm.cpp:16
polyfem::solver::ParametrizationForm::line_search_end
virtual void line_search_end() final override
Clear variables used during the line search.
Definition
ParametrizationForm.cpp:26
polyfem::solver::ParametrizationForm::apply_parametrizations
Eigen::VectorXd apply_parametrizations(const Eigen::VectorXd &x) const
Definition
ParametrizationForm.hpp:47
polyfem::solver::ParametrizationForm::line_search_begin
virtual void line_search_begin(const Eigen::VectorXd &x0, const Eigen::VectorXd &x1) final override
Initialize variables used during the line search.
Definition
ParametrizationForm.cpp:21
polyfem::solver::ParametrizationForm::is_step_valid
virtual bool is_step_valid(const Eigen::VectorXd &x0, const Eigen::VectorXd &x1) const final override
Determine if a step from solution x0 to solution x1 is allowed.
Definition
ParametrizationForm.cpp:11
polyfem::solver
Definition
OptState.hpp:16
src
polyfem
solver
forms
adjoint_forms
ParametrizationForm.cpp
Generated by
1.9.8