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"))
6
7import PMLElastic
8import PMLDynamicRuptureElastic
9
10#sys.path.insert(0, os.path.abspath("../ExaSeis_core/Scenario"))
11#import TPV5, TPV26, TPV28, TPV29
12
13sys.path.insert(0, os.path.abspath("../ExaSeis_core"))
14import Scenario
15
16
17available_scenarios = {
18 "TPV5": Scenario.TPV5(),
19 "TPV26": Scenario.TPV26(),
20 "TPV28": Scenario.TPV28(),
21 "TPV29": Scenario.TPV29()
22}
23
24scenario = "TPV28"
25scenario_string = scenario.lower()
26my_scenario = available_scenarios[scenario]
27
28unknowns = {"v": 3, "sigma": 6, "u": 3, "pml": 27}
29auxiliary_variables = {
30 "rho": 1, "cp": 1, "cs": 1,
31 "dmp_pml": 3, "jacobian": 1,
32 "metric_derivative": 9,
33 "curve_grid": 3,
34}
35
36offset = my_scenario.domain_offset
37size = my_scenario.domain_size
38end_time = my_scenario.end_time
39plot_dt = 0.0
40order = 5
41min_level = 3
42max_depth = 0
43max_h = 1.1 * min(size) / (3.0**min_level)
44min_h = max_h / (3.0**max_depth)
45
46precision = "fp64"
47
48my_scenario.generate_required_files(order)
49
50theSolver = exahype2.solvers.aderdg.GlobalAdaptiveTimeStep(
51 name="ElasticSolver",
52 order=order,
53 unknowns=unknowns,
54 auxiliary_variables=auxiliary_variables,
55 min_cell_h=min_h,
56 max_cell_h=max_h,
57 time_step_relaxation=0.9
58)
59
60theSolver.add_kernel_optimisations(
61 is_linear=True,
62 polynomials=Polynomials.Gauss_Lobatto,
63 initialise_patches=True,
64 precision=precision
65)
66
67theSolver.set_implementation(
68 initial_conditions = PMLElastic.initial(my_scenario.initial_conditions()),
69 boundary_conditions = PMLElastic.boundary(),
70 max_eigenvalue = PMLElastic.eigenvalue(),
76)
77
78theSolver._finish_time_step_implementation += PMLDynamicRuptureElastic.finish_time_step_implementation(scenario_string)
79theSolver._abstract_solver_user_definitions += PMLDynamicRuptureElastic.abstractUserDefinitions()
80theSolver._abstract_solver_user_declarations += PMLDynamicRuptureElastic.abstractDeclarations()
81theSolver._start_grid_initialisation_implementation += PMLDynamicRuptureElastic.init_grid_step_implementation(scenario_string)
82theSolver._destructor_implementation += PMLElastic.abstractDestructor()
83theSolver.add_user_solver_includes(PMLDynamicRuptureElastic.userIncludes())
84
85project = exahype2.Project(["exahype2", "elastic"], "pml", executable=scenario)
86
87project.add_solver(theSolver)
88
89filename = scenario+"_l_"+str(min_level)+"_o_"+str(order)+"_pr_"+str(precision)
90
91project.add_action_set_to_timestepping(
92 exahype2.tracer.CurviTracer(
93 coordinates= my_scenario.tracer_coordinates,
94 solver=theSolver,
95 filename=filename,
96 data_delta_between_two_snapshots=1e16, time_delta_between_two_snapshots=0.01,
97 output_precision=10, clear_database_after_flush=False,
98 unknowns_to_store=12
99))
100
101if plot_dt > 0.0:
102 project.set_output_path("solutions"+filename)
103
104project.set_global_simulation_parameters(
105 dimensions=3,
106 offset=offset,
107 size=size,
108 min_end_time=end_time,
109 max_end_time=end_time,
110 first_plot_time_stamp=0.0,
111 time_in_between_plots=plot_dt,
112 periodic_BC=[False, False, False],
113)
114
115project.set_load_balancer("new ::exahype2::LoadBalancingConfiguration()")
116project.set_Peano4_installation( "../../../../", peano4.output.CompileMode.Release )
117peano4_project = project.generate_Peano4_project(verbose=False)
118peano4_project.build(make_clean_first=True)
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 TPV5.py:7
finish_time_step_implementation(scenario_string)
init_grid_step_implementation(scenario_string)
multiplyMaterialParameterMatrix()
abstractDestructor()
initial(pointwise_initial_conditions)
Definition PMLElastic.py:3