-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fix timestep bug #922
Fix timestep bug #922
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your test is wrong as you have the wrong expected value
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## fenicsx #922 +/- ##
========================================
Coverage 97.49% 97.49%
========================================
Files 44 44
Lines 2193 2193
========================================
Hits 2138 2138
Misses 55 55 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! CI is passing.
It's failing on the nightly build of FEniCS but we'll wait a bit to see if that gets resolved.
Could you format your code please?
It’s failing because of the check added by @garth-wells in https://github.com/FEniCS/dolfinx/pull/3502/files |
a3698c1
to
d3c07ea
Compare
effcbac
into
festim-dev:fenicsx
Mixed elements do not have a well-defined value shape, whereas 'base' sub-elements of a mixed element do. An element should be what it is. If it's mixed it should be mixed, if it's not mixed it should not be mixed. |
@garth-wells |
@garth-wells I agree with @jorgensd here. For FESTIM, not being able to define this special case would mean we have to rewrite many parts of the code since mixed elements and elements behave differently on many things (enforcing dirichlet BCs, post-processing, etc.). I think this is something we had to do in FESTIM1 and we were super happy to realise we could do |
@RemDelaporteMathurin can you share an example of where you rely on a single (base) element to behave like a mixed element? |
let’s say you want to support having multiple diffusion equations co-located in space (but with different function spaces. Then you would have a mixed element ([el_0,el_1]). In other parts of the domain (with submesh involved, you might only have a single species. One doesn’t want to treat those differently. |
@garth-wells we do not need a single (base) element to behave like a mixed element per se. It would just simplify the logic for us. For example, in the FESTIM/src/festim/hydrogen_transport_problem.py Lines 485 to 511 in effcbac
We have this check This is how we do it in the FESTIM/src/festim/hydrogen_transport_problem.py Lines 990 to 1021 in effcbac
Here we can have mixed element with only one element and we don't have to have these checks everywhere. This is an example for assigning functions to species but we have other places in the code where this happens, for instance assigning BCs: FESTIM/src/festim/hydrogen_transport_problem.py Lines 537 to 586 in effcbac
Assigning ICs: FESTIM/src/festim/hydrogen_transport_problem.py Lines 610 to 642 in effcbac
Having everything as mixed elements would greatly simplify the logic on our side. |
Proposed changes
Fixes bug in timestep implementation in accordance with issue #920.
Types of changes
What types of changes does your code introduce to FESTIM?
Checklist
Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...