-
Notifications
You must be signed in to change notification settings - Fork 32
Boundary condition handling #1044
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
Boundary condition handling #1044
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## fenicsx #1044 +/- ##
===========================================
- Coverage 94.87% 94.87% -0.01%
===========================================
Files 44 44
Lines 3085 3100 +15
===========================================
+ Hits 2927 2941 +14
- Misses 158 159 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
RemDelaporteMathurin
left a comment
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.
easy enough fix
| @property | ||
| def all_bcs(self): | ||
| """Returns all boundary conditions, including fluxes from surface reactions""" | ||
| all_boundary_conditions = [] | ||
| for bc in self.boundary_conditions: | ||
| if isinstance(bc, boundary_conditions.SurfaceReactionBC): | ||
| all_boundary_conditions.extend(bc.flux_bcs) | ||
| else: | ||
| all_boundary_conditions.append(bc) | ||
| return all_boundary_conditions |
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.
Reflecting on it now, the problem I have with having this as a property is that now the problem class has 2 attributes that are similar: self.boundary_conditions and self.all_bcs...
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.
Should we make all_bcs hidden instead? just _all_bcs?
| spe.test_function = sub_test_functions[idx] | ||
|
|
||
| def define_boundary_conditions(self): | ||
| # @jhdark this all_bcs could be a property |
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.
haha
19a899f
into
festim-dev:fenicsx
Proposed changes
Fix for #1043
With these changes, a new property is added to the
HydrogenTransportProblemclass:all_bcs. This was something that was done during thedefine_boundary_conditionsconditions but now has been removed.Additionally, to fix the bug in #1043, a new
define_boundary_conditionshas been added toHydrogenTransportProblemDiscontinuousas thecreate_value_fenicsfunction was failing previously, as the solution was never passed to the species. This is more of a light fix in that sense, and the class could do with an overhaul to handle that better. What do you think @RemDelaporteMathurin ?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...