Peano
Loading...
Searching...
No Matches
pml-dynamic-rupture.py
Go to the documentation of this file.
1import os, sys, peano4, exahype2
2
3from exahype2.solvers.aderdg.ADERDG import Polynomials
4
5sys.path.insert(0, os.path.abspath("../pml"))
6sys.path.insert(0, os.path.abspath("../dynamic-rupture"))
7
8import PMLElastic
9import DynamicRuptureElastic
10import PMLDynamicRuptureElastic
11
12sys.path.insert(0, os.path.abspath("../ExaSeis_core"))
13import Scenario
14
15available_scenarios = {
16 "TPV5": Scenario.TPV5(),
17 "TPV6": Scenario.TPV6(),
18 "TPV16": Scenario.TPV16(),
19 "TPV26": Scenario.TPV26(),
20 "TPV28": Scenario.TPV28(),
21 "TPV29": Scenario.TPV29(),
22 "TPV34": Scenario.TPV34(),
23 "Husavik": Scenario.Husavik()
24}
25
26scenario = "TPV28"
27scenario_string = scenario.lower()
28my_scenario = available_scenarios[scenario]
29
30unknowns = {"v": 3, "sigma": 6, "u": 3, "pml": 27}
31auxiliary_variables = {
32 "rho": 1, "cp": 1, "cs": 1,
33 "dmp_pml": 3, "jacobian": 1,
34 "metric_derivative": 9,
35 "curve_grid": 3,
36}
37
38offset = my_scenario.domain_offset
39size = my_scenario.domain_size
40end_time = my_scenario.end_time
41plot_dt = 0.0
42order = 5
43min_level = 3
44max_depth = 0
45max_h = 1.1 * min(size) / (3.0**min_level)
46min_h = max_h / (3.0**max_depth)
47
48precision = "fp64"
49
50my_scenario.generate_required_files(order)
51
52theSolver = exahype2.solvers.aderdg.GlobalAdaptiveTimeStep(
53 name="ElasticSolver",
54 order=order,
55 unknowns=unknowns,
56 auxiliary_variables=auxiliary_variables,
57 min_cell_h=min_h,
58 max_cell_h=max_h,
59 time_step_relaxation=0.9
60)
61
62theSolver.add_kernel_optimisations(
63 is_linear=True,
64 polynomials=Polynomials.Gauss_Lobatto,
65 initialise_patches=True,
66 precision=precision
67)
68
69theSolver.set_implementation(
70 initial_conditions = PMLElastic.initial(my_scenario.initial_conditions()),
71 boundary_conditions = PMLElastic.boundary(),
72 max_eigenvalue = PMLElastic.eigenvalue(),
78)
79
80theSolver._abstract_solver_user_definitions += DynamicRuptureElastic.abstractUserDefinitions()
81theSolver._abstract_solver_user_declarations += PMLDynamicRuptureElastic.abstractDeclarations()
82theSolver._start_grid_initialisation_implementation += DynamicRuptureElastic.init_grid_step_implementation(scenario_string)
83theSolver._destructor_implementation += PMLElastic.abstractDestructor()
84theSolver.add_user_solver_includes(PMLDynamicRuptureElastic.userIncludes())
85
86project = exahype2.Project(["applications", "exahype2", "exaseis"], "pml", executable=scenario)
87
88project.add_solver(theSolver)
89
90filename = scenario+"_l_"+str(min_level)+"_o_"+str(order)+"_pr_"+str(precision)
91
92project.add_action_set_to_timestepping(
93 exahype2.tracer.CurviTracer(
94 coordinates= my_scenario.tracer_coordinates,
95 fault_coordinates=my_scenario.fault_coordinates,
96 solver=theSolver,
97 filename=filename,
98 data_delta_between_two_snapshots=1e16, time_delta_between_two_snapshots=0.01,
99 output_precision=10, clear_database_after_flush=False,
100 unknowns_to_store=12
101))
102
103if plot_dt > 0.0:
104 project.set_output_path("solutions"+filename)
105
106project.set_global_simulation_parameters(
107 dimensions=3,
108 offset=offset,
109 size=size,
110 min_end_time=end_time,
111 max_end_time=end_time,
112 first_plot_time_stamp=0.0,
113 time_in_between_plots=plot_dt,
114 periodic_BC=[False, False, False],
115)
116
117project.set_load_balancer("new ::exahype2::LoadBalancingConfiguration()")
118project.set_build_mode(peano4.output.CompileMode.Release)
119peano4_project = project.generate_Peano4_project(verbose=False)
120peano4_project.build(make_clean_first=True)
Simulates an earthquake in the north Iceland region, around the Húsavı́k-Flatey fault.
Definition Husavik.py:7
Part of a series of benchmarks by the Statewide California Earthquake Center (SCEC)
Definition TPV16.py:7
Part of a series of benchmarks by the Statewide California Earthquake Center (SCEC)
Definition TPV26.py:7
Part of a series of benchmarks by the Statewide California Earthquake Center (SCEC)
Definition TPV28.py:7
Part of a series of benchmarks by the Statewide California Earthquake Center (SCEC)
Definition TPV29.py:7
Part of a series of benchmarks by the Statewide California Earthquake Center (SCEC)
Definition TPV34.py:7
Part of a series of benchmarks by the Statewide California Earthquake Center (SCEC)
Definition TPV5.py:7
Part of a series of benchmarks by the Statewide California Earthquake Center (SCEC)
Definition TPV6.py:7
init_grid_step_implementation(scenario_string)
multiplyMaterialParameterMatrix()
abstractDestructor()
initial(pointwise_initial_conditions)
Definition PMLElastic.py:3