I think this is happening because there’s no node in the mesh at the point x=0.45, just need to increase the number of divisions by a further one and you should have a node at that location:
@jairrs this is the explanation of what is going on:
Since we sometimes have discontinuous mobile concentration profiles (when we have dissimilar materials) then we need to project the field on a discontinuous functionspace to capture the discontinuities. This is done by using DG (Discontinuous Galerkin) elements.
A single DG element has the same number of degrees of freedom than a CG element but for CG, the dofs are shared on the edged (see below).
This is why you see duplicated x coordinates with slightly different concentration values.
Several things you can do to get around this:
sort the values according to x (this could potentially be done in FESTIM…)
remove duplicated nodes with numpy unique np.unique or something similar.
I believe FESTIM should handle this. I don’t see any benefit to letting the user choose which concentration they want to use, and having both is confusing.
Yes, these were just workarounds while we implement a proper fix.
First up these duplicates should be very similar to like the 10th digit! So just picking one or the other should not change the results whatsoever.
The thing is you do need to have both since when you have an interface, you want to know which is the concentration on both sides of the interface.
I guess the internal FESTIM process should be:
if there is only one material (or no conservation of chemical potential) then project to CG instead of DG
If there are interfaces, since TXTExport is only used in 1D, project to DG but only keep the duplicates where there are interfaces (based on the materials border argument)