Peano
Loading...
Searching...
No Matches
gauge-wave.py
Go to the documentation of this file.
1"""
2
3Gauge wave benchmark for the ExaGRyPE Python API
4
5The gauge wave is a pure gauge perturbation of flat spacetime, i.e. an
6analytical solution of the Einstein equations that travels along the x-axis
7with speed one. It is periodic over the unit cube and hence a standard first
8test of any numerical relativity code. This script uses exagrype.api, i.e.
9the CCZ4 solver of the new Python API, and discretises it with Finite
10Volumes. It requires a Peano build with
11
12 --enable-exahype --enable-blockstructured --enable-loadbalancing --enable-exagrype
13
14and is run from this directory via
15
16 python3 gauge-wave.py
17
18"""
19
20import peano4.api
21import exahype2.api
22import exagrype.api
23
24
25create_release_build = False
26
27if create_release_build:
28 build_mode = peano4.api.output.CompileMode.RELEASE
29 volume_size = 1.0 / 81.0
30 end_time = 1.0
31 time_in_between_plots = 0.1
32 verbosity = peano4.api.LoggerVerbosity.TEXT
33else:
34 build_mode = peano4.api.output.CompileMode.DEBUG
35 volume_size = 1.0 / 27.0
36 end_time = 0.02
37 time_in_between_plots = 0.01
38 verbosity = peano4.api.LoggerVerbosity.VISUALISATION
39
40patch_size = 9
41
42
44 namespace=["benchmarks", "exagrype", "gaugewave"],
45 project_name="gauge-wave",
46 directory=".",
47 executable="gauge-wave",
48)
49
51 "CCZ4",
52 initial_condition=exagrype.api.initialvalues.gauge_wave(),
53)
55 solver, patch_size
56)
58 solver, volume_size=volume_size
59)
61 solver, first_plot_time_stamp=0.0, time_in_between_plots=time_in_between_plots
62)
63project.add_solver(solver)
64
65project.compiler = (
66 peano4.api.taskgraph.compiler.CellTaskProducerConsumer.translate_with_fusion
67)
68
69project.set_global_simulation_parameters(
70 dimensions=3,
71 offset=[0.0, 0.0, 0.0],
72 size=[1.0, 1.0, 1.0],
73 min_end_time=end_time,
74 max_end_time=end_time,
75 periodic_BC=[True, True, True],
76)
77
78project.set_Peano4_installation("../../../", build_mode)
79peano4_project = project.generate_Peano4_project(verbosity=verbosity)
80peano4_project.generate()
81peano4_project.build(make_clean_first=True)
Solver for the Einstein equations in the first-order CCZ4 formulation.
Definition CCZ4Solver.py:16
ExaHyPE 2 project.
Definition Project.py:15
Plotting counterpart to RusanovWithExplicitEuler: maps the patch data of a Finite Volume scheme with ...
Finite Volumes with a Rusanov Riemann solver and optimistic explicit Euler time stepping,...
Setup phase counterpart to RusanovWithExplicitEuler: sets the initial condition for a Finite Volume s...
exahype2.api.InitPointWisely gauge_wave()
Gauge wave along the x-axis,.
This file is part of the ExaGRyPE project.
Definition __init__.py:1