Skip to content

Commit

Permalink
update mesh and solution file names in docs, examples, and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ranocha authored Jul 1, 2024
1 parent 2e3b852 commit bea873a
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 32 deletions.
14 changes: 7 additions & 7 deletions docs/literate/src/files/first_steps/create_first_setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -260,28 +260,28 @@ plot!(getmesh(pd))
# import Pkg
# Pkg.add(["Trixi2Vtk"])
# ```
# Now we load the Trixi2Vtk.jl package and convert the file `out/solution_000032.h5` with
# Now we load the Trixi2Vtk.jl package and convert the file `out/solution_000000032.h5` with
# the final solution using the [`trixi2vtk`](@ref) function saving the resulting file in the
# `out` folder.

using Trixi2Vtk
trixi2vtk(joinpath("out", "solution_000032.h5"), output_directory="out")
trixi2vtk(joinpath("out", "solution_000000032.h5"), output_directory="out")

# Now two files `solution_000032.vtu` and `solution_000032_celldata.vtu` have been generated in the
# Now two files `solution_000000032.vtu` and `solution_000000032_celldata.vtu` have been generated in the
# `out` folder. The first one contains all the information for visualizing the solution, the
# second one contains all the cell-based or discretization-based information.

# Now let's visualize the solution from the generated files in ParaView. Follow this short
# instruction to get the visualization.
# - Download, install and open [ParaView](https://www.paraview.org/download/).
# - Press `Ctrl+O` and select the generated files `solution_000032.vtu` and
# `solution_000032_celldata.vtu` from the `out` folder.
# - Press `Ctrl+O` and select the generated files `solution_000000032.vtu` and
# `solution_000000032_celldata.vtu` from the `out` folder.
# - In the upper-left corner in the Pipeline Browser window, left-click on the eye-icon near
# `solution_000032.vtu`.
# `solution_000000032.vtu`.
# - In the lower-left corner in the Properties window, change the Coloring from Solid Color to
# scalar. This already generates the visualization of the final solution.
# - Now let's add the mesh to the visualization. In the upper-left corner in the
# Pipeline Browser window, left-click on the eye-icon near `solution_000032_celldata.vtu`.
# Pipeline Browser window, left-click on the eye-icon near `solution_000000032_celldata.vtu`.
# - In the lower-left corner in the Properties window, change the Representation from Surface
# to Wireframe. Then a white grid should appear on the visualization.
# Now, if you followed the instructions exactly, you should get a similar image as shown in the
Expand Down
4 changes: 2 additions & 2 deletions docs/literate/src/files/hohqmesh_tutorial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ end #hide #md

using Trixi2Vtk
redirect_stdio(stdout=devnull, stderr=devnull) do # code that prints annoying stuff we don't want to see here #hide #md
trixi2vtk("out/solution_000180.h5", output_directory="out")
trixi2vtk("out/solution_000000180.h5", output_directory="out")
end #hide #md

# Note this step takes about 15-30 seconds as the package `Trixi2Vtk` must be precompiled and executed for the first time
Expand All @@ -64,7 +64,7 @@ end #hide #md
# visualization nodes. For instance, if we want to use 12 uniformly spaced nodes for visualization we can execute

redirect_stdio(stdout=devnull, stderr=devnull) do # code that prints annoying stuff we don't want to see here #hide #md
trixi2vtk("out/solution_000180.h5", output_directory="out", nvisnodes=12)
trixi2vtk("out/solution_000000180.h5", output_directory="out", nvisnodes=12)
end #hide #md

# By default `trixi2vtk` sets `nvisnodes` to be the same as the number of nodes specified in
Expand Down
2 changes: 1 addition & 1 deletion docs/src/restart.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ conditionals like `if restart` with a boolean variable `restart` that is user de

First we need to define from which file we want to restart, e.g.
```julia
restart_file = "restart_000021.h5"
restart_file = "restart_000000021.h5"
restart_filename = joinpath("out", restart_file)
```

Expand Down
12 changes: 6 additions & 6 deletions docs/src/visualization.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,15 +415,15 @@ julia> using Trixi2Vtk
```
To process an HDF5 file generated by Trixi.jl, execute
```julia
julia> trixi2vtk(joinpath("out", "solution_000000.h5"), output_directory="out")
julia> trixi2vtk(joinpath("out", "solution_000000000.h5"), output_directory="out")
```
This will create two unstructured VTK files in the `out` subdirectory that can
be opened with ParaView or VisIt: `solution_000000.vtu` contains the
discontinuous Galerkin solution data while `solution_000000_celldata.vtu` holds
be opened with ParaView or VisIt: `solution_000000000.vtu` contains the
discontinuous Galerkin solution data while `solution_000000000_celldata.vtu` holds
any cell-based values such as the current AMR indicator or the cell refinement
level.

!["solution_000000_scalar_mesh"](https://github.com/trixi-framework/Trixi2Vtk.jl/raw/main/docs/src/assets/solution_000000_scalar_mesh.png)
!["solution_000000000_scalar_mesh"](https://github.com/trixi-framework/Trixi2Vtk.jl/raw/main/docs/src/assets/solution_000000_scalar_mesh.png)

This allows you to generate VTK files for solution, restart and mesh files. By
default, Trixi2Vtk generates `.vtu` (unstructured VTK) files for both
Expand All @@ -440,7 +440,7 @@ publication-quality images, but increases the file size.
If you want to convert multiple solution/restart files at once, you can just supply
multiple input files as the positional arguments to `trixi2vtk`, e.g.,
```julia
julia> trixi2vtk("out/solution_000000.h5", "out/solution_000040.h5")
julia> trixi2vtk("out/solution_000000000.h5", "out/solution_000000040.h5")
```
You may also use file globbing to select a range of files based on filename patterns, e.g.,
```julia
Expand All @@ -450,7 +450,7 @@ to convert all solution files in the `out/` directory or
```julia
julia> trixi2vtk("out/restart_00[0-9]000.h5")
```
to convert every one-thousandth restart file (`out/restart_000000.h5`,
to convert every one-thousandth restart file (`out/restart_000000000.h5`,
`out/restart_001000.h5` etc.).

When multiple solution/restart files are provided, Trixi2Vtk will also generate a
Expand Down
2 changes: 1 addition & 1 deletion examples/p4est_2d_dgsem/elixir_advection_restart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using Trixi
# create a restart file

elixir_file = "elixir_advection_extended.jl"
restart_file = "restart_000021.h5"
restart_file = "restart_000000021.h5"

trixi_include(@__MODULE__, joinpath(@__DIR__, elixir_file))

Expand Down
2 changes: 1 addition & 1 deletion examples/p4est_2d_dgsem/elixir_advection_restart_amr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using Trixi
# create a restart file

elixir_file = "elixir_advection_extended.jl"
restart_file = "restart_000021.h5"
restart_file = "restart_000000021.h5"

trixi_include(@__MODULE__, joinpath(@__DIR__, elixir_file))

Expand Down
2 changes: 1 addition & 1 deletion examples/p4est_3d_dgsem/elixir_advection_restart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trixi_include(@__MODULE__, joinpath(@__DIR__, "elixir_advection_basic.jl"),
# Note: If you get a restart file from somewhere else, you need to provide
# appropriate setups in the elixir loading a restart file

restart_filename = joinpath("out", "restart_000010.h5")
restart_filename = joinpath("out", "restart_000000010.h5")
mesh = load_mesh(restart_filename)

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_convergence_test,
Expand Down
2 changes: 1 addition & 1 deletion examples/structured_2d_dgsem/elixir_advection_restart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using Trixi
# create a restart file

elixir_file = "elixir_advection_extended.jl"
restart_file = "restart_000021.h5"
restart_file = "restart_000000021.h5"

trixi_include(@__MODULE__, joinpath(@__DIR__, elixir_file))

Expand Down
2 changes: 1 addition & 1 deletion examples/structured_3d_dgsem/elixir_advection_restart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trixi_include(@__MODULE__, joinpath(@__DIR__, "elixir_advection_basic.jl"),
# Note: If you get a restart file from somewhere else, you need to provide
# appropriate setups in the elixir loading a restart file

restart_filename = joinpath("out", "restart_000010.h5")
restart_filename = joinpath("out", "restart_000000010.h5")
mesh = load_mesh(restart_filename)

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition_convergence_test,
Expand Down
2 changes: 1 addition & 1 deletion examples/tree_2d_dgsem/elixir_advection_restart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ trixi_include(@__MODULE__, joinpath(@__DIR__, "elixir_advection_extended.jl"), a
# Note: If you get a restart file from somewhere else, you need to provide
# appropriate setups in the elixir loading a restart file

restart_filename = joinpath("out", "restart_000040.h5")
restart_filename = joinpath("out", "restart_000000040.h5")
mesh = load_mesh(restart_filename)

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)
Expand Down
2 changes: 1 addition & 1 deletion examples/tree_2d_dgsem/elixir_advection_restart_amr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ trixi_include(@__MODULE__, joinpath(@__DIR__, "elixir_advection_extended.jl"), a
# Note: If you get a restart file from somewhere else, you need to provide
# appropriate setups in the elixir loading a restart file

restart_filename = joinpath("out", "restart_000040.h5")
restart_filename = joinpath("out", "restart_000000040.h5")
mesh = load_mesh(restart_filename)

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)
Expand Down
2 changes: 1 addition & 1 deletion examples/tree_3d_dgsem/elixir_advection_restart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ trixi_include(@__MODULE__, joinpath(@__DIR__, "elixir_advection_extended.jl"))
# Note: If you get a restart file from somewhere else, you need to provide
# appropriate setups in the elixir loading a restart file

restart_filename = joinpath("out", "restart_000019.h5")
restart_filename = joinpath("out", "restart_000000019.h5")
mesh = load_mesh(restart_filename)

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver)
Expand Down
2 changes: 1 addition & 1 deletion examples/unstructured_2d_dgsem/elixir_euler_restart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ trixi_include(@__MODULE__, joinpath(@__DIR__, "elixir_euler_basic.jl"))
# Note: If you get a restart file from somewhere else, you need to provide
# appropriate setups in the elixir loading a restart file

restart_filename = joinpath("out", "restart_000050.h5")
restart_filename = joinpath("out", "restart_000000050.h5")
mesh = load_mesh(restart_filename)

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver,
Expand Down
4 changes: 2 additions & 2 deletions test/test_structured_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ end
linf=[0.0015194252169410394],
rtol=5.0e-5, # Higher tolerance to make tests pass in CI (in particular with macOS)
elixir_file="elixir_advection_waving_flag.jl",
restart_file="restart_000021.h5",
restart_file="restart_000000021.h5",
# With the default `maxiters = 1` in coverage tests,
# there would be no time steps after the restart.
coverage_override=(maxiters = 100_000,))
Expand All @@ -275,7 +275,7 @@ end
l2=[7.841217436552029e-15],
linf=[1.0857981180834031e-13],
elixir_file="elixir_advection_free_stream.jl",
restart_file="restart_000036.h5",
restart_file="restart_000000036.h5",
# With the default `maxiters = 1` in coverage tests,
# there would be no time steps after the restart.
coverage_override=(maxiters = 100_000,))
Expand Down
2 changes: 1 addition & 1 deletion test/test_threaded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ end
linf=[0.0015194252169410394],
rtol=5.0e-5, # Higher tolerance to make tests pass in CI (in particular with macOS)
elixir_file="elixir_advection_waving_flag.jl",
restart_file="restart_000021.h5",
restart_file="restart_000000021.h5",
# With the default `maxiters = 1` in coverage tests,
# there would be no time steps after the restart.
coverage_override=(maxiters = 100_000,))
Expand Down
6 changes: 3 additions & 3 deletions test/test_visualization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,9 @@ end
tspan = (0.0, 3.0))

@testset "elixir_advection_amr_visualization.jl with save_plot" begin
@test isfile(joinpath(outdir, "solution_000000.png"))
@test isfile(joinpath(outdir, "solution_000020.png"))
@test isfile(joinpath(outdir, "solution_000022.png"))
@test isfile(joinpath(outdir, "solution_000000000.png"))
@test isfile(joinpath(outdir, "solution_000000020.png"))
@test isfile(joinpath(outdir, "solution_000000022.png"))
end

@testset "show" begin
Expand Down
2 changes: 1 addition & 1 deletion utils/plot.gp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set term pdfcairo color enhanced font ",8" fontscale 1.0 lw 0.5 size 14cm,10cm

# Set defaults
if (!exists("infile")) infile="solution_000000.txt"
if (!exists("infile")) infile="solution_000000000.txt"
if (!exists("eqn")) eqn="linear_scalar_advection"
ext = ".pdf"

Expand Down

0 comments on commit bea873a

Please sign in to comment.