8#include <compile_time_options.h>
24#include <deal.II/base/parameter_acceptor.h>
25#include <deal.II/base/timer.h>
36 template <
typename Description,
int dim,
typename Number =
double>
37 class TimeLoop final :
public dealii::ParameterAcceptor
93 template <
typename Callable>
95 const std::string &base_name,
97 unsigned int &output_cycle,
98 const Callable &prepare_compute_kernels);
110 const std::string &base_name,
112 const unsigned int &output_cycle);
119 template <
typename Callable>
121 StateVector &state_vector,
const Callable &prepare_compute_kernels);
126 const std::string &name,
128 const unsigned int cycle);
136 const std::string &secondary,
137 std::ostream &stream);
140 Number last_checkpoint,
141 std::ostream &stream,
142 bool final_time =
false);
147 std::ostream &stream,
148 bool final_time =
false);
152 unsigned int output_cycle,
153 Number last_checkpoint,
154 bool write_to_logfile =
false,
155 bool final_time =
false);
164 std::string base_name_;
165 std::string base_name_ensemble_;
167 std::string debug_filename_;
170 bool enforce_t_final_;
171 Number timer_granularity_;
173 bool enable_output_full_;
174 bool enable_output_levelsets_;
175 bool enable_compute_error_;
176 bool enable_compute_quantities_;
177 bool enable_mesh_adaptivity_;
179 unsigned int timer_output_full_multiplier_;
180 unsigned int timer_output_levelsets_multiplier_;
181 unsigned int timer_compute_quantities_multiplier_;
183 std::vector<std::string> error_quantities_;
184 bool error_normalize_;
187 bool resume_at_time_zero_;
189 Number terminal_update_interval_;
190 bool terminal_show_rank_throughput_;
192 Number checkpoint_update_interval_;
202 std::map<std::string, dealii::Timer> computing_timer_;
219 dealii::types::global_dof_index n_global_dofs_;
221 std::ofstream logfile_;
void write_checkpoint(const StateVector &state_vector, const std::string &base_name, const Number &t, const unsigned int &output_cycle)
Vectors::ScalarVector< Number > ScalarVector
typename Description::template HyperbolicSystemView< dim, Number > View
typename Description::HyperbolicSystem HyperbolicSystem
void print_timers(std::ostream &stream)
static constexpr auto problem_dimension
typename Description::ParabolicSystem ParabolicSystem
void output(StateVector &state_vector, const std::string &name, const Number t, const unsigned int cycle)
void print_memory_statistics(std::ostream &stream)
void print_mpi_partition(std::ostream &stream)
void print_parameters(std::ostream &stream)
void compute_error(StateVector &state_vector, Number t)
void read_checkpoint(StateVector &state_vector, const std::string &base_name, Number &t, unsigned int &output_cycle, const Callable &prepare_compute_kernels)
TimeLoop(const MPI_Comm &mpi_comm)
void print_cycle_statistics(unsigned int cycle, Number t, unsigned int output_cycle, Number last_checkpoint, bool write_to_logfile=false, bool final_time=false)
static constexpr auto n_precomputed_values
typename View::StateVector StateVector
void print_head(const std::string &header, const std::string &secondary, std::ostream &stream)
void print_throughput(unsigned int cycle, Number t, std::ostream &stream, bool final_time=false)
typename Description::template ParabolicSolver< dim, Number > ParabolicSolver
void print_information(unsigned int output_cycle, Number last_checkpoint, std::ostream &stream, bool final_time=false)
void print_info(const std::string &header)
typename View::ScalarNumber ScalarNumber
void adapt_mesh_and_transfer_state_vector(StateVector &state_vector, const Callable &prepare_compute_kernels)
dealii::LinearAlgebra::distributed::Vector< Number > ScalarVector
std::tuple< MultiComponentVector< Number, problem_dim >, MultiComponentVector< Number, prec_dim >, BlockVector< Number > > StateVector
Euler::HyperbolicSystem HyperbolicSystem
ryujin::StubParabolicSystem ParabolicSystem