Skip to content

Commit

Permalink
Merge branch 'main' into solver_dep_storage
Browse files Browse the repository at this point in the history
  • Loading branch information
kaipartmann authored Oct 19, 2024
2 parents 6138349 + 80b7910 commit 32efd11
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/auxiliary/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ end
end

@inline function _get_filename(vtk_filebase::String, ::Symbol, n::Int)
return @sprintf("%s_%06d", vtk_filebase, n) #TODO: remove trailing zeros
return @sprintf("%s_%d", vtk_filebase, n)
end

@inline function _get_filename(vtk_filebase::Dict{Symbol,String}, body_name::Symbol, n::Int)
return @sprintf("%s_%06d", vtk_filebase[body_name], n) #TODO: remove trailing zeros
return @sprintf("%s_%d", vtk_filebase[body_name], n)
end

function export_fields!(vtk, chunk, fields::Vector{Symbol})
Expand Down
12 changes: 6 additions & 6 deletions test/auxiliary/test_io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ end
n_chunks = 1
Peridynamics.export_results(dh, options, chunk_id, n, t)

pvtu_file_ref = joinpath(temp_root, "vtk", "timestep_000000.pvtu")
pvtu_file_ref = joinpath(temp_root, "vtk", "timestep_0.pvtu")
@test isfile(pvtu_file_ref)
pvtu_file_n = joinpath(temp_root, "vtk", "timestep_000001.pvtu")
pvtu_file_n = joinpath(temp_root, "vtk", "timestep_1.pvtu")
@test isfile(pvtu_file_n)

r0 = read_vtk(pvtu_file_ref)
Expand Down Expand Up @@ -327,13 +327,13 @@ end
Peridynamics.export_results(dh_a, options, chunk_id, n, t)
Peridynamics.export_results(dh_b, options, chunk_id, n, t)

pvtu_file_a_ref = joinpath(temp_root, "vtk", "a_timestep_000000.pvtu")
pvtu_file_a_ref = joinpath(temp_root, "vtk", "a_timestep_0.pvtu")
@test isfile(pvtu_file_a_ref)
pvtu_file_a_n = joinpath(temp_root, "vtk", "a_timestep_000001.pvtu")
pvtu_file_a_n = joinpath(temp_root, "vtk", "a_timestep_1.pvtu")
@test isfile(pvtu_file_a_n)
pvtu_file_b_ref = joinpath(temp_root, "vtk", "b_timestep_000000.pvtu")
pvtu_file_b_ref = joinpath(temp_root, "vtk", "b_timestep_0.pvtu")
@test isfile(pvtu_file_b_ref)
pvtu_file_b_n = joinpath(temp_root, "vtk", "b_timestep_000001.pvtu")
pvtu_file_b_n = joinpath(temp_root, "vtk", "b_timestep_1.pvtu")
@test isfile(pvtu_file_b_n)

r_a = read_vtk(pvtu_file_a_ref)
Expand Down

0 comments on commit 32efd11

Please sign in to comment.