Peano
Loading...
Searching...
No Matches
swe.py
Go to the documentation of this file.
1# This file is part of the ExaHyPE2 project. For conditions of distribution and
2# use, please see the copyright notice at www.peano-framework.org
3import peano4.api
4import exahype2
5
6order = 3
7max_h = 1.0 / 9.0
8min_h = 0.9 / 27.0 # 0.9 / 81.0
9plot_interval = 0.0 # 0.01
10end_time = 0.1
11
12polynomials = exahype2.solvers.aderdg.Polynomials.Gauss_Legendre
13
14project = exahype2.Project(
15 ["tests", "exahype2", "aderdg"], ".", executable="ADERDG-AMR"
16)
17
18solver = exahype2.solvers.aderdg.GlobalAdaptiveTimeStep(
19 name="SWE",
20 order=order,
21 min_cell_h=min_h,
22 max_cell_h=max_h,
23 time_step_relaxation=0.8,
24 unknowns=4,
25 auxiliary_variables=0,
26 refinement_criterion=exahype2.solvers.PDETerms.User_Defined_Implementation,
27 flux=exahype2.solvers.PDETerms.User_Defined_Implementation,
28 ncp=exahype2.solvers.PDETerms.User_Defined_Implementation,
29)
30
31# solver._split_sweeps = True
32project.add_solver(solver)
33
34project.set_output_path("solutions")
35
36project.set_global_simulation_parameters(
37 dimensions=2,
38 offset=[0.0, 0.0],
39 size=[1.0, 1.0],
40 min_end_time=end_time,
41 max_end_time=end_time,
42 first_plot_time_stamp=0.0,
43 time_in_between_plots=plot_interval,
44 periodic_BC=[False, False],
45)
46
47project.set_load_balancing(
48 "toolbox::loadbalancing::strategies::SpreadOutOnceGridStagnates",
49 "new ::exahype2::LoadBalancingConfiguration(0.98)",
50)
51project.set_Peano4_installation("../../../", peano4.api.output.CompileMode.RELEASE)
52project = project.generate_Peano4_project("False")
53#project.set_fenv_handler("FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW")
54project.output.makefile.add_cpp_file("SWE.cpp")
55
56project.build(make_clean_first=True)
57
58print(solver)
59print(project)