ryujin 2.5.0 revision c64172211cf21344cb9b9b0f3a1266aa6400d392
Loading...
Searching...
No Matches
Classes | Enumerations | Functions
Collaboration diagram for Driver:

Classes

class  ryujin::Checkpointing< dim, Number >
 
class  ryujin::Environment
 
struct  ryujin::Equation
 
class  ryujin::EquationRegistration< HD, PD >
 
class  ryujin::Logger< dim, Number >
 
class  ryujin::Scheduler< Number >
 
class  ryujin::Simulation< HD, PD, dim, Number >
 
struct  ryujin::TaskComposition< dim, Number >
 
struct  ryujin::TaskContext< Number >
 
class  ryujin::Trigger< Number >
 

Enumerations

enum class  ryujin::TaskPhase : std::uint8_t { ryujin::TaskPhase::pre_step , ryujin::TaskPhase::adapt , ryujin::TaskPhase::step , ryujin::TaskPhase::post_step }
 
enum class  ryujin::TriggerMode : std::uint8_t { ryujin::TriggerMode::every_cycle , ryujin::TriggerMode::timer_tick , ryujin::TriggerMode::wall_clock , ryujin::TriggerMode::time_points }
 

Functions

template<typename Setup >
void ryujin::write_parameter_files (const std::string &name, bool write_detailed_description, const Setup &setup)
 
std::map< std::string, Equation > & ryujin::equations ()
 

Detailed Description

The Environment that initializes MPI, the thread pools, and the instrumentation, the registry of equations, the Simulation, the TaskComposition that assembles the Simulation and the tasks, the Scheduler that runs them, and write_parameter_files() that writes the default parameter files (include/ryujin/driver).

Equation dispatch

The ryujin executable selects the equation and the dimension at run time. Every equation registers itself with a constant EquationRegistration<HD, PD> at namespace scope in source/driver/equation_*.cc. Its constructor runs during static initialization and inserts an Equation under the given name into the map returned by equations(). An Equation holds two std::function objects, so that main() (source/main.cc) can call them without knowing HD, PD, or the dimension. main() reads the run time parameters "dimension" and "equation", looks up the equation, and calls Equation::run, which switches over the dimension and constructs the Simulation and the TaskComposition. If the parameter file does not exist, main() instead calls Equation::create_parameter_files of every registered equation:

dot_inline_dotgraph_2.png

Only EquationRegistration and the Simulation depend on HD and PD. The TaskComposition and all tasks use the Simulation through Interface::Simulation and are compiled once per dimension.

Scheduler

The Scheduler runs a list of tasks (see Interface::Task). The active tasks are the required tasks, followed by the tasks named in the run time parameter "tasks". After calling initialize(), start(), and prepare() on every active task, the Scheduler runs cycles of four phases. Each task belongs to exactly one TaskPhase; within a phase the Scheduler executes the tasks of that phase in the order of the active tasks. The diagram lists the tasks that TaskComposition assigns to each phase:

dot_inline_dotgraph_3.png

The first required task is the primary task. In TaskComposition this is the Simulation, which sets up the discretization in prepare() and chooses the time step size tau in the step phase. All values the Scheduler shares with the tasks, such as t, tau, the cycle, and whether a timer tick has been reached, are stored in the TaskContext. Tasks decide in which cycles to do their work with a Trigger.

Enumeration Type Documentation

◆ TaskPhase

enum class ryujin::TaskPhase : std::uint8_t
strong

The phase of a cycle of the Scheduler in which a Task runs.

Enumerator
pre_step 

Before the time step, at time t. Output and postprocessing tasks typically run in this phase.

adapt 

Mesh adaptation, at time t. The Scheduler runs this phase only if a time step follows. A task of this phase that changes the mesh sets TaskContext::prepare_required.

step 

The time step from t to t + tau. The first task of this phase chooses the time step size tau, all subsequent tasks advance over the same interval (Lie splitting).

post_step 

After the time step, at time t + tau.

Definition at line 33 of file task.h.

◆ TriggerMode

enum class ryujin::TriggerMode : std::uint8_t
strong

The condition under which a Trigger fires.

Enumerator
every_cycle 

Fire in every cycle whose number is a multiple of the "multiplier".

timer_tick 

Fire whenever a timer tick is reached and the timer cycle is a multiple of the "multiplier".

wall_clock 

Fire whenever the wall time has advanced by more than the "interval" (in seconds) since the last time the trigger fired.

time_points 

Fire once whenever the current time has reached one of the "time points". Time points that lie before the time at which the trigger is evaluated for the first time are ignored.

Definition at line 66 of file task.h.

Function Documentation

◆ write_parameter_files()

template<typename Setup >
void ryujin::write_parameter_files ( const std::string &  name,
bool  write_detailed_description,
const Setup &  setup 
)

Write the default parameter file "default_parameters-<name>.prm", and, if write_detailed_description is set, the parameter file "default_parameters-<name>-description.prm" with the documentation of all parameters.

ryujin::write_parameter_files("euler-2d", true, [] {
struct Objects {
MPI_COMM_SELF};
TaskComposition<2> task_composition{simulation};
};
return std::make_unique<Objects>();
});
void write_parameter_files(const std::string &name, bool write_detailed_description, const Setup &setup)
Definition equation.h:46

Definition at line 46 of file equation.h.

◆ equations()

std::map< std::string, Equation > & ryujin::equations ( )

All registered equations, sorted by name. The equations of ryujin are registered by default.

Referenced by ryujin::EquationRegistration< HD, PD >::EquationRegistration().