Value class to allow species-dependent inputs#1182
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1182 +/- ##
==========================================
+ Coverage 95.08% 95.16% +0.08%
==========================================
Files 53 53
Lines 3862 3888 +26
==========================================
+ Hits 3672 3700 +28
+ Misses 190 188 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
- Updated ParticleFluxBC and ParticleSource to support species-dependent values. - Introduced error handling for unsupported species-dependent values in HydrogenTransportProblemDiscontinuousChangeVar. - Added tests to validate behavior of species-dependent sources and fluxes.
jhdark
marked this pull request as ready for review
July 17, 2026 20:30
RemDelaporteMathurin
left a comment
Collaborator
There was a problem hiding this comment.
ship it! just a few comments worth looking at
| for source in self.sources: | ||
| # create value_fenics for all F.ParticleSource objects | ||
| if isinstance(source, _source.ParticleSource): | ||
| for subdomain in source.species.subdomains: |
Collaborator
There was a problem hiding this comment.
why has this loop disappeared?
| assert L2_error < 1e-2 | ||
|
|
||
|
|
||
| def test_species_dependent_source_MMS_steady_state(): |
Collaborator
There was a problem hiding this comment.
we should start looking at the convergence rates instead of the isolated error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary
Let's FESTIM input values depend on the concentration of other species. A callable value on ParticleSource and ParticleFluxBC can now take a species' concentration as an argument, alongside the existing space (x), time (t), and temperature (T).
The dependency is declared with species_dependent_value, a dict mapping each species-argument name in the callable to a festim.Species. FESTIM binds those arguments to the live species solution, so the term is evaluated — and differentiated in the Newton solve — against the coupled concentration field.
Related Issues
Motivation and Context
Type of Change
Testing
pytest)Code Quality Checklist
ruff format .)ruff check .)Documentation
Breaking Changes
Screenshots/Examples
Additional Notes