-
Notifications
You must be signed in to change notification settings - Fork 10
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
Added function to handle None inputs in bcs #165
Added function to handle None inputs in bcs #165
Conversation
Is this a fix for #149 ? |
Yes, it's a fix for #149. When declaring boundary conditions, the user should put in None if that corresponding component is unconstrained. Also, the fix does not break the current examples (using sympy.oo for no constraints), but might be good idea if I'm allowed to change them soon. |
|
||
import numpy as np | ||
|
||
if hasattr(fn, "__len__"): # BC input is iterable (has __len__ attribute) |
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.
Instead of python "duck" typing, let's just assume fn is list/tuple of length u.dim
for now?
Checking - are you happy with this, @julesghub ? We should not leave the branch hanging forever. |
Good point @lmoresi. |
All conditions are now turned into a list before conversion. Modifying test to test the conversion code.
@jcgraciosa, please review my changes and we can discuss further if needed. |
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 am fine with the changes.
Thanks for improving on the original version.
Added a method to SolverBaseClass to convert BCs inputted by the user as None into sympy.oo for subsequent use by the solver. Also added some type checks and handlers and it should not break the current example scripts (based on some tests).