Skip to content

Initial Conditions#640

Merged
jhdark merged 25 commits into
festim-dev:fenicsxfrom
jhdark:initial_conditions
Dec 11, 2023
Merged

Initial Conditions#640
jhdark merged 25 commits into
festim-dev:fenicsxfrom
jhdark:initial_conditions

Conversation

@jhdark
Copy link
Copy Markdown
Collaborator

@jhdark jhdark commented Nov 14, 2023

Proposed changes

Initial conditions! With this change, users will be able to define an initial condition for their simulation.

The value of the initial condition can be a float, int or callable. Although the callable function cannot be a function of time.

Usage:

vol_subdomain = F.VolumeSubdomain1D(1, borders=[0, 1], material=dummy_mat)
my_species = F.Species("A")

init_cond = F.InitialCondition(
        value=1.0, species=my_species
    )

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
Copy Markdown

codecov Bot commented Nov 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4383e52) 99.02% compared to head (a1b3f81) 99.06%.

Additional details and impacted files
@@             Coverage Diff             @@
##           fenicsx     #640      +/-   ##
===========================================
+ Coverage    99.02%   99.06%   +0.03%     
===========================================
  Files           23       24       +1     
  Lines         1030     1070      +40     
===========================================
+ Hits          1020     1060      +40     
  Misses          10       10              

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

Comment thread festim/initial_condition.py Outdated
@jhdark jhdark marked this pull request as ready for review November 20, 2023 23:11
Copy link
Copy Markdown
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.

First round of comments

Comment thread festim/hydrogen_transport_problem.py
Comment thread festim/initial_condition.py Outdated
Comment thread festim/initial_condition.py Outdated
Comment thread festim/initial_condition.py
Comment thread test/test_initial_condition.py Outdated
Comment thread festim/initial_condition.py Outdated
Comment thread festim/initial_condition.py Outdated
Comment thread festim/initial_condition.py Outdated
Comment thread festim/initial_condition.py Outdated
Comment thread festim/hydrogen_transport_problem.py Outdated
@RemDelaporteMathurin RemDelaporteMathurin added the fenicsx Issue that is related to the fenicsx support label Nov 21, 2023
Comment thread festim/hydrogen_transport_problem.py Outdated
Comment thread festim/initial_condition.py Outdated
Comment thread festim/initial_condition.py Outdated
Comment thread test/test_h_transport_problem.py Outdated
@RemDelaporteMathurin
Copy link
Copy Markdown
Collaborator

I don't see where it uses InitialCondition.subdomain are you sure that initial values in subdomains is implemented?

@jhdark
Copy link
Copy Markdown
Collaborator Author

jhdark commented Dec 6, 2023

I don't see where it uses InitialCondition.subdomain are you sure that initial values in subdomains is implemented?

Its not supported for the moment, its just in the PR description, I can edit that

Copy link
Copy Markdown
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.

Just a couple of final remarks then i'm happy to merge this!

Comment thread festim/hydrogen_transport_problem.py Outdated
Comment thread test/test_h_transport_problem.py Outdated
Comment thread test/test_h_transport_problem.py Outdated
Comment thread test/test_h_transport_problem.py
jhdark and others added 3 commits December 8, 2023 13:08
Co-authored-by: Rémi Delaporte-Mathurin <40028739+RemDelaporteMathurin@users.noreply.github.com>
@jhdark jhdark merged commit 2bbdf4e into festim-dev:fenicsx Dec 11, 2023
@jhdark jhdark deleted the initial_conditions branch December 11, 2023 13:58
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

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants