PolyFEM
Loading...
Searching...
No Matches
BDF.hpp
Go to the documentation of this file.
1#pragma once
2
4
6{
14 {
15 public:
16 BDF(const int order = 1);
17
20 void set_parameters(const json &params) override;
21
24 void update_quantities(const Eigen::VectorXd &x) override;
25
31 Eigen::VectorXd x_tilde() const override;
32
39 Eigen::VectorXd compute_velocity(const Eigen::VectorXd &x) const override;
40
47 Eigen::VectorXd compute_acceleration(const Eigen::VectorXd &v) const override;
48
53 double acceleration_scaling() const override;
54
66 double dv_dx(const unsigned prev_ti = 0) const override;
67
69 double beta_dt() const;
70
75 Eigen::VectorXd weighted_sum_x_prevs() const;
76
81 Eigen::VectorXd weighted_sum_v_prevs() const;
82
86 static const std::vector<double> &alphas(const int i);
87
91 static double betas(const int i);
92
93 protected:
95 int max_steps() const override { return max_steps_; }
96
98 int max_steps_ = 1;
99 };
100} // namespace polyfem::time_integrator
int x
Backward Differential Formulas.
Definition BDF.hpp:14
double dv_dx(const unsigned prev_ti=0) const override
Compute the derivative of the velocity with respect to the solution.
Definition BDF.cpp:116
Eigen::VectorXd compute_velocity(const Eigen::VectorXd &x) const override
Compute the current velocity given the current solution and using the stored previous solution(s).
Definition BDF.cpp:100
void set_parameters(const json &params) override
Set the number of steps parameters from a json object.
Definition BDF.cpp:14
static double betas(const int i)
Retrieve the value of beta used for BDF with i steps.
Definition BDF.cpp:35
Eigen::VectorXd weighted_sum_v_prevs() const
Compute the weighted sum of the previous velocities.
Definition BDF.cpp:62
int max_steps_
The maximum number of steps to use for integration.
Definition BDF.hpp:98
int max_steps() const override
Get the maximum number of steps to use for integration.
Definition BDF.hpp:95
Eigen::VectorXd weighted_sum_x_prevs() const
Compute the weighted sum of the previous solutions.
Definition BDF.cpp:49
static const std::vector< double > & alphas(const int i)
Retrieve the alphas used for BDF with i steps.
Definition BDF.cpp:21
void update_quantities(const Eigen::VectorXd &x) override
Update the time integration quantities (i.e., , , and ).
Definition BDF.cpp:75
Eigen::VectorXd compute_acceleration(const Eigen::VectorXd &v) const override
Compute the current acceleration given the current velocity and using the stored previous velocity(s)...
Definition BDF.cpp:105
double acceleration_scaling() const override
Compute the acceleration scaling used to scale forces when integrating a second order ODE.
Definition BDF.cpp:110
double beta_dt() const
Compute .
Definition BDF.cpp:125
Eigen::VectorXd x_tilde() const override
Compute the predicted solution to be used in the inertia term .
Definition BDF.cpp:95
Implicit time integrator of a second order ODE (equivently a system of coupled first order ODEs).
nlohmann::json json
Definition Common.hpp:9