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

ImplicitSpecies.n can be space and time dependent #886

Open
wants to merge 8 commits into
base: fenicsx
Choose a base branch
from

Conversation

RemDelaporteMathurin
Copy link
Collaborator

@RemDelaporteMathurin RemDelaporteMathurin commented Oct 2, 2024

Proposed changes

This fixes #644 by allowing the n attribute of ImplicitSpecies to be a function of x and t.

Pinging @kaelyndunnell

Usage:

density_func= lambda x: 10 - 10 * x[0]

empty = F.ImplicitSpecies(n=density_func, name="empty", others=[trapped_H])

Step function:

density_func= lambda x: ufl.conditional(ufl.gt(x[0], 0.5), 10, 0.0)

empty = F.ImplicitSpecies(n=density_func, name="empty", others=[trapped_H])

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 2, 2024 that may be closed by this pull request
@RemDelaporteMathurin RemDelaporteMathurin removed the request for review from jhdark October 2, 2024 21:23
@RemDelaporteMathurin RemDelaporteMathurin marked this pull request as draft October 2, 2024 21:23
Copy link

codecov bot commented Oct 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.84%. Comparing base (8c5a965) to head (ad0ff2a).

Additional details and impacted files
@@             Coverage Diff             @@
##           fenicsx     #886      +/-   ##
===========================================
+ Coverage    97.80%   97.84%   +0.04%     
===========================================
  Files           44       44              
  Lines         2142     2182      +40     
===========================================
+ Hits          2095     2135      +40     
  Misses          47       47              

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

@RemDelaporteMathurin RemDelaporteMathurin marked this pull request as ready for review October 3, 2024 12:49
@RemDelaporteMathurin RemDelaporteMathurin requested review from jhdark and removed request for jhdark November 3, 2024 00:42
@RemDelaporteMathurin RemDelaporteMathurin added enhancement New feature or request fenicsx Issue that is related to the fenicsx support labels Nov 5, 2024
@RemDelaporteMathurin RemDelaporteMathurin requested review from jhdark and removed request for jhdark November 9, 2024 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fenicsx Issue that is related to the fenicsx support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trap density varies in space and time
1 participant