Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Simulation.exports should always be a list #833

Closed
RemDelaporteMathurin opened this issue Jul 30, 2024 · 0 comments · Fixed by #836
Closed

[BUG] Simulation.exports should always be a list #833

RemDelaporteMathurin opened this issue Jul 30, 2024 · 0 comments · Fixed by #836
Labels
bug Something isn't working
Milestone

Comments

@RemDelaporteMathurin
Copy link
Collaborator

Describe the bug
FESTIM expects a list for the exports attribute of Simulation.

However, no error is raised when users give something else.

To Reproduce

Run on main:

import numpy as np
import festim as F

my_model = F.Simulation()
my_model.mesh = F.MeshFromVertices(vertices=np.linspace(0, 1, num=100))
my_model.materials = F.Material(id=1, D_0=1, E_D=0, Q=2)
my_model.T = F.Temperature(value=700 + 1000 * F.x)
my_model.settings = F.Settings(
    absolute_tolerance=1e-10, relative_tolerance=1e-10, transient=False, soret=True
)

flux_left = F.SurfaceFlux(field=0, surface=1)
flux_right = F.SurfaceFlux(field=0, surface=2)
my_model.exports = F.DerivedQuantities([flux_left, flux_right])

my_model.initialise()
my_model.run()

print(flux_left.data)
print(flux_right.data)

Produces an empty list for data of derived quantities (they are just ignored).

Defining initial values
Defining variational problem
Defining source terms
Defining boundary conditions
Solving steady state problem...
Solved problem in 0.00 s
[]
[]

Expected behavior
Either the exports setter should convert the user input to a list, or an error should be raised

@RemDelaporteMathurin RemDelaporteMathurin added the bug Something isn't working label Jul 30, 2024
@RemDelaporteMathurin RemDelaporteMathurin added this to the 1.3.1 milestone Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant