|
Peano
|
Data Structures | |
| class | Workers |
| Number of scheme workers that are still running, and the lock to protect it. More... | |
Functions | |
| patch_size_of (volumes_per_axis) | |
| The patch size does not influence the solution. | |
| exact_solution (x, t, component) | |
| Component 0, ..., 3 of the scalar field: sin(2 pi x + m pi/4) transported along the characteristics. | |
| name_of (study, volumes_per_axis) | |
| build_and_run (study, volumes_per_axis, threads, work_directory) | |
| Generate, compile and run gauge-wave-with-scalar-field.py. | |
| measure_error (directory, volumes_per_axis) | |
| Maximum error of the four scalar fields along y=z=0.5 in the last snapshot. | |
| estimated_order (coarse, fine) | |
| Order from two meshes whose volume sizes differ by a factor of three. | |
| plot (results, studies, output_file) | |
| table (results, studies, meshes) | |
| check_orders (results, studies, meshes) | |
| The studies whose order between the two finest meshes is outside the expected range. | |
| exact_lapse (x, t) | |
| Lapse of the gauge wave, i.e. | |
| mesh_cells (volumes_per_axis) | |
| Number of mesh cells (patches) of a run. | |
| available_memory_in_kilobytes () | |
| footprint_of (process) | |
| Resident memory in kilobytes of a process and its children (/usr/bin/time forks the executable). | |
| watch_memory (process, name) | |
| Wait for a process, but kill it if the machine runs out of memory. | |
| plot (results, schemes, meshes, output_file) | |
| Max error over the volume size. | |
| store () | |
| run_scheme (scheme) | |
| One worker per scheme, all of them at the same time. | |
| study (scheme) | |
Variables | |
| Here = os.path.dirname(os.path.abspath(__file__)) | |
| PeanoRoot = os.path.abspath(os.path.join(Here, "..", "..", "..")) | |
| float | EndTime = 0.1 |
| float | Amplitude = 0.1 |
| str | PatchFile = "solution-ScalarField.peano-patch-file" |
| list | Meshes = [9, 27, 81] |
| Number of volumes per axis. | |
| list | Studies |
| The scheme of both solvers, and the couplings that are studied for it. | |
| dict | ExpectedOrders |
| Minimum estimated order between the two finest meshes. | |
| dict | MaximumOrders = {("rk4fd4", "outer-multiplicative"): 1.6} |
| Orders which the couplings must not exceed (they would indicate that the exact solution is wrong). | |
| parser | |
| required | |
| True | |
| help | |
| default | |
| nargs | |
| type | |
| int | |
| args = parser.parse_args() | |
| list | studies = [tuple(s.split(":")) for s in args.studies] |
| meshes = sorted(args.meshes) | |
| work_directory = os.path.abspath(args.work_directory) | |
| exist_ok | |
| results_file = os.path.join(work_directory, "results.json") | |
| dict | results = {} |
| f | |
| indent | |
| output_directory | |
| markdown = table(results, studies, meshes) | |
| failures = check_orders(results, studies, meshes) | |
| list | Schemes = ["fv", "rk1fd4", "rk2fd4", "rk3fd4", "rk4fd4"] |
| int | StagnationCells = 27 |
| Peano refines the root cell at least once, i.e. | |
| LargeRunSlots = threading.Semaphore(2) | |
| Runs on fine meshes are memory hungry, too. | |
| BuildSlots = threading.Semaphore(3) | |
| Compiling is memory hungry, i.e. | |
| int | MemoryFloor = 1500000 |
| Minimum memory (kilobytes) that has to stay available on the machine. | |
| dict | Footprints = {} |
| Memory footprints (kilobytes) of the runs that currently run. | |
| choices | |
| list | todo |
| alive | |
| max_workers | |
| HERE = os.path.dirname(os.path.abspath(__file__)) | |
| dict | MINIMUM_ORDERS |
| Orders the scheme has to reach at least, i.e. | |
| list | VOLUME_SIZES = ["0.0075", "0.0025", "0.00083"] |
| work = os.path.abspath(args.work_directory) | |
| list | failed = [scheme for scheme in args.schemes if study(scheme) != 0] |
| convergence-study.available_memory_in_kilobytes | ( | ) |
Definition at line 138 of file convergence-study.py.
References exact_lapse(), int, measure_error(), name_of(), patch_size_of(), and watch_memory().
Referenced by watch_memory().


| convergence-study.build_and_run | ( | scheme, | |
| volumes_per_axis, | |||
| threads, | |||
| work_directory ) |
Generate, compile and run gauge-wave-with-scalar-field.py.
Generate, compile and run gauge-wave.py.
Definition at line 103 of file convergence-study.py.
References int, measure_error(), name_of(), and patch_size_of().
Referenced by run_scheme().


| convergence-study.check_orders | ( | results, | |
| studies, | |||
| meshes ) |
The studies whose order between the two finest meshes is outside the expected range.
Return the list of schemes whose order between the two finest meshes is too low.
Definition at line 266 of file convergence-study.py.
References estimated_order(), and name_of().

| convergence-study.estimated_order | ( | coarse, | |
| fine ) |
Order from two meshes whose volume sizes differ by a factor of three.
Definition at line 205 of file convergence-study.py.
Referenced by check_orders(), and plot().

| convergence-study.exact_lapse | ( | x, | |
| t ) |
Lapse of the gauge wave, i.e.
sqrt(H) with H = 1 - A sin(2 pi (x-t))
Definition at line 124 of file convergence-study.py.
Referenced by available_memory_in_kilobytes().

| convergence-study.exact_solution | ( | x, | |
| t, | |||
| component ) |
Component 0, ..., 3 of the scalar field: sin(2 pi x + m pi/4) transported along the characteristics.
Definition at line 91 of file convergence-study.py.
Referenced by measure_error().

| convergence-study.footprint_of | ( | process | ) |
Resident memory in kilobytes of a process and its children (/usr/bin/time forks the executable).
Definition at line 281 of file convergence-study.py.
References int.
Referenced by watch_memory().

| convergence-study.measure_error | ( | directory, | |
| volumes_per_axis ) |
Maximum error of the four scalar fields along y=z=0.5 in the last snapshot.
Maximum error of the lapse along y=z=0.5 in the last snapshot.
Peano's PointProbe samples the unknowns in the centre of each volume.
Peano's PointProbe samples the lapse in the centre of each volume.
Definition at line 168 of file convergence-study.py.
References exact_solution().
Referenced by available_memory_in_kilobytes(), and build_and_run().


| convergence-study.mesh_cells | ( | volumes_per_axis | ) |
Number of mesh cells (patches) of a run.
Definition at line 129 of file convergence-study.py.
References patch_size_of().
Referenced by run_scheme().


| convergence-study.name_of | ( | study, | |
| volumes_per_axis ) |
Definition at line 98 of file convergence-study.py.
Referenced by available_memory_in_kilobytes(), build_and_run(), check_orders(), plot(), run_scheme(), and table().

| convergence-study.patch_size_of | ( | volumes_per_axis | ) |
The patch size does not influence the solution.
Peano refines the root cell at least once, i.e. the coarsest mesh with 9 volumes per axis needs patches of size 3. All other meshes use patches of size 9.
Definition at line 61 of file convergence-study.py.
Referenced by available_memory_in_kilobytes(), build_and_run(), and mesh_cells().

| convergence-study.plot | ( | results, | |
| schemes, | |||
| meshes, | |||
| output_file ) |
Max error over the volume size.
The gray lines are guides for the orders 1 to 4. The Runge-Kutta schemes of order three and four yield almost the same error, as the error of the fourth-order spatial discretisation dominates. We therefore use different markers.
Definition at line 332 of file convergence-study.py.
References estimated_order(), and name_of().

| convergence-study.plot | ( | results, | |
| studies, | |||
| output_file ) |
Definition at line 210 of file convergence-study.py.
| convergence-study.run_scheme | ( | scheme | ) |
One worker per scheme, all of them at the same time.
Each worker runs its meshes from coarse to fine. The runs on the coarse meshes do not scale and run with one thread. They are done long before the runs on the fine meshes get going, i.e. the biggest setups do not start at the same time. The cores are shared among the workers that still run.
Definition at line 481 of file convergence-study.py.
References build_and_run(), mesh_cells(), name_of(), and store().

| convergence-study.store | ( | ) |
Definition at line 464 of file convergence-study.py.
Referenced by run_scheme().

| convergence-study.study | ( | scheme | ) |
Definition at line 68 of file convergence-study.py.
| convergence-study.table | ( | results, | |
| studies, | |||
| meshes ) |
Definition at line 247 of file convergence-study.py.
References name_of().

| convergence-study.watch_memory | ( | process, | |
| name ) |
Wait for a process, but kill it if the machine runs out of memory.
Several runs go on at the same time. If less than MemoryFloor is available on the machine, the run with the biggest footprint of all runs is killed. The study then continues without that data point. Runs on fine meshes allocate their memory early, i.e. we do not waste hours before we learn that a run does not fit.
Definition at line 300 of file convergence-study.py.
References available_memory_in_kilobytes(), and footprint_of().
Referenced by available_memory_in_kilobytes().


| convergence-study.alive |
Definition at line 510 of file convergence-study.py.
| float convergence-study.Amplitude = 0.1 |
Definition at line 53 of file convergence-study.py.
| convergence-study.args = parser.parse_args() |
Definition at line 302 of file convergence-study.py.
| convergence-study.BuildSlots = threading.Semaphore(3) |
Compiling is memory hungry, i.e.
only a few builds run at the same time
Definition at line 114 of file convergence-study.py.
| convergence-study.choices |
Definition at line 439 of file convergence-study.py.
| convergence-study.default |
Definition at line 291 of file convergence-study.py.
| float convergence-study.EndTime = 0.1 |
Definition at line 52 of file convergence-study.py.
| convergence-study.exist_ok |
Definition at line 307 of file convergence-study.py.
| dict convergence-study.ExpectedOrders |
Minimum estimated order between the two finest meshes.
Minimum estimated order between the two finest meshes that the schemes have to reach.
The outer coupling freezes the spacetime within the time step (first order). The inner couplings with rk4fd4 keep the order of the time integrator, which the fourth-order discretisation in space can not exceed. Finite Volumes are first order. The values include a safety margin.
The Runge-Kutta schemes are limited by the order of their time integration, the Finite Volume scheme by its first-order spatial discretisation. The values include a safety margin.
Definition at line 79 of file convergence-study.py.
| convergence-study.f |
Definition at line 321 of file convergence-study.py.
| list convergence-study.failed = [scheme for scheme in args.schemes if study(scheme) != 0] |
Definition at line 111 of file convergence-study.py.
| convergence-study.failures = check_orders(results, studies, meshes) |
Definition at line 330 of file convergence-study.py.
| dict convergence-study.Footprints = {} |
Memory footprints (kilobytes) of the runs that currently run.
Definition at line 278 of file convergence-study.py.
| convergence-study.help |
Definition at line 288 of file convergence-study.py.
| convergence-study.HERE = os.path.dirname(os.path.abspath(__file__)) |
Definition at line 24 of file convergence-study.py.
| convergence-study.Here = os.path.dirname(os.path.abspath(__file__)) |
Definition at line 40 of file convergence-study.py.
| convergence-study.indent |
Definition at line 321 of file convergence-study.py.
| convergence-study.int |
Definition at line 300 of file convergence-study.py.
Referenced by available_memory_in_kilobytes(), build_and_run(), and footprint_of().
| convergence-study.LargeRunSlots = threading.Semaphore(2) |
Runs on fine meshes are memory hungry, too.
Only a few of them run at once; main() sets the number.
Definition at line 111 of file convergence-study.py.
| convergence-study.markdown = table(results, studies, meshes) |
Definition at line 325 of file convergence-study.py.
| convergence-study.max_workers |
Definition at line 512 of file convergence-study.py.
| dict convergence-study.MaximumOrders = {("rk4fd4", "outer-multiplicative"): 1.6} |
Orders which the couplings must not exceed (they would indicate that the exact solution is wrong).
Definition at line 88 of file convergence-study.py.
| int convergence-study.MemoryFloor = 1500000 |
Minimum memory (kilobytes) that has to stay available on the machine.
Definition at line 275 of file convergence-study.py.
| list convergence-study.Meshes = [9, 27, 81] |
Number of volumes per axis.
The meshes are regular and refined by factors of three. Peano refines the root cell at least once, i.e. the coarsest mesh needs patches of size 3.
The meshes are regular and refined by factors of three, and the patch size is 9.
Definition at line 58 of file convergence-study.py.
| convergence-study.meshes = sorted(args.meshes) |
Definition at line 305 of file convergence-study.py.
| dict convergence-study.MINIMUM_ORDERS |
Orders the scheme has to reach at least, i.e.
slightly below the formal ones
Definition at line 26 of file convergence-study.py.
| convergence-study.nargs |
Definition at line 296 of file convergence-study.py.
| convergence-study.output_directory |
Definition at line 323 of file convergence-study.py.
| convergence-study.parser |
Definition at line 285 of file convergence-study.py.
| str convergence-study.PatchFile = "solution-ScalarField.peano-patch-file" |
Definition at line 54 of file convergence-study.py.
| convergence-study.PeanoRoot = os.path.abspath(os.path.join(Here, "..", "..", "..")) |
Definition at line 41 of file convergence-study.py.
| convergence-study.required |
Definition at line 288 of file convergence-study.py.
| dict convergence-study.results = {} |
Definition at line 309 of file convergence-study.py.
| convergence-study.results_file = os.path.join(work_directory, "results.json") |
Definition at line 308 of file convergence-study.py.
| convergence-study.Schemes = ["fv", "rk1fd4", "rk2fd4", "rk3fd4", "rk4fd4"] |
Definition at line 86 of file convergence-study.py.
| int convergence-study.StagnationCells = 27 |
Peano refines the root cell at least once, i.e.
there are at least 27 mesh cells. Runs up to this number of mesh cells do not scale to many cores.
Definition at line 94 of file convergence-study.py.
| list convergence-study.Studies |
The scheme of both solvers, and the couplings that are studied for it.
Definition at line 66 of file convergence-study.py.
| list convergence-study.studies = [tuple(s.split(":")) for s in args.studies] |
Definition at line 304 of file convergence-study.py.
| list convergence-study.todo |
Definition at line 469 of file convergence-study.py.
| convergence-study.True |
Definition at line 288 of file convergence-study.py.
| convergence-study.type |
Definition at line 300 of file convergence-study.py.
| list convergence-study.VOLUME_SIZES = ["0.0075", "0.0025", "0.00083"] |
Definition at line 34 of file convergence-study.py.
| convergence-study.work = os.path.abspath(args.work_directory) |
Definition at line 64 of file convergence-study.py.
| convergence-study.work_directory = os.path.abspath(args.work_directory) |
Definition at line 306 of file convergence-study.py.