1""" This file is part of the ExaGRyPE project. For conditions of distribution and
2 use, please see the copyright notice at www.peano-framework.org
11 Make several solvers advance with the same time step size
13 The action set acts in unprepareTraversal() only. After the solvers have
14 computed their next time step size, it takes the minimum of them and
15 enforces it on all solvers (::exahype2::Solver::enforceTimeStepSize()).
16 The task that hosts the action set is a GLOBAL_END_OF_STEP task, which
17 depends on the last tasks of all solvers.
24 @param solvers: List[exahype2.api.Solver]
25 The solvers whose time step sizes are synchronised.
28 super().
__init__(descend_invocation_order=1, parallel=
False)
32 return __name__.replace(
".py",
"").replace(
".",
"_")
38 return '#include "repositories/SolverRepository.h"\n#include <algorithm>\n#include <limits>\n'
42 f
"repositories::{solver.get_name_of_global_instance()}"
45 minimum =
"std::numeric_limits<double>::max()"
46 for instance
in instances:
47 minimum = f
"std::min( {instance}.getMaxTimeStepSize(), {minimum} )"
49 f
" {instance}.enforceTimeStepSize(timeStepSize);" for instance
in instances
52 const double timeStepSize = {minimum};
Make several solvers advance with the same time step size.
get_action_set_name(self)
Return unique action set name.
get_body_of_unprepareTraversal(self)
get_includes(self)
Return include statements that you need.
user_should_modify_template(self)
Is the user allowed to modify the output.
Action set (reactions to events).