40 using Tscal = shambase::VecComponent<Tvec>;
41 using Tgridscal = shambase::VecComponent<TgridVec>;
42 static constexpr u32 dim = shambase::VectorProperties<Tvec>::dimension;
47 using AMRBlock =
typename Config::AMRBlock;
61 .template get_edge_ref<shamrock::solvergraph::IDataEdgeSerializable<Tscal>>(
"time")
69 .template get_edge_ref<shamrock::solvergraph::IDataEdgeSerializable<Tscal>>(
"dt")
79 std::optional<std::function<void(
void)>> step_begin_callback;
80 std::optional<std::function<void(
void)>> step_end_callback;
82 std::vector<SolverStepCallback> timestep_callbacks{};
84 inline void init_required_fields() { solver_config.set_layout(context.get_pdl_write()); }
88 void do_debug_vtk_dump(std::string filename);
90 inline void print_timestep_logs() {
101 inline Tscal evolve_once_time_expl(Tscal t_current, Tscal dt_input) {
103 set_next_dt(dt_input);
108 inline bool evolve_until(Tscal target_time,
i32 niter_max) {
111 Tscal t = get_time();
113 if (t > target_time) {
115 "the target time is lower than the current time");
118 if (t + dt > target_time) {
119 set_next_dt(target_time - t);
126 while (get_time() < target_time) {
130 if ((iter_count >= niter_max) && (niter_max != -1)) {
131 logger::info_ln(
"SPH",
"stopping evolve until because of niter =", iter_count);
136 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...