Skip to content

Commit ab46b9c

Browse files
committed
remove kwargs_dict
1 parent 0ad9e9a commit ab46b9c

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

ext/WaterLilyReadVTKExt.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,17 @@ The time step is also updated to match the time step of the vtk file, such that
2020
Keyword arguments considered are `fname="WaterLily.pvd"` and `attrib=default_attrib()`.
2121
"""
2222
function load!(a::AbstractSimulation, ::Val{:pvd}; kwargs...)
23-
kwargs_dict = Dict(kwargs)
24-
fname = get(kwargs_dict, :fname, "WaterLily.pvd")
25-
attrib = get(kwargs_dict, :attrib, default_attrib())
23+
fname = get(Dict(kwargs), :fname, "WaterLily.pvd")
24+
attrib = get(Dict(kwargs), :attrib, default_attrib())
2625
vtk = VTKFile(PVDFile(fname).vtk_filenames[end])
2726
extent = filter(!iszero,ReadVTK.get_whole_extent(vtk)[2:2:end]);
2827
# check dimensions match
2928
text = "The dimensions of the simulation do not match the dimensions of the vtk file."
3029
@assert extent.+1 == collect(size(a.flow.p)) text
3130
# fill the arrays for pressure and velocity
3231
point_data = ReadVTK.get_point_data(vtk)
33-
pressure = get(kwargs_dict, :pressure, "Pressure")
34-
velocity = get(kwargs_dict, :velocity, "Velocity")
32+
pressure = get(Dict(kwargs), :pressure, "Pressure")
33+
velocity = get(Dict(kwargs), :velocity, "Velocity")
3534
copyto!(a.flow.p, WaterLily.squeeze(Array(get_data_reshaped(point_data[pressure]))));
3635
copyto!(a.flow.u, WaterLily.squeeze(components_last(Array(get_data_reshaped(point_data[velocity])))));
3736
# reset time to work with the new time step

0 commit comments

Comments
 (0)