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

Cylindrical and spherical versions of SurfaceFlux #689

Merged

Conversation

RemDelaporteMathurin
Copy link
Collaborator

@RemDelaporteMathurin RemDelaporteMathurin commented Jan 24, 2024

Proposed changes

This PR implements the SurfaceFlux in cylindrical and spherical coordinates: SurfaceFluxCylindrical and SurfaceFluxSpherical as well as a little bit of refactoring.

Usage:

full_coverage_cylindrical_surface_flux = F.SurfaceFluxCylindrical(field="solute", surface=1)
half_coverage_cylindrical_surface_flux = F.SurfaceFluxCylindrical(field="solute", surface=1, azimuthal_range=(0, np,pi))

Similarly for spherical meshes:

full_coverage_spherical_surface_flux = F.SurfaceFluxSpherical(field="solute", surface=1)
quarter_coverage_spherical_surface_flux = F.SurfaceFluxSpherical(field="solute", surface=1, azimuthal_range=(0, np,pi), polar_range=(0, np.pi))

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
Copy link
Collaborator Author

@jhdark let me know what you think and I'll complete with documentation

@RemDelaporteMathurin RemDelaporteMathurin added the enhancement New feature or request label Jan 24, 2024
Copy link

codecov bot commented Jan 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.48%. Comparing base (91e59ac) to head (7d841f0).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #689      +/-   ##
==========================================
+ Coverage   99.47%   99.48%   +0.01%     
==========================================
  Files          58       58              
  Lines        2290     2349      +59     
==========================================
+ Hits         2278     2337      +59     
  Misses         12       12              

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

@RemDelaporteMathurin RemDelaporteMathurin requested review from jhdark and removed request for jhdark March 3, 2024 01:38
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.

This looks great to me, also like the fact that the units of the results are given in the doc strings, think this is smth we could implement in other export classes (accounting for differences in different dimensions).

However, just some small coverage tests that need to be added.

Then its good to go!

@RemDelaporteMathurin
Copy link
Collaborator Author

the units of the results are given in the doc strings, think this is smth we could implement in other export classes (accounting for differences in different dimensions)

Maybe what we should do is add the units in the docstrings and also in the title of the csv column based on the dimension of the mesh

@jhdark
Copy link
Collaborator

jhdark commented Mar 19, 2024

I like the idea, although this could be a big change, we can add in another PR. I can make a new issue

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.

LGTM

@RemDelaporteMathurin RemDelaporteMathurin merged commit 583572d into festim-dev:main Mar 25, 2024
5 checks passed
@RemDelaporteMathurin RemDelaporteMathurin deleted the cylindrical_flux branch March 25, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants