Peano
Loading...
Searching...
No Matches
522_single-black-hole Namespace Reference

Functions

 psi (r)
 Conformal factor of the Schwarzschild black hole in isotropic coordinates.
 build_and_run (directory, peano_installation, end_time, scheme, enforce, patch_size=PatchSize, load_balancing=False, threads=None)
 Generate, compile and run the tutorial setup within directory.
 probe (directory, point, output_file)
 Probe all snapshots at one point.
 profile (directory, volumes_per_axis=VolumesPerAxis)
 Probe lapse and phi in the centre of each volume along the line through the centres of the volumes next to the puncture, i.e.
 radius (x, line_offset=LineOffset)
 time_steps (directory)
 Number of time steps and average wall clock time per time step.
 plot_speeding_up (coarse, fine)
 Lapse next to the puncture over time, and along the x-axis at the end, for both meshes.
 plot_initial_data (x, lapse, phi)
 Initial lapse and conformal factor along the x-axis against the closed form.
 plot_lapse_profile (x, t, lapse)
 Lapse along the x-axis for several snapshots.
 plot_lapse_over_time (x, t, lapse)
 Lapse over time at a few distances from the puncture.
 plot_constraints (unconstrained, constrained)
 Lapse and phi next to the puncture over time with and without constraint enforcement.

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 = 6
int VolumesPerAxis = CellsPerAxis * PatchSize
float TimeInBetweenPlots = 0.5
float LineOffset = DomainSize / VolumesPerAxis / 2.0
 y and z coordinate of the line along which we probe: the centre of the first volume next to the origin
int DecomposedPatchSize = 10
 The run of the section "Speeding up": the plain Finite Volumes with 10x10x10 patches over the same 9x9x9 mesh cells, the domain decomposed by a load balancing strategy, and four OpenMP threads.
int DecomposedThreads = 4
list Runs
 The runs: name, patch size, load balancing, threads, constraint enforcement.
 parser
 default
 help
 type
 float
 args = parser.parse_args()
 work_directory
dict runs = {}
 directory = os.path.join(os.path.abspath(work_directory), name)
 runtime
int volumes_per_axis = CellsPerAxis * patch_size
 x
 t
 lapse
 phi
 count
 average
float h = DomainSize / volumes_per_axis
int centre = volumes_per_axis // 2

Function Documentation

◆ build_and_run()

522_single-black-hole.build_and_run ( directory,
peano_installation,
end_time,
scheme,
enforce,
patch_size = PatchSize,
load_balancing = False,
threads = None )

Generate, compile and run the tutorial setup within directory.

Parameters
patch_sizeint Number of volumes per axis within one patch. The mesh always has CellsPerAxis cells per axis.
load_balancingbool If True, decompose the domain with toolbox.loadbalancing.strategies.SpreadOutOnceGridStagnates.
threadsint or None If not None, run with OMP_NUM_THREADS set to this value.
schemetype Numerical scheme, i.e. a Finite Volume class from exahype2.api.fv.
enforceexagrype.api.FOCCZ4Solver.EnforceCCZ4Constraint Constraint enforcement.

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.

Definition at line 104 of file 522_single-black-hole.py.

References float, and exagrype.api.initialvalues.single_black_hole().

Here is the call graph for this function:

◆ plot_constraints()

522_single-black-hole.plot_constraints ( unconstrained,
constrained )

Lapse and phi next to the puncture over time with and without constraint enforcement.

Definition at line 431 of file 522_single-black-hole.py.

References radius().

Here is the call graph for this function:

◆ plot_initial_data()

522_single-black-hole.plot_initial_data ( x,
lapse,
phi )

Initial lapse and conformal factor along the x-axis against the closed form.

Definition at line 333 of file 522_single-black-hole.py.

References psi(), and radius().

Here is the call graph for this function:

◆ plot_lapse_over_time()

522_single-black-hole.plot_lapse_over_time ( x,
t,
lapse )

Lapse over time at a few distances from the puncture.

Definition at line 406 of file 522_single-black-hole.py.

References radius().

Here is the call graph for this function:

◆ plot_lapse_profile()

522_single-black-hole.plot_lapse_profile ( x,
t,
lapse )

Lapse along the x-axis for several snapshots.

Definition at line 379 of file 522_single-black-hole.py.

◆ plot_speeding_up()

522_single-black-hole.plot_speeding_up ( coarse,
fine )

Lapse next to the puncture over time, and along the x-axis at the end, for both meshes.

Definition at line 300 of file 522_single-black-hole.py.

References radius().

Here is the call graph for this function:

◆ probe()

522_single-black-hole.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 229 of file 522_single-black-hole.py.

References float.

◆ profile()

522_single-black-hole.profile ( directory,
volumes_per_axis = VolumesPerAxis )

Probe lapse and phi in the centre of each volume along the line through the centres of the volumes next to the puncture, i.e.

along y=z=h/2

Returns the x coordinates, the time stamps and two 2d arrays lapse[snapshot,x] and phi[snapshot,x].

Definition at line 255 of file 522_single-black-hole.py.

◆ psi()

522_single-black-hole.psi ( r)

Conformal factor of the Schwarzschild black hole in isotropic coordinates.

Definition at line 73 of file 522_single-black-hole.py.

Referenced by plot_initial_data().

Here is the caller graph for this function:

◆ radius()

522_single-black-hole.radius ( x,
line_offset = LineOffset )

Definition at line 277 of file 522_single-black-hole.py.

Referenced by plot_constraints(), plot_initial_data(), plot_lapse_over_time(), and plot_speeding_up().

Here is the caller graph for this function:

◆ time_steps()

522_single-black-hole.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=...".

Definition at line 281 of file 522_single-black-hole.py.

References float.

Variable Documentation

◆ args

522_single-black-hole.args = parser.parse_args()

Definition at line 487 of file 522_single-black-hole.py.

◆ average

522_single-black-hole.average

Definition at line 508 of file 522_single-black-hole.py.

◆ CellsPerAxis

int 522_single-black-hole.CellsPerAxis = 9

Definition at line 63 of file 522_single-black-hole.py.

◆ centre

int 522_single-black-hole.centre = volumes_per_axis // 2

Definition at line 519 of file 522_single-black-hole.py.

◆ count

522_single-black-hole.count

Definition at line 508 of file 522_single-black-hole.py.

◆ DecomposedPatchSize

int 522_single-black-hole.DecomposedPatchSize = 10

The run of the section "Speeding up": the plain Finite Volumes with 10x10x10 patches over the same 9x9x9 mesh cells, the domain decomposed by a load balancing strategy, and four OpenMP threads.

Definition at line 81 of file 522_single-black-hole.py.

◆ DecomposedThreads

int 522_single-black-hole.DecomposedThreads = 4

Definition at line 82 of file 522_single-black-hole.py.

◆ default

522_single-black-hole.default

Definition at line 476 of file 522_single-black-hole.py.

◆ directory

522_single-black-hole.directory = os.path.join(os.path.abspath(work_directory), name)

Definition at line 495 of file 522_single-black-hole.py.

◆ DomainOffset

float 522_single-black-hole.DomainOffset = -9.0

Definition at line 61 of file 522_single-black-hole.py.

◆ DomainSize

float 522_single-black-hole.DomainSize = 18.0

Definition at line 62 of file 522_single-black-hole.py.

◆ float

522_single-black-hole.float

Definition at line 485 of file 522_single-black-hole.py.

Referenced by build_and_run(), probe(), and time_steps().

◆ h

522_single-black-hole.h = DomainSize / volumes_per_axis

Definition at line 509 of file 522_single-black-hole.py.

◆ help

522_single-black-hole.help

Definition at line 477 of file 522_single-black-hole.py.

◆ Here

522_single-black-hole.Here = os.path.dirname(os.path.abspath(__file__))

Definition at line 43 of file 522_single-black-hole.py.

◆ lapse

522_single-black-hole.lapse

Definition at line 507 of file 522_single-black-hole.py.

◆ LineOffset

float 522_single-black-hole.LineOffset = DomainSize / VolumesPerAxis / 2.0

y and z coordinate of the line along which we probe: the centre of the first volume next to the origin

Definition at line 70 of file 522_single-black-hole.py.

◆ Mass

float 522_single-black-hole.Mass = 1.0

Definition at line 60 of file 522_single-black-hole.py.

◆ parser

522_single-black-hole.parser
Initial value:
1= argparse.ArgumentParser(
2 description="Create the PNGs of the tutorial 522_single-black-hole.ipynb"
3 )

Definition at line 471 of file 522_single-black-hole.py.

◆ PatchFile

str 522_single-black-hole.PatchFile = "solution-CCZ4.peano-patch-file"

Definition at line 59 of file 522_single-black-hole.py.

◆ PatchSize

int 522_single-black-hole.PatchSize = 6

Definition at line 64 of file 522_single-black-hole.py.

◆ PeanoRoot

522_single-black-hole.PeanoRoot = os.path.abspath(os.path.join(Here, "..", "..", "..", ".."))

Definition at line 44 of file 522_single-black-hole.py.

◆ phi

522_single-black-hole.phi

Definition at line 507 of file 522_single-black-hole.py.

◆ Runs

list 522_single-black-hole.Runs
Initial value:
1= [
2 ("plain", PatchSize, False, None, exagrype.api.FOCCZ4Solver.EnforceCCZ4Constraint.No),
3 (
4 "decomposed",
5 DecomposedPatchSize,
6 True,
7 DecomposedThreads,
8 exagrype.api.FOCCZ4Solver.EnforceCCZ4Constraint.No,
9 ),
10 (
11 "decomposed-constrained",
12 DecomposedPatchSize,
13 True,
14 DecomposedThreads,
15 exagrype.api.FOCCZ4Solver.EnforceCCZ4Constraint.OnlyFinalSolution,
16 ),
17]

The runs: name, patch size, load balancing, threads, constraint enforcement.

Definition at line 85 of file 522_single-black-hole.py.

◆ runs

dict 522_single-black-hole.runs = {}

Definition at line 493 of file 522_single-black-hole.py.

◆ runtime

522_single-black-hole.runtime
Initial value:
1= build_and_run(
2 directory,
3 os.path.abspath(args.peano_root),
4 args.end_time,
6 enforce,
7 patch_size=patch_size,
8 load_balancing=load_balancing,
9 threads=threads,
10 )
Finite Volumes with a Rusanov Riemann solver and explicit Euler time stepping, realised over a block-...

Definition at line 496 of file 522_single-black-hole.py.

◆ t

522_single-black-hole.t

Definition at line 507 of file 522_single-black-hole.py.

◆ TimeInBetweenPlots

float 522_single-black-hole.TimeInBetweenPlots = 0.5

Definition at line 66 of file 522_single-black-hole.py.

◆ type

522_single-black-hole.type

Definition at line 485 of file 522_single-black-hole.py.

◆ volumes_per_axis

522_single-black-hole.volumes_per_axis = CellsPerAxis * patch_size

Definition at line 506 of file 522_single-black-hole.py.

◆ VolumesPerAxis

int 522_single-black-hole.VolumesPerAxis = CellsPerAxis * PatchSize

Definition at line 65 of file 522_single-black-hole.py.

◆ work_directory

522_single-black-hole.work_directory
Initial value:
1= args.work_directory or stack.enter_context(
2 tempfile.TemporaryDirectory()
3 )

Definition at line 490 of file 522_single-black-hole.py.

◆ x

522_single-black-hole.x

Definition at line 507 of file 522_single-black-hole.py.