-
Notifications
You must be signed in to change notification settings - Fork 24
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
Trap density xdmf fix #564
Trap density xdmf fix #564
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #564 +/- ##
=======================================
Coverage 98.82% 98.82%
=======================================
Files 55 55
Lines 2038 2045 +7
=======================================
+ Hits 2014 2021 +7
Misses 24 24
☔ View full report in Codecov by Sentry. |
festim/exports/trap_density_xdmf.py
Outdated
@@ -16,13 +16,27 @@ def __init__(self, trap, **kwargs) -> None: | |||
|
|||
self.trap = trap | |||
|
|||
def write(self, t): | |||
def write(self, t, dx, log_level): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't have it as an argument.
Imagine if we want to have this everywhere then you'd have to pass log_level literally everywhere.
Maybe let's forget about this for this PR.
What may be a solution is to have log_level an attribute of FESTIM.
Instead of:
my_model.log_level = 20
we'd have
import festim
festim.log_level = 20
That way, log_level can be accessed from anywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a nice solution, i'll remove it from the function
festim/exports/trap_density_xdmf.py
Outdated
else: | ||
F -= f.inner(self.trap.density[0], v) * dx(mat.id) | ||
|
||
if log_level < 40: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
following the above comments, the use for log-level here would be
if festim.log_level < 40:
Co-authored-by: Rémi Delaporte-Mathurin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me thanks James!
Proposed changes
fix for issue #563
This would allow users to export the TrapDensityXDMF in a multi-material system
Types of changes
What types of changes does your code introduce to FESTIM?
Checklist
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...