I've noticed the HDF5File command only has options to write and read. Is there a way to overwrite?
I have the following code.
fileName = "test1.h5"
steps = 5
hdf = HDF5File(mesh.mpi_comm(), fileName, "w")#mesh defined elsewhere
hdf.write(mesh, "mesh")
for i in range(steps):
TimeStep() #function that takes a step in time
hdf.write(fr_1,"frsol",i) #frsol is the solution from the TimeStep function
I'd like to modify this code so that if I run it again it deletes what was there before and writes new solutions. That way I don't have to look up the file, delete it, and then run the code.