14#include "oiseau/time/integrator.hpp"
15#include "oiseau/time/progress_bar.hpp"
17namespace oiseau::time {
20template <
typename Integrator,
typename System,
typename State>
22double run(Integrator& integrator, System& system, State& state,
double initial_time,
23 double time_step, std::size_t step_count, std::ostream* progress =
nullptr) {
24 if (!std::isfinite(initial_time)) {
25 throw std::invalid_argument(
"Initial time must be finite");
27 if (!std::isfinite(time_step) || time_step <= 0.0) {
28 throw std::invalid_argument(
"Time step must be finite and positive");
33 auto time = initial_time;
34 for (std::size_t step = 0; step < step_count; ++step) {
35 integrator.step(system, state, time, time_step);
Prints a bounded number of updates on one terminal line.
Definition progress_bar.hpp:15
Definition integrator.hpp:25