Skip to content

Commit

Permalink
fix output of timesteps
Browse files Browse the repository at this point in the history
  • Loading branch information
lijas committed Oct 27, 2023
1 parent dd46c8b commit 315e7c4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
13 changes: 7 additions & 6 deletions src/outputs/output.jl
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,15 @@ function create_vtk_output(vtkoutput::VTKOutput{FiveVTKOutput}, state::StateVari
dh = globaldata.dh
parts = globaldata.parts

vtmfile = vtk_multiblock(filename)
vtmfile = vtk_multiblock(filename*"_step$(state.step)")

#Ouput to vtk_grid
for (partid, part) in enumerate(parts)
#Vtk grid
vtkfile = get_part_vtk_grid(part)
vtkfile = get_part_vtk_grid("partid$(partid)_step$(state.step)", part)
vtkfile === nothing && continue

multiblock_add_block(vtmfile, vtkfile, "partid$partid")
multiblock_add_block(vtmfile, vtkfile)

#Export Fields, such :u, etc
for field in get_fields(part)
Expand All @@ -207,9 +207,11 @@ function create_vtk_output(vtkoutput::VTKOutput{FiveVTKOutput}, state::StateVari
end

end

#collection_add_timestep(output.pvd, vtmfile, state.t)
vtk_save(vtmfile)
vtkoutput.pvd[state.t] = vtmfile

end


Expand All @@ -222,8 +224,7 @@ function export!(output::Output, state::StateVariables, globaldata; force=false)
filename = output.runname * string(state.step)

if output.export_vtk
vtkfile = create_vtk_output(output.vtkoutput, state, globaldata, filename=filename)
vtk_save(vtkfile)
create_vtk_output(output.vtkoutput, state, globaldata, filename=filename)
end

if output.export_rawdata
Expand Down
4 changes: 2 additions & 2 deletions src/parts/fepart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,11 @@ function assemble_massmatrix!(dh::Ferrite.AbstractDofHandler, part::Part, state:

end

function get_part_vtk_grid(part::Part)
function get_part_vtk_grid(filename, part::Part)
if part.geometry === nothing
return nothing
end
return vtk_grid("mypart$(minimum(part.cellset))", part.geometry)
return vtk_grid(filename, part.geometry)
end

function eval_part_field_data(part::Part, dh, state, field_name::Symbol)
Expand Down
5 changes: 2 additions & 3 deletions src/parts/igapart.jl
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ end



function Five.get_part_vtk_grid(part::IGAPart)
function Five.get_part_vtk_grid(filename, part::IGAPart)
if part.geometry === nothing
return nothing
end
return vtk_grid("mypart$(minimum(part.cellset))", part.geometry)
return vtk_grid(filename, part.geometry)
end

function Five.eval_part_field_data(part::IGAPart, dh, state, field_name::Symbol)
Expand Down Expand Up @@ -520,7 +520,6 @@ end




#
struct IGASubGridGeometry
grid::Ferrite.AbstractGrid
Expand Down

0 comments on commit 315e7c4

Please sign in to comment.