6project = exahype2.Project(
7 [
"tests",
"exahype2",
"aderdg"],
".", executable=
"ADERDG-Limiting"
17offset = [-1.0, -1.0, -1.0][0:dimensions]
18size = [2.0, 2.0, 2.0][0:dimensions]
19max_h = 1.1 * min(size) / (3.0**min_level)
20min_h = max_h / (3.0**max_depth)
29 Q[3] = 2.0 - tarch::la::norm2("""
36boundary_conditions =
"""
37 Qoutside[0] = Qinside[0];
38 Qoutside[1] = Qinside[1];
39 Qoutside[2] = Qinside[2];
40 Qoutside[3] = Qinside[3];
44 double ih = 1.0 / Q[0];
47 F[1] = Q[1 + normal] * Q[1] * ih;
48 F[2] = Q[1 + normal] * Q[2] * ih;
53 constexpr double grav = 9.81;
55 BTimesDeltaQ[0] = 0.0;
58 BTimesDeltaQ[1] = grav * Q[0] * (deltaQ[0] + deltaQ[3]);
59 BTimesDeltaQ[2] = 0.0;
62 BTimesDeltaQ[1] = 0.0;
63 BTimesDeltaQ[2] = grav * Q[0] * (deltaQ[0] + deltaQ[3]);
66 BTimesDeltaQ[3] = 0.0;
70 constexpr double grav = 9.81;
72 double u = Q[1 + normal] / Q[0];
73 double c = std::sqrt(grav * Q[0]);
75 return std::max(std::abs(u + c), std::abs(u - c));
78limiting_criterion =
"""
79bool isBoundaryCell = (
80 x[0] + 1.00 < 0.5 * h[0] or
81 x[1] + 1.00 < 0.5 * h[1] or
82 x[0] - 1.00 > -0.5 * h[0] or
83 x[1] - 1.00 > -0.5 * h[1]
85return !isBoundaryCell;
88aderdg_solver = exahype2.solvers.aderdg.GlobalAdaptiveTimeStep(
92 auxiliary_variables=0,
95 time_step_relaxation=0.9,
100 boundary_conditions=boundary_conditions,
102aderdg_solver.add_kernel_optimisations(
103 polynomials=exahype2.solvers.aderdg.Polynomials.Gauss_Lobatto
105project.add_solver(aderdg_solver)
107fv_solver = exahype2.solvers.fv.rusanov.GlobalAdaptiveTimeStep(
109 patch_size=2 * order + 1,
111 auxiliary_variables=0,
114 time_step_relaxation=0.9,
117 eigenvalues=max_eval,
119 boundary_conditions=boundary_conditions,
121project.add_solver(fv_solver)
123limiter = exahype2.solvers.limiting.StaticLimiting(
124 name=
"LimitingSolver",
125 regular_solver=aderdg_solver,
126 limiting_solver=fv_solver,
127 limiting_criterion_implementation=limiting_criterion,
129project.add_solver(limiter)
131project.set_output_path(
"solutions")
133build_mode = peano4.api.output.CompileMode.RELEASE
135project.set_global_simulation_parameters(
136 dimensions=dimensions,
137 offset=offset[0:dimensions],
138 size=size[0:dimensions],
139 min_end_time=end_time,
140 max_end_time=end_time,
141 first_plot_time_stamp=0.0,
142 time_in_between_plots=plot_interval,
143 periodic_BC=[
False,
False,
False][0:dimensions],
146project.set_load_balancing(
147 "toolbox::loadbalancing::strategies::SpreadOutOnceGridStagnates",
148 "new ::exahype2::LoadBalancingConfiguration(0.98)",
150project.set_Peano4_installation(
"../../../", build_mode)
151project = project.generate_Peano4_project(
"False")
154project.build(make_clean_first=
True)