Peano
Loading...
Searching...
No Matches
521_gauge-wave Namespace Reference

Functions

 exact_lapse (x, t)
 Lapse of the gauge wave, i.e.
 
 build_and_run (volumes_per_axis, patch_size, directory, peano_installation)
 Generate, compile and run the tutorial setup within directory.
 
 probe (directory, point, output_file)
 Probe all snapshots at one point and return (time stamps, lapse)
 
 wave_profile (directory, volumes_per_axis)
 Probe the lapse in the centre of each volume along the line y=z=0.5.
 
 plot_mesh (directory, volumes_per_axis, patch_size)
 Initial lapse along the x-axis with volumes and patches.
 
 plot_profile (directory, volumes_per_axis)
 Lapse along the x-axis for three snapshots.
 
 plot_probe (directory)
 Lapse at the centre of the domain over time.
 
 errors_over_time (directory, volumes_per_axis)
 Maximum and L2 error of the lapse along the x-axis for all snapshots.
 
 plot_convergence (results)
 Maximum error over volume size for several points in time.
 
 order (coarse_error, fine_error)
 Estimated convergence order from two meshes whose volume sizes differ by a factor of three.
 
 directory_of (volumes_per_axis, patch_size)
 

Variables

 Here = os.path.dirname(os.path.abspath(__file__))
 
 PeanoRoot = os.path.abspath(os.path.join(Here, "..", "..", "..", ".."))
 
float EndTime = 1.0
 
str PatchFile = "solution-CCZ4.peano-patch-file"
 
float Amplitude = 0.1
 
dict MaxVolumeSizes = {9: 0.12, 27: 0.04, 81: 0.013}
 Maximum volume sizes handed to the grid construction, indexed by the number of volumes per axis that they yield.
 
list Configurations
 (volumes per axis, patch size) pairs of the convergence study.
 
tuple Reference = (27, 9)
 The configuration of the tutorial itself.
 
 parser
 
 default
 
 help
 
 args = parser.parse_args()
 
 work_directory
 
dict results = {}
 
 directory = directory_of(volumes_per_axis, patch_size)
 
 runtime
 
 t
 
 max_errors
 
 l2_errors
 
 reference_directory = directory_of(*Reference)
 
 key
 
dict coarser = results.get((volumes_per_axis // 3, patch_size))
 
 order_max = float("nan")
 
 order_l2 = order(coarser["L2 errors"][-1], values["L2 errors"][-1])
 
list errors
 

Function Documentation

◆ build_and_run()

521_gauge-wave.build_and_run (   volumes_per_axis,
  patch_size,
  directory,
  peano_installation 
)

Generate, compile and run the tutorial setup within directory.

Returns the runtime of the executable in seconds. If the directory holds the result of a previous run, we do not rerun but return the stored runtime. peano_installation is the configured and built Peano root directory which the generated Makefile links against.

Definition at line 81 of file 521_gauge-wave.py.

References exagrype.api.initialvalues.gauge_wave().

Here is the call graph for this function:

◆ directory_of()

521_gauge-wave.directory_of (   volumes_per_axis,
  patch_size 
)

Definition at line 379 of file 521_gauge-wave.py.

◆ errors_over_time()

521_gauge-wave.errors_over_time (   directory,
  volumes_per_axis 
)

Maximum and L2 error of the lapse along the x-axis for all snapshots.

Returns the time stamps plus the two errors per snapshot.

Definition at line 285 of file 521_gauge-wave.py.

References exact_lapse(), and wave_profile().

Here is the call graph for this function:

◆ exact_lapse()

521_gauge-wave.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 76 of file 521_gauge-wave.py.

Referenced by errors_over_time(), plot_mesh(), plot_probe(), and plot_profile().

Here is the caller graph for this function:

◆ order()

521_gauge-wave.order (   coarse_error,
  fine_error 
)

Estimated convergence order from two meshes whose volume sizes differ by a factor of three.

Definition at line 352 of file 521_gauge-wave.py.

◆ plot_convergence()

521_gauge-wave.plot_convergence (   results)

Maximum error over volume size for several points in time.

The lines show patch size 3 at several time stamps. The markers for patch sizes 9 and 27 are drawn for the final time stamp only.

Definition at line 298 of file 521_gauge-wave.py.

◆ plot_mesh()

521_gauge-wave.plot_mesh (   directory,
  volumes_per_axis,
  patch_size 
)

Initial lapse along the x-axis with volumes and patches.

Definition at line 203 of file 521_gauge-wave.py.

References exact_lapse(), and wave_profile().

Here is the call graph for this function:

◆ plot_probe()

521_gauge-wave.plot_probe (   directory)

Lapse at the centre of the domain over time.

Definition at line 267 of file 521_gauge-wave.py.

References exact_lapse().

Here is the call graph for this function:

◆ plot_profile()

521_gauge-wave.plot_profile (   directory,
  volumes_per_axis 
)

Lapse along the x-axis for three snapshots.

Definition at line 237 of file 521_gauge-wave.py.

References exact_lapse(), and wave_profile().

Here is the call graph for this function:

◆ probe()

521_gauge-wave.probe (   directory,
  point,
  output_file 
)

Probe all snapshots at one point and return (time stamps, lapse)

This is the Python counterpart of src/tarch/plotter/api/probe.py.

Definition at line 159 of file 521_gauge-wave.py.

◆ wave_profile()

521_gauge-wave.wave_profile (   directory,
  volumes_per_axis 
)

Probe the lapse in the centre of each volume along the line y=z=0.5.

Returns the x coordinates, the time stamps of all snapshots and a 2d array lapse[snapshot,x].

Definition at line 184 of file 521_gauge-wave.py.

Referenced by errors_over_time(), plot_mesh(), and plot_profile().

Here is the caller graph for this function:

Variable Documentation

◆ Amplitude

float 521_gauge-wave.Amplitude = 0.1

Definition at line 50 of file 521_gauge-wave.py.

◆ args

521_gauge-wave.args = parser.parse_args()

Definition at line 371 of file 521_gauge-wave.py.

◆ coarser

dict 521_gauge-wave.coarser = results.get((volumes_per_axis // 3, patch_size))

Definition at line 423 of file 521_gauge-wave.py.

◆ Configurations

list 521_gauge-wave.Configurations
Initial value:
1= [
2 (9, 3),
3 (27, 3),
4 (81, 3),
5 (27, 9),
6 (81, 9),
7 (81, 27),
8]

(volumes per axis, patch size) pairs of the convergence study.

Peano always refines the root cell at least once, i.e. we need at least three patches per axis.

Definition at line 63 of file 521_gauge-wave.py.

◆ default

521_gauge-wave.default

Definition at line 363 of file 521_gauge-wave.py.

◆ directory

521_gauge-wave.directory = directory_of(volumes_per_axis, patch_size)

Definition at line 386 of file 521_gauge-wave.py.

◆ EndTime

float 521_gauge-wave.EndTime = 1.0

Definition at line 48 of file 521_gauge-wave.py.

◆ errors

list 521_gauge-wave.errors
Initial value:
1= [
2 results[(volumes, 3)]["max errors"][snapshot] for volumes in [9, 27, 81]
3 ]

Definition at line 448 of file 521_gauge-wave.py.

◆ help

521_gauge-wave.help

Definition at line 364 of file 521_gauge-wave.py.

◆ Here

521_gauge-wave.Here = os.path.dirname(os.path.abspath(__file__))

Definition at line 32 of file 521_gauge-wave.py.

◆ key

521_gauge-wave.key

Definition at line 421 of file 521_gauge-wave.py.

◆ l2_errors

521_gauge-wave.l2_errors

Definition at line 393 of file 521_gauge-wave.py.

◆ max_errors

521_gauge-wave.max_errors

Definition at line 393 of file 521_gauge-wave.py.

◆ MaxVolumeSizes

dict 521_gauge-wave.MaxVolumeSizes = {9: 0.12, 27: 0.04, 81: 0.013}

Maximum volume sizes handed to the grid construction, indexed by the number of volumes per axis that they yield.

Peano refines every cell whose edge length is greater than or equal to the maximum volume size times the patch size, i.e. the resulting volume size h is strictly smaller than the maximum volume size. We therefore pass in values slightly bigger than the volume sizes 1/9, 1/27 and 1/81 that we want to obtain.

Definition at line 58 of file 521_gauge-wave.py.

◆ order_l2

521_gauge-wave.order_l2 = order(coarser["L2 errors"][-1], values["L2 errors"][-1])

Definition at line 427 of file 521_gauge-wave.py.

◆ order_max

521_gauge-wave.order_max = float("nan")

Definition at line 424 of file 521_gauge-wave.py.

◆ parser

521_gauge-wave.parser
Initial value:
1= argparse.ArgumentParser(
2 description="Create the PNGs of the tutorial 521_gauge-wave.ipynb"
3 )

Definition at line 358 of file 521_gauge-wave.py.

◆ PatchFile

str 521_gauge-wave.PatchFile = "solution-CCZ4.peano-patch-file"

Definition at line 49 of file 521_gauge-wave.py.

◆ PeanoRoot

521_gauge-wave.PeanoRoot = os.path.abspath(os.path.join(Here, "..", "..", "..", ".."))

Definition at line 33 of file 521_gauge-wave.py.

◆ Reference

tuple 521_gauge-wave.Reference = (27, 9)

The configuration of the tutorial itself.

Definition at line 73 of file 521_gauge-wave.py.

◆ reference_directory

521_gauge-wave.reference_directory = directory_of(*Reference)

Definition at line 401 of file 521_gauge-wave.py.

◆ results

dict 521_gauge-wave.results = {}

Definition at line 384 of file 521_gauge-wave.py.

◆ runtime

521_gauge-wave.runtime
Initial value:
1= build_and_run(
2 volumes_per_axis,
3 patch_size,
4 directory,
5 os.path.abspath(args.peano_root),
6 )

Definition at line 387 of file 521_gauge-wave.py.

◆ t

521_gauge-wave.t

Definition at line 393 of file 521_gauge-wave.py.

◆ work_directory

521_gauge-wave.work_directory
Initial value:
1= args.work_directory or stack.enter_context(
2 tempfile.TemporaryDirectory()
3 )

Definition at line 374 of file 521_gauge-wave.py.