Open RemDelaporteMathurin opened 5 months ago
Describe the bug When running the same simulation twice with derived quantities, their t and data attributes isn't reset to an empty list but instead values are just appended.
t
data
To Reproduce Run the following on fenicsx
fenicsx
import festim as F my_model = F.HydrogenTransportProblem() my_model.mesh = F.Mesh1D([0, 1, 2, 3, 4]) tungsten = F.Material(D_0=1, E_D=0) my_subdomain = F.VolumeSubdomain1D(id=1, borders=[0, 4], material=tungsten) left_surface = F.SurfaceSubdomain1D(id=1, x=0) my_model.subdomains = [my_subdomain, left_surface] mobile_H = F.Species("H") my_model.species = [mobile_H] my_model.temperature = 400 left_flux = F.SurfaceFlux(field=mobile_H, surface=left_surface) my_model.exports = [left_flux] my_model.settings = F.Settings( atol=1e-15, rtol=1e-15, transient=False, ) for i in range(3): my_model.initialise() my_model.run() print(left_flux.data)
Produces:
[0.0] [0.0, 0.0] [0.0, 0.0, 0.0]
Expected behavior left_flux.data should be of length 1 everytime
I noticed this bug also occurs on the main branch!
Describe the bug When running the same simulation twice with derived quantities, their
t
anddata
attributes isn't reset to an empty list but instead values are just appended.To Reproduce Run the following on
fenicsx
Produces:
Expected behavior left_flux.data should be of length 1 everytime