3import sys, os, argparse
6sys.path.insert(0, os.path.abspath(
"../../../../tests/exahype2/aderdg"))
18parser = argparse.ArgumentParser(
19 description=
"ExaHyPE 2 - Finite Volumes Kernel Benchmarking Script"
25 choices=peano4.output.CompileModes,
26 default=peano4.output.CompileModes[0],
27 help=
"|".join(peano4.output.CompileModes),
35 help=
"Number of levels in the tree. Must be > 1.",
43 help=
"Number of finite volumes in a patch",
49 choices=available_scenarios.keys(),
50 default=
"SWERadialDamBreak",
51 help=
"Scenario that should be used as a base for the benchmarking",
58 help=
"Set if you want the simulation output",
61args = parser.parse_args()
62scenario = available_scenarios[args.scenario]
63dimensions = scenario._dimensions
65end_time = scenario._end_time
66should_plot = args.plot
67size = [scenario._domain_size, scenario._domain_size, scenario._domain_size]
68offset = [scenario._offset, scenario._offset, scenario._offset]
72if type(scenario._equation.num_unknowns)
is dict:
73 variable_names += list(scenario._equation.num_unknowns.keys())
74if type(scenario._equation.num_auxiliary_variables)
is dict:
75 variable_names += list(scenario._equation.num_auxiliary_variables.keys())
77plot_description =
", ".join(variable_names)
79project = exahype2.Project(
80 namespace=[
"benchmarks",
"exahype2",
"kernelbenchmarks"],
81 project_name=
"KernelBenchmarks",
83 executable=
"KernelBenchmarks",
86fv_solver = exahype2.solvers.fv.godunov.GlobalAdaptiveTimeStep(
88 patch_size=int(args.patch_size),
89 unknowns=scenario._equation.num_unknowns,
90 auxiliary_variables=scenario._equation.num_auxiliary_variables,
91 min_volume_h=(1.1 * min(size[0:dimensions]) / (3.0**depth)),
92 max_volume_h=(1.1 * min(size[0:dimensions]) / (3.0**depth)),
93 time_step_relaxation=0.5,
94 use_enclave_tasking=
True,
97fv_solver.set_implementation(
98 initial_conditions=scenario.initial_conditions(),
99 boundary_conditions=
"""
100 for (int i = 0; i < NumberOfUnknowns + NumberOfAuxiliaryVariables; i++) {
101 Qoutside[i] = Qinside[i];
104 flux=scenario._equation.flux(),
105 max_eigenvalue=scenario._equation.eigenvalues(),
108project.add_solver(fv_solver)
110project.set_global_simulation_parameters(
111 dimensions=dimensions,
112 size=size[0:dimensions],
113 offset=offset[0:dimensions],
114 min_end_time=scenario._end_time,
115 max_end_time=scenario._end_time,
116 first_plot_time_stamp=0.0,
117 time_in_between_plots=0.1,
118 periodic_BC=[
False] * dimensions,
121project.set_Peano4_installation(
122 "../../../../", mode=peano4.output.string_to_mode(args.build_mode)
125project.set_output_path(
"solutions")
127project = project.generate_Peano4_project(verbose=
False)
129project.constants.export_constexpr_with_type(
"GridLength", str(3**depth),
"int")
130project.constants.export_const_with_type(
132 f
'"{plot_description}"',
135project.constants.export_constexpr_with_type(
136 "ShouldPlot",
"true" if should_plot
else "false",
"bool"
139makefile = project.output.makefile
140makefile.add_cpp_file(
"KernelBenchmarks-main.cpp")
141makefile.add_h_file(
"DataRepository.h")
142makefile.add_cpp_file(
"DataRepository.cpp")
Scenario reproduced from Dumbser & Käser, https://doi.org/10.1111/j.1365-246X.2006....
Very simple scenario in which the initial value of x is shifted in each spatial dimension.
Scenario reproduced from Ioratti, Dumbser & Loubère, https://doi.org/10.1007/s10915-020-01209-w (p.
Scenario reproduced from Ioratti, Dumbser & Loubère, https://doi.org/10.1007/s10915-020-01209-w (p.
Classic radial dam break SWE equations, with constant initial water height but a bump in the bathymet...
Resting lake scenario for the shallow water equations.