Skip to content

Refactor create_value_fenics for source and fluxes#750

Merged
RemDelaporteMathurin merged 8 commits into
festim-dev:fenicsxfrom
RemDelaporteMathurin:robin-bc-particle-flux
Apr 29, 2024
Merged

Refactor create_value_fenics for source and fluxes#750
RemDelaporteMathurin merged 8 commits into
festim-dev:fenicsxfrom
RemDelaporteMathurin:robin-bc-particle-flux

Conversation

@RemDelaporteMathurin
Copy link
Copy Markdown
Collaborator

Proposed changes

Based on a discussion I had with @jhdark we realised that we only needed to interpolate values onto a Function for dirichletBCs (and maybe InitialConditions). For fluxes and sources, since those are added into the formulation we can just put space-time dependent expressions as a ufl Expression, moreover it doesn't need to be updated in this case.

This is a first step towards #749

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 added the fenicsx Issue that is related to the fenicsx support label Apr 10, 2024
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.42%. Comparing base (aac14ac) to head (6e1cf21).
Report is 10 commits behind head on fenicsx.

Additional details and impacted files
@@             Coverage Diff             @@
##           fenicsx     #750      +/-   ##
===========================================
- Coverage    98.49%   98.42%   -0.08%     
===========================================
  Files           28       28              
  Lines         1532     1519      -13     
===========================================
- Hits          1509     1495      -14     
- Misses          23       24       +1     

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

@jhdark jhdark changed the title Refactore create_value_fenics for source and fluxes Refactor create_value_fenics for source and fluxes Apr 27, 2024
Comment thread festim/boundary_conditions/flux_bc.py Outdated
Copy link
Copy Markdown
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.

We're going to be looking into how to replace all of these create_value_fenics into a simpler global function, but at least this cleans things up for now and theoretically should give us better errors since we're no longer interpolating onto further functions. It might be worth retesting some of the MMS tests to see if we can lower the L2 error threshold as a results of this.

RemDelaporteMathurin and others added 2 commits April 29, 2024 08:45
Co-authored-by: James Dark <65899899+jhdark@users.noreply.github.com>
@RemDelaporteMathurin RemDelaporteMathurin merged commit f57b263 into festim-dev:fenicsx Apr 29, 2024
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