6 project = exahype2.Project(
7 [
"tests",
"exahype2",
"aderdg"],
".", executable=
"ADERDG-Limiting"
10 parser = exahype2.ArgumentParser(
"ExaHyPE 2 - ADER-DG Limiting Testing Script")
15 args = parser.parse_args()
18 order = args.degrees_of_freedom - 1
22 size = [2.0, 2.0, 2.0][0:dimensions]
23 offset = [-1.0, -1.0, -1.0][0:dimensions]
24 max_h = 1.1 *
min(size) / (3.0**args.min_depth)
25 min_h = max_h / (3.0**args.amr_levels)
27 initial_conditions =
"""
31 Q[3] = 2.0 - tarch::la::norm2(x);
34 boundary_conditions =
"""
35 Qoutside[0] = Qinside[0];
36 Qoutside[1] = Qinside[1];
37 Qoutside[2] = Qinside[2];
38 Qoutside[3] = Qinside[3];
42 double ih = 1.0 / Q[0];
45 F[1] = Q[1 + normal] * Q[1] * ih;
46 F[2] = Q[1 + normal] * Q[2] * ih;
51 constexpr double grav = 9.81;
53 BTimesDeltaQ[0] = 0.0;
56 BTimesDeltaQ[1] = grav * Q[0] * (deltaQ[0] + deltaQ[3]);
57 BTimesDeltaQ[2] = 0.0;
60 BTimesDeltaQ[1] = 0.0;
61 BTimesDeltaQ[2] = grav * Q[0] * (deltaQ[0] + deltaQ[3]);
64 BTimesDeltaQ[3] = 0.0;
68 constexpr double grav = 9.81;
70 double u = Q[1 + normal] / Q[0];
71 double c = std::sqrt(grav * Q[0]);
73 return std::max(std::abs(u + c), std::abs(u - c));
76 limiting_criterion =
"""
77 bool isBoundaryCell = (
78 x[0] + 1.00 < 0.5 * h[0] or
79 x[1] + 1.00 < 0.5 * h[1] or
80 x[0] - 1.00 > -0.5 * h[0] or
81 x[1] - 1.00 > -0.5 * h[1]
83 return !isBoundaryCell;
86 aderdg_solver = exahype2.solvers.aderdg.GlobalAdaptiveTimeStep(
90 auxiliary_variables=0,
93 time_step_relaxation=0.9,
95 aderdg_solver.set_implementation(
98 max_eigenvalue=max_eval,
99 initial_conditions=initial_conditions,
100 boundary_conditions=boundary_conditions,
102 aderdg_solver.add_kernel_optimisations(
103 polynomials=exahype2.solvers.aderdg.Polynomials.Gauss_Lobatto
105 project.add_solver(aderdg_solver)
107 fv_solver = exahype2.solvers.fv.godunov.GlobalAdaptiveTimeStep(
109 patch_size=2 * order + 1,
111 auxiliary_variables=0,
114 time_step_relaxation=0.9,
117 fv_solver.set_implementation(
120 max_eigenvalue=max_eval,
121 initial_conditions=initial_conditions,
122 boundary_conditions=boundary_conditions,
124 project.add_solver(fv_solver)
126 limiter = exahype2.solvers.limiting.StaticLimiting(
127 name=
"LimitingSolver",
128 regular_solver=aderdg_solver,
129 limiting_solver=fv_solver,
130 limiting_criterion_implementation=limiting_criterion,
132 project.add_solver(limiter)
134 project.set_output_path(
"solutions")
136 project.set_global_simulation_parameters(
137 dimensions=dimensions,
138 offset=offset[0:dimensions],
139 size=size[0:dimensions],
140 min_end_time=end_time,
141 max_end_time=end_time,
142 first_plot_time_stamp=0.0,
143 time_in_between_plots=plot_interval,
144 periodic_BC=[
False,
False,
False][0:dimensions],
147 project.set_load_balancer(
"new ::exahype2::LoadBalancingConfiguration")
148 project.set_Peano4_installation(
"../../../", mode=peano4.output.string_to_mode(args.build_mode))
149 project = project.generate_Peano4_project(verbose=
False)
150 project.set_fenv_handler(
False)
static double min(double const x, double const y)