6parser = exahype2.ArgumentParser(
"ExaHyPE 2 - ADER-DG Static AMR Testing Script")
12args = parser.parse_args()
15order = args.degrees_of_freedom - 1
16max_h = 1.1 * min(size) / (3.0**args.min_depth)
17min_h = max_h * 3.0 ** (-args.amr_levels)
21polynomials = exahype2.solvers.aderdg.Polynomials.Gauss_Legendre
23project = exahype2.Project(
24 namespace=[
"tests",
"exahype2",
"aderdg"],
30solver = exahype2.solvers.aderdg.GlobalAdaptiveTimeStep(
35 time_step_relaxation=0.8,
37 auxiliary_variables=0,
40solver.set_implementation(
41 initial_conditions=
"""
42 double r = std::sqrt((x[0] - 0.5) * (x[0] - 0.5) + (x[1] - 0.5) * (x[1] - 0.5));
46 Q[3] = r < 0.1 ? 0.0 : 0.05;
48 boundary_conditions=
"""
49 initialCondition(Qoutside, x, h);
51 refinement_criterion=
"""
52 auto result = ::exahype2::RefinementCommand::Keep;
53 double r = std::sqrt((x[0] - 0.5) * (x[0] - 0.5) + (x[1] - 0.5) * (x[1] - 0.5));
55 result = ::exahype2::RefinementCommand::Refine;
60 constexpr double grav = 9.81;
61 const double u = Q[1 + normal] / Q[0];
62 const double c = std::sqrt(grav * Q[0]);
63 return std::max(std::abs(u + c), std::abs(u - c));
66 const double ih = 1.0 / Q[0];
68 F[1] = Q[1 + normal] * Q[1] * ih;
69 F[2] = Q[1 + normal] * Q[2] * ih;
73 constexpr double grav = 9.81;
74 BTimesDeltaQ[0] = 0.0;
77 BTimesDeltaQ[1] = grav * Q[0] * (deltaQ[0] + deltaQ[3]);
78 BTimesDeltaQ[2] = 0.0;
81 BTimesDeltaQ[1] = 0.0;
82 BTimesDeltaQ[2] = grav * Q[0] * (deltaQ[0] + deltaQ[3]);
85 BTimesDeltaQ[3] = 0.0;
89project.add_solver(solver)
90project.set_output_path(
"solutions")
92project.set_global_simulation_parameters(
96 min_end_time=end_time,
97 max_end_time=end_time,
98 first_plot_time_stamp=0.0,
99 time_in_between_plots=plot_interval,
100 periodic_BC=[
False,
False],
103project.set_load_balancer(
"new ::exahype2::LoadBalancingConfiguration")
104project.set_build_mode(mode=peano4.output.string_to_mode(args.build_mode))
105project = project.generate_Peano4_project(verbose=
False)
106project.build(make_clean_first=
True)