Peano
Loading...
Searching...
No Matches
10_euler Namespace Reference

Functions

 exact_density (x, t)
 Density of the entropy wave advected with u=1 over [-0.1,0.1].
 
 build_and_run (volume_size, directory)
 Generate, compile and run the tutorial setup within directory.
 
 read_probe (directory)
 Return arrays time, density from the probe's csv file.
 
 density_along_x_axis (directory, snapshot)
 Return time stamp plus volume centres and densities along y=0.
 
 plot_mesh (directory)
 Initial density plus patch boundaries and the volumes of one patch.
 
 plot_advection (directory)
 Density along y=0 at a few time stamps against the exact solution.
 
 plot_probe (directory)
 Probe at the origin over time against the exact sine.
 
 plot_convergence (directories)
 Probe error over time for several volume sizes.
 

Variables

 Here = os.path.dirname(os.path.abspath(__file__))
 
 PeanoRoot = os.path.abspath(os.path.join(Here, "..", "..", ".."))
 
str Flux
 
str MaxEigenvalue
 
str InitPointWisely
 
float EndTime = 0.2
 
float TimeInBetweenPlots = 0.005
 
str PatchFile = "solution-EulerFV.peano-patch-file"
 
 parser
 
 default
 
 help
 
 args = parser.parse_args()
 
 work_directory = args.work_directory or tempfile.mkdtemp(prefix="10_euler-")
 
list runs = []
 
 directory = os.path.join(work_directory, "volume-size-{}".format(volume_size))
 
 exist_ok
 

Function Documentation

◆ build_and_run()

10_euler.build_and_run (   volume_size,
  directory 
)

Generate, compile and run the tutorial setup within directory.

Definition at line 91 of file 10_euler.py.

◆ density_along_x_axis()

10_euler.density_along_x_axis (   directory,
  snapshot 
)

Return time stamp plus volume centres and densities along y=0.

Definition at line 159 of file 10_euler.py.

References tarch.plotter.api.notebook.read_patches(), and tarch.plotter.api.notebook.read_snapshots().

Referenced by plot_advection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exact_density()

10_euler.exact_density (   x,
  t 
)

Density of the entropy wave advected with u=1 over [-0.1,0.1].

Definition at line 86 of file 10_euler.py.

Referenced by plot_advection(), plot_convergence(), and plot_probe().

Here is the caller graph for this function:

◆ plot_advection()

10_euler.plot_advection (   directory)

Density along y=0 at a few time stamps against the exact solution.

Definition at line 224 of file 10_euler.py.

References density_along_x_axis(), exact_density(), and tarch.plotter.api.notebook.read_snapshots().

Here is the call graph for this function:

◆ plot_convergence()

10_euler.plot_convergence (   directories)

Probe error over time for several volume sizes.

Definition at line 268 of file 10_euler.py.

References exact_density(), and read_probe().

Here is the call graph for this function:

◆ plot_mesh()

10_euler.plot_mesh (   directory)

Initial density plus patch boundaries and the volumes of one patch.

Definition at line 178 of file 10_euler.py.

References tarch.plotter.api.notebook.plot_snapshot(), tarch.plotter.api.notebook.read_patches(), and tarch.plotter.api.notebook.read_snapshots().

Here is the call graph for this function:

◆ plot_probe()

10_euler.plot_probe (   directory)

Probe at the origin over time against the exact sine.

Definition at line 247 of file 10_euler.py.

References exact_density(), and read_probe().

Here is the call graph for this function:

◆ read_probe()

10_euler.read_probe (   directory)

Return arrays time, density from the probe's csv file.

Definition at line 149 of file 10_euler.py.

Referenced by plot_convergence(), and plot_probe().

Here is the caller graph for this function:

Variable Documentation

◆ args

10_euler.args = parser.parse_args()

Definition at line 300 of file 10_euler.py.

◆ default

10_euler.default

Definition at line 297 of file 10_euler.py.

◆ directory

10_euler.directory = os.path.join(work_directory, "volume-size-{}".format(volume_size))

Definition at line 305 of file 10_euler.py.

◆ EndTime

float 10_euler.EndTime = 0.2

Definition at line 81 of file 10_euler.py.

◆ exist_ok

10_euler.exist_ok

Definition at line 306 of file 10_euler.py.

◆ Flux

str 10_euler.Flux
Initial value:
1= """
2 const double irho = 1.0 / Q[0];
3 constexpr double gamma = 1.4;
4 const double p = (gamma - 1.0) * (Q[3] - 0.5 * irho * (Q[1] * Q[1] + Q[2] * Q[2]));
5 switch (normal) {
6 case 0:
7 F[0] = Q[1];
8 F[1] = irho * Q[1] * Q[1] + p;
9 F[2] = irho * Q[1] * Q[2];
10 F[3] = irho * Q[1] * (Q[3] + p);
11 break;
12 case 1:
13 F[0] = Q[2];
14 F[1] = irho * Q[2] * Q[1];
15 F[2] = irho * Q[2] * Q[2] + p;
16 F[3] = irho * Q[2] * (Q[3] + p);
17 break;
18 }
19"""

Definition at line 41 of file 10_euler.py.

◆ help

10_euler.help

Definition at line 298 of file 10_euler.py.

◆ Here

10_euler.Here = os.path.dirname(os.path.abspath(__file__))

Definition at line 25 of file 10_euler.py.

◆ InitPointWisely

str 10_euler.InitPointWisely
Initial value:
1= """
2 constexpr double gamma = 1.4;
3 constexpr double p = 1.0;
4 constexpr double u = 1.0;
5 const double rho = 1.0 + 0.2 * std::sin(2.0 * M_PI * (x[0] + 0.1) / 0.2);
6 Q[0] = rho;
7 Q[1] = rho * u;
8 Q[2] = 0.0;
9 Q[3] = p / (gamma - 1) + 0.5 * rho * u * u;
10"""

Definition at line 70 of file 10_euler.py.

◆ MaxEigenvalue

str 10_euler.MaxEigenvalue
Initial value:
1= """
2 const double irho = 1.0 / Q[0];
3 constexpr double gamma = 1.4;
4 const double p = (gamma - 1.0) * (Q[3] - 0.5 * irho * (Q[1] * Q[1] + Q[2] * Q[2]));
5 const double c = std::sqrt(gamma * p * irho);
6 const double u = Q[1 + normal] * irho;
7 lambdaMax[0] = std::max(std::abs(u + c), std::abs(u - c));
8"""

Definition at line 61 of file 10_euler.py.

◆ parser

10_euler.parser
Initial value:
1= argparse.ArgumentParser(
2 description="Create the PNGs of the tutorial 10_euler.ipynb"
3 )

Definition at line 292 of file 10_euler.py.

◆ PatchFile

str 10_euler.PatchFile = "solution-EulerFV.peano-patch-file"

Definition at line 83 of file 10_euler.py.

◆ PeanoRoot

10_euler.PeanoRoot = os.path.abspath(os.path.join(Here, "..", "..", ".."))

Definition at line 26 of file 10_euler.py.

◆ runs

list 10_euler.runs = []

Definition at line 303 of file 10_euler.py.

◆ TimeInBetweenPlots

float 10_euler.TimeInBetweenPlots = 0.005

Definition at line 82 of file 10_euler.py.

◆ work_directory

10_euler.work_directory = args.work_directory or tempfile.mkdtemp(prefix="10_euler-")

Definition at line 302 of file 10_euler.py.