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 std::ostream &stream,
137 bool final_time =
false);
141 const std::string &secondary,
142 std::ostream &stream);
146 unsigned int output_cycle,
147 bool write_to_logfile =
false,
148 bool final_time =
false);
157 std::string base_name_;
158 std::string base_name_ensemble_;
160 std::string debug_filename_;
163 bool enforce_t_final_;
164 Number timer_granularity_;
166 bool enable_checkpointing_;
167 bool enable_output_full_;
168 bool enable_output_levelsets_;
169 bool enable_compute_error_;
170 bool enable_compute_quantities_;
171 bool enable_mesh_adaptivity_;
173 unsigned int timer_checkpoint_multiplier_;
174 unsigned int timer_output_full_multiplier_;
175 unsigned int timer_output_levelsets_multiplier_;
176 unsigned int timer_compute_quantities_multiplier_;
178 std::vector<std::string> error_quantities_;
179 bool error_normalize_;
182 bool resume_at_time_zero_;
184 Number terminal_update_interval_;
185 bool terminal_show_rank_throughput_;
195 std::map<std::string, dealii::Timer> computing_timer_;
212 dealii::types::global_dof_index n_global_dofs_;
214 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)
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_cycle_statistics(unsigned int cycle, Number t, unsigned int output_cycle, bool write_to_logfile=false, 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