|
Peano
|
Functions | |
| create_scheme (name, solver) | |
| The numerical scheme, grid construction and plotter of one run. | |
| build_and_run (name, directory, peano_installation, end_time) | |
| Generate, compile and run one setup within directory. | |
| probe (directory, point, output_file) | |
| Probe all snapshots at one point. | |
| profile (directory) | |
| Probe lapse and phi in the centre of each volume or grid cell along the line y=z=h/2, i.e. | |
| radius (x) | |
| time_steps (directory) | |
| Number of time steps and average wall clock time per time step. | |
| plot_over_time_and_profile (runs, names, file_name) | |
| Lapse next to the puncture over time (left) and along the x-axis at the last snapshot all runs share (right) | |
| plot_fourier_analysis () | |
| Fourier analysis of the fourth-order central differences and of the Kreiss-Oliger dissipation. | |
Variables | |
| Here = os.path.dirname(os.path.abspath(__file__)) | |
| PeanoRoot = os.path.abspath(os.path.join(Here, "..", "..", "..", "..")) | |
| str | PatchFile = "solution-CCZ4.peano-patch-file" |
| float | Mass = 1.0 |
| float | DomainOffset = -9.0 |
| float | DomainSize = 18.0 |
| int | CellsPerAxis = 9 |
| int | PatchSize = 10 |
| int | VolumesPerAxis = CellsPerAxis * PatchSize |
| float | H = DomainSize / VolumesPerAxis |
| int | Threads = 4 |
| float | TimeInBetweenPlots = 0.5 |
| DissipationSubset = list(range(0, 23)) + [53, 54] | |
| Unknowns which the restricted Kreiss-Oliger dissipation damps: Q0-Q22 (G, K, theta, Z, lapse, shift, b) and Q53-Q54 (traceK, phi) | |
| dict | Runs |
| The runs: name -> (Kreiss-Oliger sigma or None, lopsided advection, quantities of the dissipation or None for all). | |
| dict | Style |
| Colours, markers and labels per run, so all pictures use the same ones. | |
| parser | |
| default | |
| help | |
| type | |
| float | |
| nargs | |
| args = parser.parse_args() | |
| work_directory | |
| dict | runs = {} |
| directory = os.path.join(os.path.abspath(work_directory), name) | |
| runtime | |
| success | |
| x | |
| t | |
| lapse | |
| phi | |
| int | centre = VolumesPerAxis // 2 |
| statistics = time_steps(directory) | |
| list | ko_runs = [name for name in Style if name.startswith("fd4-ko") and name in runs] |
| list | lopsided_runs |
| 523_higher-order-fd.build_and_run | ( | name, | |
| directory, | |||
| peano_installation, | |||
| end_time | |||
| ) |
Generate, compile and run one setup within directory.
Returns the runtime of the executable in seconds and whether it terminated successfully. If the directory holds the result of a previous run, we do not rerun but return the stored values.
Definition at line 160 of file 523_higher-order-fd.py.
References create_scheme(), float, and exagrype.api.initialvalues.single_black_hole().

| 523_higher-order-fd.create_scheme | ( | name, | |
| solver | |||
| ) |
The numerical scheme, grid construction and plotter of one run.
Definition at line 113 of file 523_higher-order-fd.py.
Referenced by build_and_run().

| 523_higher-order-fd.plot_fourier_analysis | ( | ) |
Fourier analysis of the fourth-order central differences and of the Kreiss-Oliger dissipation.
A Fourier mode exp(i k x) on a grid with spacing h is characterised by theta = k h between 0 (smooth) and pi (changes sign from grid cell to grid cell). The left picture shows the wave number which the fourth-order central difference "sees", i.e. theta_eff = (8 sin theta - sin 2 theta) / 6, against the exact one. The right picture shows the rate h/sigma * lambda with which the Kreiss-Oliger term sigma/(64 h) * (Q_{i-3} - 6 Q_{i-2} + ... + Q_{i+3}) damps the mode along one axis, i.e. (4 sin^2(theta/2))^3 / 64.
Definition at line 371 of file 523_higher-order-fd.py.
| 523_higher-order-fd.plot_over_time_and_profile | ( | runs, | |
| names, | |||
| file_name | |||
| ) |
Lapse next to the puncture over time (left) and along the x-axis at the last snapshot all runs share (right)
Definition at line 319 of file 523_higher-order-fd.py.
References radius().

| 523_higher-order-fd.probe | ( | directory, | |
| point, | |||
| output_file | |||
| ) |
Probe all snapshots at one point.
Returns the time stamps, the lapse and the conformal factor phi.
Definition at line 242 of file 523_higher-order-fd.py.
References float.
| 523_higher-order-fd.profile | ( | directory | ) |
Probe lapse and phi in the centre of each volume or grid cell along the line y=z=h/2, i.e.
through the centres next to the puncture
Returns the x coordinates, the time stamps and two 2d arrays lapse[snapshot,x] and phi[snapshot,x].
Definition at line 268 of file 523_higher-order-fd.py.
| 523_higher-order-fd.radius | ( | x | ) |
Definition at line 295 of file 523_higher-order-fd.py.
Referenced by plot_over_time_and_profile().

| 523_higher-order-fd.time_steps | ( | directory | ) |
Number of time steps and average wall clock time per time step.
Both stem from the final report of peano4::DefaultStepReport in run.log, i.e. from the line "TimeStep: ...s (avg=...,#measurements=...". Returns None if the run did not terminate regularly.
Definition at line 299 of file 523_higher-order-fd.py.
References float.
| 523_higher-order-fd.args = parser.parse_args() |
Definition at line 447 of file 523_higher-order-fd.py.
| int 523_higher-order-fd.CellsPerAxis = 9 |
Definition at line 72 of file 523_higher-order-fd.py.
| int 523_higher-order-fd.centre = VolumesPerAxis // 2 |
Definition at line 463 of file 523_higher-order-fd.py.
| 523_higher-order-fd.default |
Definition at line 430 of file 523_higher-order-fd.py.
| 523_higher-order-fd.directory = os.path.join(os.path.abspath(work_directory), name) |
Definition at line 457 of file 523_higher-order-fd.py.
| 523_higher-order-fd.DissipationSubset = list(range(0, 23)) + [53, 54] |
Unknowns which the restricted Kreiss-Oliger dissipation damps: Q0-Q22 (G, K, theta, Z, lapse, shift, b) and Q53-Q54 (traceK, phi)
Definition at line 81 of file 523_higher-order-fd.py.
| float 523_higher-order-fd.DomainOffset = -9.0 |
Definition at line 70 of file 523_higher-order-fd.py.
| float 523_higher-order-fd.DomainSize = 18.0 |
Definition at line 71 of file 523_higher-order-fd.py.
| 523_higher-order-fd.float |
Definition at line 439 of file 523_higher-order-fd.py.
Referenced by build_and_run(), probe(), and time_steps().
| float 523_higher-order-fd.H = DomainSize / VolumesPerAxis |
Definition at line 75 of file 523_higher-order-fd.py.
| 523_higher-order-fd.help |
Definition at line 431 of file 523_higher-order-fd.py.
| 523_higher-order-fd.Here = os.path.dirname(os.path.abspath(__file__)) |
Definition at line 52 of file 523_higher-order-fd.py.
| list 523_higher-order-fd.ko_runs = [name for name in Style if name.startswith("fd4-ko") and name in runs] |
Definition at line 503 of file 523_higher-order-fd.py.
| 523_higher-order-fd.lapse |
Definition at line 461 of file 523_higher-order-fd.py.
| list 523_higher-order-fd.lopsided_runs |
Definition at line 510 of file 523_higher-order-fd.py.
| float 523_higher-order-fd.Mass = 1.0 |
Definition at line 69 of file 523_higher-order-fd.py.
| 523_higher-order-fd.nargs |
Definition at line 443 of file 523_higher-order-fd.py.
| 523_higher-order-fd.parser |
Definition at line 425 of file 523_higher-order-fd.py.
| str 523_higher-order-fd.PatchFile = "solution-CCZ4.peano-patch-file" |
Definition at line 68 of file 523_higher-order-fd.py.
| int 523_higher-order-fd.PatchSize = 10 |
Definition at line 73 of file 523_higher-order-fd.py.
| 523_higher-order-fd.PeanoRoot = os.path.abspath(os.path.join(Here, "..", "..", "..", "..")) |
Definition at line 53 of file 523_higher-order-fd.py.
| 523_higher-order-fd.phi |
Definition at line 461 of file 523_higher-order-fd.py.
| dict 523_higher-order-fd.Runs |
The runs: name -> (Kreiss-Oliger sigma or None, lopsided advection, quantities of the dissipation or None for all).
The fv run is special.
Definition at line 85 of file 523_higher-order-fd.py.
| dict 523_higher-order-fd.runs = {} |
Definition at line 455 of file 523_higher-order-fd.py.
| 523_higher-order-fd.runtime |
Definition at line 458 of file 523_higher-order-fd.py.
| 523_higher-order-fd.statistics = time_steps(directory) |
Definition at line 464 of file 523_higher-order-fd.py.
| dict 523_higher-order-fd.Style |
Colours, markers and labels per run, so all pictures use the same ones.
Definition at line 97 of file 523_higher-order-fd.py.
| 523_higher-order-fd.success |
Definition at line 458 of file 523_higher-order-fd.py.
| 523_higher-order-fd.t |
Definition at line 461 of file 523_higher-order-fd.py.
| int 523_higher-order-fd.Threads = 4 |
Definition at line 76 of file 523_higher-order-fd.py.
| float 523_higher-order-fd.TimeInBetweenPlots = 0.5 |
Definition at line 77 of file 523_higher-order-fd.py.
| 523_higher-order-fd.type |
Definition at line 439 of file 523_higher-order-fd.py.
| int 523_higher-order-fd.VolumesPerAxis = CellsPerAxis * PatchSize |
Definition at line 74 of file 523_higher-order-fd.py.
| 523_higher-order-fd.work_directory |
Definition at line 452 of file 523_higher-order-fd.py.
| 523_higher-order-fd.x |
Definition at line 461 of file 523_higher-order-fd.py.