6 parser = exahype2.ArgumentParser()
11 args = parser.parse_args()
13 xLeft, xRight = -1514683.37644735, 1514574.46378654
14 yLeft, yRight = -1108652.87362612, 1176250.82246588
16 size = [abs(xLeft) + abs(xRight), abs(yLeft) + abs(yRight)]
17 max_h = 1.1 *
min(size) / (3.0**args.min_depth)
18 min_h = max_h * 3.0 ** (-args.amr_levels)
20 fv_solver = exahype2.solvers.fv.godunov.GlobalAdaptiveTimeStep(
22 patch_size=args.degrees_of_freedom,
23 unknowns={
"h": 1,
"hu": 1,
"hv": 1},
24 auxiliary_variables={
"b": 1},
27 time_step_relaxation=args.time_step_relaxation,
28 number_of_enclave_tasks=args.ntasks,
31 fv_solver.set_implementation(
32 initial_conditions=exahype2.solvers.PDETerms.User_Defined_Implementation,
33 boundary_conditions=exahype2.solvers.PDETerms.User_Defined_Implementation,
34 refinement_criterion=exahype2.solvers.PDETerms.User_Defined_Implementation,
35 flux=exahype2.solvers.PDETerms.User_Defined_Implementation,
36 ncp=exahype2.solvers.PDETerms.User_Defined_Implementation,
37 max_eigenvalue=exahype2.solvers.PDETerms.User_Defined_Implementation,
38 source_term=exahype2.solvers.PDETerms.User_Defined_Implementation,
41 fv_solver.set_plotter(args.plotter)
43 project = exahype2.Project(
44 namespace=[
"applications",
"exahype2",
"swe"],
45 project_name=
"ArtificalMeteoTsunami",
47 executable=
"ExaHyPE-ShallowWater",
49 project.add_solver(fv_solver)
51 if args.number_of_snapshots <= 0:
52 time_in_between_plots = 0.0
54 time_in_between_plots = args.end_time / args.number_of_snapshots
55 project.set_output_path(args.output)
57 project.set_global_simulation_parameters(
60 offset=[xLeft, yLeft],
61 min_end_time=args.end_time,
62 max_end_time=args.end_time,
63 first_plot_time_stamp=0.0,
64 time_in_between_plots=time_in_between_plots,
66 args.periodic_boundary_conditions_x,
67 args.periodic_boundary_conditions_y,
72 "GRAV": [9.81,
"double"],
73 "hThreshold": [1e-5,
"double"],
82 "aeaStdParallel1": [18.3333333,
"double"],
83 "aeaStdParallel2": [31.6666667,
"double"],
84 "aeaLon0": [-84.0,
"double"],
85 "aeaLat0": [25.0,
"double"],
86 "aeaEarthRadius": [6371000.0,
"double"],
87 "pointLonA": [-85.107,
"double"],
88 "pointLatA": [30.747,
"double"],
89 "pointLonB": [-81.562,
"double"],
90 "pointLatB": [23.4480,
"double"],
91 "waterDensity": [1000 + 25,
"double"],
94 project.set_load_balancer(
95 f
"new ::exahype2::LoadBalancingConfiguration({args.load_balancing_quality}, 1, {args.trees}, {args.trees})"
97 project.set_Peano4_installation(
98 "../../../../", mode=peano4.output.string_to_mode(args.build_mode)
101 project = project.generate_Peano4_project(verbose=
False)
102 project.output.makefile.add_cpp_file(
"FVSolver.cpp")
103 for const_name, const_info
in constants.items():
104 const_val, const_type = const_info
105 project.constants.export_constexpr_with_type(const_name,
str(const_val), const_type)
106 project.set_fenv_handler(args.fpe)
107 project.build(make=
True, make_clean_first=
True, throw_away_data_after_build=
True)
static double min(double const x, double const y)