Skip to content

Commit 699a032

Browse files
author
LasNikas
committed
change to nothing again
1 parent b228e8e commit 699a032

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/callbacks/solution_saving.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ To ignore a custom quantity for a specific system, return `nothing`.
2626
- `overwrite=false`: If `true`, overwrite the previous set of VTK files instead of
2727
creating a new set of files each interval.
2828
Useful for memory efficiency in large simulations where only
29-
the final result matters. The difference to simply setting
29+
the final results matters. The difference to simply setting
3030
`save_final_solution=true` is that this provides regular checkpoint
3131
backups at each save interval.
3232
If `false` (default), files are not overwritten and an iteration
@@ -193,7 +193,7 @@ function (solution_callback::SolutionSavingCallback)(integrator)
193193
end
194194

195195
trixi2vtk(dvdu_ode, vu_ode, semi, integrator.t;
196-
iter=(overwrite ? -1 : iter), output_directory, prefix,
196+
iter=(overwrite ? nothing : iter), output_directory, prefix,
197197
git_hash=git_hash[], max_coordinates, custom_quantities...)
198198
end
199199

src/io/write_vtk.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function system_names(systems)
99
end
1010

1111
"""
12-
trixi2vtk(vu_ode, semi, t; iter=-1, output_directory="out", prefix="",
12+
trixi2vtk(vu_ode, semi, t; iter=nothing, output_directory="out", prefix="",
1313
max_coordinates=Inf, custom_quantities...)
1414
1515
Convert Trixi simulation data to VTK format.
@@ -21,9 +21,9 @@ Convert Trixi simulation data to VTK format.
2121
- `t`: Current time of the simulation.
2222
2323
# Keywords
24-
- `iter=-1`: Iteration number when multiple iterations are to be stored in
24+
- `iter=nothing`: Iteration number when multiple iterations are to be stored in
2525
separate files. This number is just appended to the filename.
26-
If `-1`, no iteration number is appended (default).
26+
If `nothing`, no iteration number is appended (default).
2727
- `output_directory="out"`: Output directory path.
2828
- `prefix=""`: Prefix for output files.
2929
- `max_coordinates=Inf` The coordinates of particles will be clipped if their absolute
@@ -48,7 +48,7 @@ trixi2vtk(sol.u[end], semi, 0.0, iter=1, my_custom_quantity=kinetic_energy)
4848
4949
```
5050
"""
51-
function trixi2vtk(vu_ode, semi, t; iter=-1, output_directory="out",
51+
function trixi2vtk(vu_ode, semi, t; iter=nothing, output_directory="out",
5252
prefix="", git_hash=compute_git_hash(), max_coordinates=Inf,
5353
custom_quantities...)
5454

@@ -59,7 +59,7 @@ function trixi2vtk(vu_ode, semi, t; iter=-1, output_directory="out",
5959
prefix, git_hash, max_coordinates, custom_quantities...)
6060
end
6161

62-
function trixi2vtk(dvdu_ode, vu_ode, semi, t; iter=-1, output_directory="out",
62+
function trixi2vtk(dvdu_ode, vu_ode, semi, t; iter=nothing, output_directory="out",
6363
prefix="", git_hash=compute_git_hash(), max_coordinates=Inf,
6464
custom_quantities...)
6565
(; systems) = semi
@@ -86,7 +86,7 @@ end
8686

8787
# Convert data for a single TrixiParticle system to VTK format
8888
function trixi2vtk(system_, dvdu_ode_, vu_ode_, semi_, t, periodic_box;
89-
output_directory="out", prefix="", iter=-1,
89+
output_directory="out", prefix="", iter=nothing,
9090
system_name=vtkname(system_), max_coordinates=Inf,
9191
git_hash=compute_git_hash(), custom_quantities...)
9292
mkpath(output_directory)
@@ -104,7 +104,7 @@ function trixi2vtk(system_, dvdu_ode_, vu_ode_, semi_, t, periodic_box;
104104
v = wrap_v(v_ode, system, semi)
105105
u = wrap_u(u_ode, system, semi)
106106

107-
overwrite = iter == -1
107+
overwrite = isnothing(iter)
108108

109109
file_ = joinpath(output_directory,
110110
add_underscore_to_optional_prefix(prefix) * "$system_name")

0 commit comments

Comments
 (0)