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> 22 #include <deal.II/base/std_cxx11/function.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_cxx11::function<VectorType (
const double,
const VectorType &)> > &F,
100 std::vector<std_cxx11::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_cxx11::function<VectorType (
const double,
const VectorType &)> > &F,
151 std::vector<std_cxx11::function<VectorType (
const double,
const double,
const VectorType &)> > &J_inverse,
168 (std_cxx11::function<VectorType (
const double,
const VectorType &)> f,
169 std_cxx11::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 (std_cxx11::function<VectorType (
const double,
const VectorType &)> f,
238 std_cxx11::function<VectorType (
const double,
const double,
const VectorType &)> id_minus_tau_J_inverse,
251 (std_cxx11::function<VectorType (
const double,
const VectorType &)> f,
279 (std_cxx11::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 (std_cxx11::function<VectorType (
const double,
const VectorType &)> f,
337 std_cxx11::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 (std_cxx11::function<VectorType (
const double,
const VectorType &)> f,
378 std_cxx11::function<VectorType (
const double,
const double,
const VectorType &)> id_minus_tau_J_inverse,
382 std::vector<VectorType> &f_stages);
387 void newton_solve(std_cxx11::function<
void (
const VectorType &,VectorType &)> get_residual,
388 std_cxx11::function<VectorType (
const VectorType &)> id_minus_tau_J_inverse,
394 void compute_residual(std_cxx11::function<VectorType (
const double,
const VectorType &)> f,
397 const VectorType &old_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 (std_cxx11::function<VectorType (
const double,
const VectorType &)> f,
487 std_cxx11::function<VectorType (
const double,
const double,
const VectorType &)> id_minus_tau_J_inverse,
500 (std_cxx11::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(std_cxx11::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 newton_solve(std_cxx11::function< void(const VectorType &, VectorType &)> get_residual, std_cxx11::function< VectorType(const VectorType &)> id_minus_tau_J_inverse, VectorType &y)
void compute_residual(std_cxx11::function< VectorType(const double, const VectorType &)> f, double t, double delta_t, const VectorType &old_y, const VectorType &y, VectorType &tendency, VectorType &residual) const
double evolve_one_time_step(std_cxx11::function< VectorType(const double, const VectorType &)> f, std_cxx11::function< VectorType(const double, const double, const VectorType &)> id_minus_tau_J_inverse, double t, double delta_t, VectorType &y)
void compute_stages(std_cxx11::function< VectorType(const double, const VectorType &)> f, std_cxx11::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)
const Status & get_status() const
void initialize(const runge_kutta_method method)
void compute_stages(std_cxx11::function< VectorType(const double, const VectorType &)> f, const double t, const double delta_t, const VectorType &y, std::vector< VectorType > &f_stages) const
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(std_cxx11::function< VectorType(const double, const VectorType &)> f, std_cxx11::function< VectorType(const double, const double, const VectorType &)> id_minus_tau_J_inverse, double t, double delta_t, VectorType &y)
double evolve_one_time_step(std_cxx11::function< VectorType(const double, const VectorType &)> f, std_cxx11::function< VectorType(const double, const double, const VectorType &)> id_minus_tau_J_inverse, double t, double delta_t, VectorType &y)
void compute_stages(std_cxx11::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
const Status & get_status() const
void initialize(const runge_kutta_method method)
std::vector< std::vector< double > > a
virtual void initialize(const runge_kutta_method method)=0
embedded_runge_kutta_time_step
~EmbeddedExplicitRungeKutta()
void initialize(const runge_kutta_method method)
double evolve_one_time_step(std::vector< std_cxx11::function< VectorType(const double, const VectorType &)> > &F, std::vector< std_cxx11::function< VectorType(const double, const double, const VectorType &)> > &J_inverse, double t, double delta_t, VectorType &y)
EmbeddedExplicitRungeKutta()