1"""Unit tests for the setup from a checkpoint
2(@ref exahype2.api.blockstructured.LoadCheckpoint.LoadCheckpoint)."""
22 solver, patch_size=9, rk_order=2
25 return solver, package
30 exahype2_project = types.SimpleNamespace(periodic_BC=[
True,
True,
True])
32 solver.grid_construction.construct_output(exahype2_project, peano_project, graph)
40@pytest.mark.parametrize("scheme,halo", [("fv", 1), (
"fd4", 2)])
42 solver, package =
_solver(scheme)
43 solver.grid_construction = package.LoadCheckpoint(
44 solver, output_path=
"restart", time_stamp=0.5
47 assert [task.name
for task
in graph.tasks] == [
48 "Probe_Refine mesh from checkpoint",
49 "Probe_Consolidate mesh",
50 "Probe_Load checkpoint",
52 refine, _, load = graph.tasks
53 assert refine.has_to_repeat
is not None
54 events = refine.action_sets[0].get_body_of_createGridControlEventsForNextTraversal()
56 f
'::exahype2::CheckpointReader::getInstance("restart/checkpoint-Probe.peano-patch-file", 0.5, {halo}, DomainOffset, DomainSize)'
60 load_patches, project = load.action_sets
62 project, toolbox.blockstructured.api.ProjectPatchWithHaloOntoFaces
64 assert "fineGridCellProbeQWithHalo" in load_patches.get_body_of_operation(
67 assert "fromCheckpointMetaData" in load_patches.get_body_of_unprepareTraversal()
68 assert load.cell_data_access[solver._patch_with_halo] == (
69 peano4.api.taskgraph.Task.DataAccess.TEMPORARY
75 solver.grid_construction = package.LoadCheckpoint(solver)
80 .get_body_of_createGridControlEventsForNextTraversal()
82 assert '"./checkpoint-Probe.peano-patch-file", -1.0,' in events
87 solver.add_plotter(package.PlotAsVTKFile(solver))
88 solver.add_plotter(package.WriteCheckpoint(solver))
89 solver.grid_construction = package.LoadCheckpoint(solver)
92 exahype2_project = types.SimpleNamespace(periodic_BC=[
True,
True,
True])
93 for plotter
in solver.plotters:
94 plotter.construct_output(
98 generator(
"probe::AbstractProbe")
99 for declaration, generator
in solver._abstract_solver_methods
100 if declaration.startswith(
"void fromCheckpointMetaData")
102 assert definition.index(
"_nextPlotAsVTKFileTimeStamp =") < definition.index(
103 "finishPlotAsVTKFile();"
105 assert "finishWriteCheckpoint();" in definition
The conservative flux F(Q) of a hyperbolic PDE.
The maximum absolute eigenvalue of the flux Jacobian in a given direction, i.e.
Abstract base class for all ExaHyPE 2 solvers.
Set up a simulation from a checkpoint.
Finite Volumes with a Rusanov Riemann solver and explicit Euler time stepping, realised over a block-...
Fourth-order central Finite Differences with explicit Runge-Kutta time stepping, realised over a bloc...
Represents a Peano 4 project.
Holds a sequence of Task instances.
Fourth-order Finite Differences with explicit Runge-Kutta time stepping over block-structured meshes.
The task graph abstraction allows users to formalise their solver steps over small task graphs which ...
test_both_schemes_offer_the_same_setup()
_setup_graph(solver, tmp_path)
test_setup_refines_consolidates_and_loads(tmp_path, scheme, halo)
test_restore_moves_plotters_on(tmp_path)
test_latest_checkpoint_by_default(tmp_path)