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

Linear solver for post-process chemical potential #579

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

RemDelaporteMathurin
Copy link
Collaborator

Proposed changes

Sometimes, when using conservation of chemical potential, the non-linear solver in the post-processing step (from theta to c) doesn't converge.
To fix this, this PR replaces the Non linear solver in the post-processing step for the chemical potential by a linear solver.

Couldn't write a test for this as I couldn't reproduce a case where the solver diverges.

Types of changes

What types of changes does your code introduce to FESTIM?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code refactoring
  • Documentation Update (if none of the other choices apply)
  • New tests

Checklist

  • Black formatted
  • Unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

@RemDelaporteMathurin RemDelaporteMathurin linked an issue Oct 4, 2023 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (e751955) 98.84% compared to head (62e4d72) 98.84%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #579      +/-   ##
==========================================
- Coverage   98.84%   98.84%   -0.01%     
==========================================
  Files          56       56              
  Lines        2073     2069       -4     
==========================================
- Hits         2049     2045       -4     
  Misses         24       24              
Files Coverage Δ
festim/concentration/theta.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@RemDelaporteMathurin
Copy link
Collaborator Author

@jhdark do you mind reviewing this?

Copy link
Collaborator

@jhdark jhdark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, much cleaner too, and more inline comments is helpful

@RemDelaporteMathurin RemDelaporteMathurin merged commit 2847817 into main Oct 4, 2023
3 checks passed
@RemDelaporteMathurin RemDelaporteMathurin deleted the linear-solver-for-chemical-potential branch October 4, 2023 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linear solver for c = theta * S
2 participants