16 #ifndef dealii_time_stepping_h 17 #define dealii_time_stepping_h 20 #include <deal.II/base/config.h> 21 #include <deal.II/base/signaling_nan.h> 26 DEAL_II_NAMESPACE_OPEN
57 BACKWARD_EULER, IMPLICIT_MIDPOINT, CRANK_NICOLSON,
58 SDIRK_TWO_STAGES, HEUN_EULER, BOGACKI_SHAMPINE, DOPRI,
79 template <
typename VectorType>
98 virtual double evolve_one_time_step
99 (std::vector<std::function<VectorType (
const double,
const VectorType &)> > &F,
100 std::vector<std::function<VectorType (
const double,
const double,
const VectorType &)> > &J_inverse,
113 virtual const Status &get_status()
const = 0;
124 template <
typename VectorType>
150 (std::vector<std::function<VectorType (
const double,
const VectorType &)> > &F,
151 std::vector<std::function<VectorType (
const double,
const double,
const VectorType &)> > &J_inverse,
168 (
const std::function<VectorType (
const double,
const VectorType &)> &f,
169 const std::function<VectorType (
const double,
const double,
const VectorType &)> &id_minus_tau_J_inverse,
183 std::vector<double>
b;
188 std::vector<double>
c;
193 std::vector<std::vector<double> >
a;
202 template <
typename VectorType>
237 (
const std::function<VectorType (
const double,
const VectorType &)> &f,
238 const std::function<VectorType (
const double,
const double,
const VectorType &)> &id_minus_tau_J_inverse,
251 (
const std::function<VectorType (
const double,
const VectorType &)> &f,
279 (
const std::function<VectorType (
const double,
const VectorType &)> &f,
281 const double delta_t,
283 std::vector<VectorType> &f_stages)
const;
297 template <
typename VectorType>
316 const unsigned int max_it = 100,
336 (
const std::function<VectorType (
const double,
const VectorType &)> &f,
337 const std::function<VectorType (
const double,
const double,
const VectorType &)> &id_minus_tau_J_inverse,
359 norm_residual (numbers::signaling_nan<double>())
363 unsigned int n_iterations;
364 double norm_residual;
377 (
const std::function<VectorType (
const double,
const VectorType &)> &f,
378 const std::function<VectorType (
const double,
const double,
const VectorType &)> &id_minus_tau_J_inverse,
382 std::vector<VectorType> &f_stages);
387 void newton_solve(
const std::function<
void (
const VectorType &,VectorType &)> &get_residual,
388 const std::function<VectorType (
const VectorType &)> &id_minus_tau_J_inverse,
394 void compute_residual(
const std::function<VectorType (
const double,
const VectorType &)> &f,
397 const VectorType &new_y,
399 VectorType &tendency,
400 VectorType &residual)
const;
431 template <
typename VectorType>
451 const double min_delta = 1e-14,
452 const double max_delta = 1e100,
486 (
const std::function<VectorType (
const double,
const VectorType &)> &f,
487 const std::function<VectorType (
const double,
const double,
const VectorType &)> &id_minus_tau_J_inverse,
500 (
const std::function<VectorType (
const double,
const VectorType &)> &f,
510 const double min_delta,
511 const double max_delta,
525 unsigned int n_iterations;
526 double delta_t_guess;
539 void compute_stages(
const std::function<VectorType (
const double,
const VectorType &)> &f,
541 const double delta_t,
543 std::vector<VectorType> &f_stages);
588 std::vector<double>
b1;
593 std::vector<double>
b2;
608 DEAL_II_NAMESPACE_CLOSE
static const unsigned int invalid_unsigned_int
void set_newton_solver_parameters(const unsigned int max_it, const double tolerance)
void compute_stages(const std::function< VectorType(const double, const VectorType &)> &f, const double t, const double delta_t, const VectorType &y, std::vector< VectorType > &f_stages) const
virtual ~RungeKutta()=default
void compute_residual(const std::function< VectorType(const double, const VectorType &)> &f, double t, double delta_t, const VectorType &new_y, const VectorType &y, VectorType &tendency, VectorType &residual) const
double evolve_one_time_step(const std::function< VectorType(const double, const VectorType &)> &f, const std::function< VectorType(const double, const double, const VectorType &)> &id_minus_tau_J_inverse, double t, double delta_t, VectorType &y)
const Status & get_status() const
ImplicitRungeKutta()=default
void initialize(const runge_kutta_method method)
void set_time_adaptation_parameters(const double coarsen_param, const double refine_param, const double min_delta, const double max_delta, const double refine_tol, const double coarsen_tol)
double evolve_one_time_step(const std::function< VectorType(const double, const VectorType &)> &f, const std::function< VectorType(const double, const double, const VectorType &)> &id_minus_tau_J_inverse, double t, double delta_t, VectorType &y)
const Status & get_status() const
void newton_solve(const std::function< void(const VectorType &, VectorType &)> &get_residual, const std::function< VectorType(const VectorType &)> &id_minus_tau_J_inverse, VectorType &y)
EmbeddedExplicitRungeKutta()=default
void compute_stages(const std::function< VectorType(const double, const VectorType &)> &f, const double t, const double delta_t, const VectorType &y, std::vector< VectorType > &f_stages)
const Status & get_status() const
void initialize(const runge_kutta_method method)
double evolve_one_time_step(const std::function< VectorType(const double, const VectorType &)> &f, const std::function< VectorType(const double, const double, const VectorType &)> &id_minus_tau_J_inverse, double t, double delta_t, VectorType &y)
std::vector< std::vector< double > > a
ExplicitRungeKutta()=default
void compute_stages(const std::function< VectorType(const double, const VectorType &)> &f, const std::function< VectorType(const double, const double, const VectorType &)> &id_minus_tau_J_inverse, double t, double delta_t, VectorType &y, std::vector< VectorType > &f_stages)
double evolve_one_time_step(std::vector< std::function< VectorType(const double, const VectorType &)> > &F, std::vector< std::function< VectorType(const double, const double, const VectorType &)> > &J_inverse, double t, double delta_t, VectorType &y)
virtual void initialize(const runge_kutta_method method)=0
embedded_runge_kutta_time_step
~EmbeddedExplicitRungeKutta()
void initialize(const runge_kutta_method method)