Skip to content

Commit

Permalink
skip empty system (#606)
Browse files Browse the repository at this point in the history
Co-authored-by: Niklas Neher <73897120+LasNikas@users.noreply.github.com>
  • Loading branch information
svchb and LasNikas authored Sep 19, 2024
1 parent a27700b commit bf951ba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/visualization/write2vtk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ function trixi2vtk(v_, u_, t, system_, periodic_box; output_directory="out", pre
custom_quantities...)
mkpath(output_directory)

# Skip empty systems
if nparticles(system_) == 0
return
end

# Transfer to CPU if data is on the GPU. Do nothing if already on CPU.
v, u, system = transfer2cpu(v_, u_, system_)

Expand Down

0 comments on commit bf951ba

Please sign in to comment.