36 using Tscal = shambase::VecComponent<Tvec>;
37 using Tgridscal = shambase::VecComponent<TgridVec>;
38 static constexpr u32 dim = shambase::VectorProperties<Tvec>::dimension;
43 using AMRBlock =
typename Config::AMRBlock;
52 inline void init_required_fields() { solver_config.set_layout(context.get_pdl_write()); }
56 void do_debug_vtk_dump(std::string filename);
58 inline void print_timestep_logs() {
69 inline Tscal evolve_once_time_expl(Tscal t_current, Tscal dt_input) {
70 solver_config.set_time(t_current);
71 solver_config.set_next_dt(dt_input);
73 return solver_config.get_dt();
76 inline bool evolve_until(Tscal target_time,
i32 niter_max) {
78 Tscal dt = solver_config.get_dt();
79 Tscal t = solver_config.get_time();
81 if (t > target_time) {
83 "the target time is higher than the current time");
86 if (t + dt > target_time) {
87 solver_config.set_next_dt(target_time - t);
94 while (solver_config.get_time() < target_time) {
98 if ((iter_count >= niter_max) && (niter_max != -1)) {
99 logger::info_ln(
"SPH",
"stopping evolve until because of niter =", iter_count);
104 print_timestep_logs();
T & get_check_ref(const std::unique_ptr< T > &ptr, SourceLocation loc=SourceLocation())
Takes a std::unique_ptr and returns a reference to the object it holds. It throws a std::runtime_erro...