3import exahype2.solvers.aderdg
4from exahype2.solvers.aderdg.GlobalAdaptiveTimeStep
import (
5 GlobalAdaptiveTimeStep,
7from exahype2.solvers.aderdg.ADERDG
import Polynomials
9project = exahype2.Project([
"exahype2",
"elastic"],
"pml", executable=
"LOH1")
11unknowns = {
"v": 3,
"sigma": 6}
12auxiliary_variables = {
13 "rho": 1,
"cp": 1,
"cs": 1,
14 "jacobian": 1,
"metric_derivative": 9,
18offset = [-2.28662, 0.0, -2.28662]
19size = [16.3333, 16.3333, 16.3333]
23max_h = 1.1 * min(size) / (3.0**min_level)
24min_h = max_h / (3.0**max_depth)
27theSolver = GlobalAdaptiveTimeStep(
31 auxiliary_variables=auxiliary_variables,
34 time_step_relaxation=0.9,
35 refinement_criterion=exahype2.solvers.PDETerms.User_Defined_Implementation,
36 flux=exahype2.solvers.PDETerms.User_Defined_Implementation,
37 ncp=exahype2.solvers.PDETerms.User_Defined_Implementation,
38 material_parameters=exahype2.solvers.PDETerms.User_Defined_Implementation,
42theSolver.add_kernel_optimisations(
44 polynomials=Polynomials.Gauss_Lobatto,
45 initialise_patches=
True,
46 riemann_solver_implementation=exahype2.solvers.PDETerms.User_Defined_Implementation,
49project.add_solver(theSolver)
52tracer_particles = project.add_tracer(name=
"Tracer", attribute_count=25)
54project.add_action_set_to_initialisation(
55 exahype2.tracer.InsertParticlesByCoordinates(
56 particle_set=tracer_particles,
58 [0.000, 0., 0.693], [0.000, 0., 5.543], [0.000, 0., 10.392],
59 [0.490, 0., 0.490], [3.919, 0., 3.919], [7.348, 0., 7.3480],
60 [0.577, 0., 0.384], [4.612, 0., 3.075], [8.647, 0., 5.7640]
65project.add_action_set_to_timestepping(
69project.add_action_set_to_timestepping(
70 exahype2.tracer.DiscontinuousGalerkinTracing(
71 tracer_particles, theSolver,
72 project_on_tracer_properties_kernel=
"::exahype2::dg::projectAllValuesOntoParticle"
76project.add_action_set_to_timestepping(
77 exahype2.tracer.DumpTracerIntoDatabase(
78 particle_set=tracer_particles, solver=theSolver,
79 filename=
"tracer-Curvilinear-d-"+str(min_level)+
"-o-"+str(order),
80 data_delta_between_two_snapsots=1e16, time_delta_between_two_snapsots=0.000001,
81 output_precision=10, clear_database_after_flush=
False
85project.set_global_simulation_parameters(
89 min_end_time=end_time,
90 max_end_time=end_time,
91 first_plot_time_stamp=0.0,
92 time_in_between_plots=0.0,
93 periodic_BC=[
False,
False,
False],
101project.set_load_balancing(
"toolbox::loadbalancing::strategies::SpreadOutOnceGridStagnates",
"new ::exahype2::LoadBalancingConfiguration()" )
102project.set_Peano4_installation(
"../../../../", peano4.api.output.CompileMode.RELEASE )
103peano4_project = project.generate_Peano4_project(
"False")
105peano4_project.output.makefile.set_CXX_compiler(
"mpicxx")
106peano4_project.output.makefile.add_CXX_flag(
"-fopenmp -DUSE_ASAGI")
107peano4_project.output.makefile.add_library(
108 "-fopenmp -lcurvi -leasi -lyaml-cpp -limpalajit -lasagi -lnetcdf -lnuma -lmpi -DUSE_ASAGI"
111peano4_project.build(make_clean_first=
True, number_of_parallel_builds=32)
Update the parallel state of particles and keep stats of them.