6 parser = exahype2.ArgumentParser(
"ExaHyPE 2 - ADER-DG AMR Testing Script")
12 args = parser.parse_args()
15 order = args.degrees_of_freedom - 1
16 max_h = 1.1 *
min(size) / (3.0**args.min_depth)
17 min_h = max_h * 3.0 ** (-args.amr_levels)
21 polynomials = exahype2.solvers.aderdg.Polynomials.Gauss_Legendre
23 project = exahype2.Project(
24 namespace=[
"tests",
"exahype2",
"aderdg"],
27 executable=
"ADERDG-AMR"
30 solver = exahype2.solvers.aderdg.GlobalAdaptiveTimeStep(
35 time_step_relaxation=0.8,
37 auxiliary_variables=0,
40 solver.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, true);
51 refinement_criterion=
"""
52 auto result = ::exahype2::RefinementCommand::Keep;
54 result = ::exahype2::RefinementCommand::Refine;
59 constexpr double grav = 9.81;
60 const double u = Q[1 + normal] / Q[0];
61 const double c = std::sqrt(grav * Q[0]);
62 return std::max(std::abs(u + c), std::abs(u - c));
65 const double ih = 1.0 / Q[0];
67 F[1] = Q[1 + normal] * Q[1] * ih;
68 F[2] = Q[1 + normal] * Q[2] * ih;
72 constexpr double grav = 9.81;
73 BTimesDeltaQ[0] = 0.0;
76 BTimesDeltaQ[1] = grav * Q[0] * (deltaQ[0] + deltaQ[3]);
77 BTimesDeltaQ[2] = 0.0;
80 BTimesDeltaQ[1] = 0.0;
81 BTimesDeltaQ[2] = grav * Q[0] * (deltaQ[0] + deltaQ[3]);
84 BTimesDeltaQ[3] = 0.0;
88 project.add_solver(solver)
89 project.set_output_path(
"solutions")
91 project.set_global_simulation_parameters(
95 min_end_time=end_time,
96 max_end_time=end_time,
97 first_plot_time_stamp=0.0,
98 time_in_between_plots=plot_interval,
99 periodic_BC=[
False,
False],
102 project.set_load_balancer(
"new ::exahype2::LoadBalancingConfiguration")
103 project.set_Peano4_installation(
"../../../", mode=peano4.output.string_to_mode(args.build_mode))
104 project = project.generate_Peano4_project(verbose=
False)
105 project.set_fenv_handler(
True)
106 project.build(make_clean_first=
True)
static double min(double const x, double const y)