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

Update time dependent bcs #619

Merged
merged 6 commits into from
Nov 7, 2023

Conversation

jhdark
Copy link
Collaborator

@jhdark jhdark commented Oct 26, 2023

Proposed changes

Currently, all boundary conditions are updated at each time step to ensure the value is updated in case it's dependent on time. With this change, only boundary conditions with values dependent on time will be updated at each time step. This should also improve performance.

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)

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...

@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (b0c2666) 98.46% compared to head (a2eb1b1) 97.96%.

❗ Current head a2eb1b1 differs from pull request most recent head 1a15254. Consider uploading reports for the commit 1a15254 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           fenicsx     #619      +/-   ##
===========================================
- Coverage    98.46%   97.96%   -0.50%     
===========================================
  Files           18       18              
  Lines          715      738      +23     
===========================================
+ Hits           704      723      +19     
- Misses          11       15       +4     
Files Coverage Δ
festim/hydrogen_transport_problem.py 99.27% <100.00%> (+<0.01%) ⬆️
festim/boundary_conditions/dirichlet_bc.py 94.44% <80.00%> (-5.56%) ⬇️

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

@jhdark jhdark marked this pull request as ready for review October 26, 2023 18:00
@RemDelaporteMathurin
Copy link
Collaborator

RemDelaporteMathurin commented Oct 26, 2023

I see one major caveat is that as soon as we have time dependent temperature, this will be broken.
For now, it may not be very performant fully optimised (and still it's very similar to pure fenics scripts...) but it works even with time dependent T.

We expect to have time dependent temperature soon, so I would hold onto this PR for now and wait until we have it implemented and then we can come back to it to have a more complete implementation.

@RemDelaporteMathurin
Copy link
Collaborator

Let's wait until #620 is merged before looking at this

@RemDelaporteMathurin RemDelaporteMathurin added the fenicsx Issue that is related to the fenicsx support label Oct 31, 2023
Copy link
Collaborator

@RemDelaporteMathurin RemDelaporteMathurin left a comment

Choose a reason for hiding this comment

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

This looks good to me! I know it's hard to test that the bc is updated only once.
Although we could potentially do it by timing the operation, but maybe a manual test is enough for now.

Have you tested it manually by having print statements?

@jhdark
Copy link
Collaborator Author

jhdark commented Nov 7, 2023

This looks good to me! I know it's hard to test that the bc is updated only once. Although we could potentially do it by timing the operation, but maybe a manual test is enough for now.

Have you tested it manually by having print statements?

Yep, I'll merge it then

@jhdark jhdark merged commit a831a31 into festim-dev:fenicsx Nov 7, 2023
5 checks passed
@jhdark jhdark deleted the update_time_dependent_bcs branch November 7, 2023 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fenicsx Issue that is related to the fenicsx support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants