8#include <compile_time_options.h>
22#include <deal.II/base/parameter_acceptor.h>
23#include <deal.II/base/timer.h>
35 template <
typename Description,
int dim,
typename Number =
double>
36 class TimeLoop final :
public dealii::ParameterAcceptor
92 template <
typename Callable>
94 const std::string &base_name,
96 unsigned int &output_cycle,
97 const Callable &prepare_compute_kernels);
109 const std::string &base_name,
111 const unsigned int &output_cycle);
118 template <
typename Callable>
120 StateVector &state_vector,
const Callable &prepare_compute_kernels);
125 const std::string &name,
127 const unsigned int cycle);
135 std::ostream &stream,
136 bool final_time =
false);
140 const std::string &secondary,
141 std::ostream &stream);
145 unsigned int output_cycle,
146 bool write_to_logfile =
false,
147 bool final_time =
false);
156 std::string base_name_;
157 std::string base_name_ensemble_;
159 std::string debug_filename_;
162 bool enforce_t_final_;
163 Number timer_granularity_;
165 bool enable_checkpointing_;
166 bool enable_output_full_;
167 bool enable_output_levelsets_;
168 bool enable_compute_error_;
169 bool enable_compute_quantities_;
170 bool enable_mesh_adaptivity_;
172 unsigned int timer_checkpoint_multiplier_;
173 unsigned int timer_output_full_multiplier_;
174 unsigned int timer_output_levelsets_multiplier_;
175 unsigned int timer_compute_quantities_multiplier_;
177 std::vector<std::string> error_quantities_;
178 bool error_normalize_;
181 bool resume_at_time_zero_;
183 Number terminal_update_interval_;
184 bool terminal_show_rank_throughput_;
194 std::map<std::string, dealii::Timer> computing_timer_;
209 dealii::types::global_dof_index n_global_dofs_;
211 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::ParabolicSystem ParabolicSystem
Euler::HyperbolicSystem HyperbolicSystem