festim-dev / festim-dev/FESTIM
[BUG] Cannot change the mesh between 2 runs of the same 1D simulation
- Dominant language
- Python
- Stars
- 135
- Forks
- 45
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 14
Description
**Describe the bug**
Running a 1D sim, then changing the mesh, and running the sim again (after re-initialising) crashes.
**To Reproduce**
```python
import festim as F
import numpy as np
my_model = F.HydrogenTransportProblem()
my_model.mesh = F.Mesh1D(vertices=np.linspace(0, 1, 100))
mat = F.Material(D_0=1e-4, E_D=0)
vol = F.VolumeSubdomain1D(id=1, material=mat, borders=[0, 1])
left = F.SurfaceSubdomain1D(id=1, x=0)
right = F.SurfaceSubdomain1D(id=2, x=1)
my_model.subdomains = [left, right, vol]
H = F.Species("H")
my_model.species = [H]
my_model.temperature = 400
my_model.boundary_conditions = [
F.FixedConcentrationBC(subdomain=left, value=1.0, species=H),
F.FixedConcentrationBC(subdomain=right, value=1.0, species=H),
]
my_model.settings = F.Settings(atol=1e-10, rtol=1e-10, transient=False)
my_model.initialise()
my_model.run()
print(my_model.facet_meshtags)
print("First run done")
my_model.volume_meshtags = None
my_model.facet_meshtags = None
my_model.mesh = F.Mesh1D(vertices=np.linspace(0, 1, 1000))
my_model.initialise()
print(my_model.facet_meshtags)
my_model.run()
```
Not setting the meshtags to `None` produces another error, setting them to none makes the solver not converge
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.