5from exahype2.solvers.aderdg.ADERDG
import Polynomials
7from Elastic
import flux, eigenvalue, initial, boundary
15polynomials =
"legendre"
19size = [size_1d, size_1d, size_1d]
20offset = [-size[0]/2., -size[1]/2., 0.0]
22unknowns = {
"v": 3,
"sigma": 6}
23auxiliary_variables = {
"rho":1,
"cp": 1,
"cs": 1}
25max_h = 1.1 * min(size) / (3.0**min_level)
26min_h = max_h / (3.0**max_depth)
28project = exahype2.Project( [
"applications",
"exahype2",
"elastic"],
".",
29 executable=
"LOH_level_"+str(min_level)+
"_order_"+str(order)+
"_"+polynomials+
"_precision_"+str(precision) )
31theSolver=exahype2.solvers.aderdg.GlobalAdaptiveTimeStep(
32 name=
"elastic", order=order,
33 unknowns=unknowns, auxiliary_variables=auxiliary_variables,
34 min_cell_h=min_h, max_cell_h=max_h, time_step_relaxation=0.9
37theSolver.add_kernel_optimisations(
38 is_linear=
True, polynomials=(Polynomials.Gauss_Lobatto
if polynomials==
"lobatto" else Polynomials.Gauss_Legendre)
39 ,solution_persistent_storage_precision=precision
40 ,predictor_computation_precisions=[precision]
41 ,corrector_computation_precision=precision
44theSolver.set_implementation(
45 initial_conditions = initial(),
46 boundary_conditions = boundary(),
47 eigenvalues = eigenvalue(),
49 refinement_criterion = exahype2.solvers.PDETerms.User_Defined_Implementation,
53project.add_solver(theSolver)
56 tracer_particles = project.add_tracer(name=
"Tracer", attribute_count=12)
58 project.add_action_set_to_initialisation(
59 exahype2.tracer.InsertParticlesByCoordinates(
60 particle_set=tracer_particles,
61 coordinates=[ [0.693, 0.000, 0.000], [7.348, 7.348, 0.000] ]
65 project.add_action_set_to_timestepping(
69 project.add_action_set_to_timestepping(
70 exahype2.tracer.DiscontinuousGalerkinTracing(
71 tracer_particles, theSolver,
72 project_on_tracer_properties_kernel=
"::exahype2::dg::projectAllValuesOntoParticle"
76 project.add_action_set_to_timestepping(
77 exahype2.tracer.DumpTracerIntoDatabase(
78 particle_set=tracer_particles, solver=theSolver,
79 filename=
"tracers/Cartesian_level_"+str(min_level)+
"_order_"+str(order)+
"_"+polynomials+
"_precision_"+str(precision),
80 data_delta_between_two_snapsots=1e16, time_delta_between_two_snapsots=0.000001,
81 output_precision=10, clear_database_after_flush=
False
85 if not os.path.exists(
"tracers"):
86 os.makedirs(
"tracers")
89 project.set_output_path(
"solutions")
91project.set_global_simulation_parameters(
96 first_plot_time_stamp = 0.0,
97 time_in_between_plots = plot_dt,
100project.set_load_balancing(
"toolbox::loadbalancing::strategies::SpreadOutOnceGridStagnates",
"new ::exahype2::LoadBalancingConfiguration()" )
101project.set_Peano4_installation(
"../../../../", peano4.api.output.CompileMode.RELEASE )
102peano4_project = project.generate_Peano4_project(
"False")
103peano4_project.output.makefile.add_h_file(
"elastic.h")
104peano4_project.output.makefile.add_cpp_file(
"elastic.cpp")
106peano4_project.build(make_clean_first=
True)
Update the parallel state of particles and keep stats of them.