-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
Make topology const in locate_dofs_topological
#2885
Conversation
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've got mixed emotions regarding this. If one wants to call locate_dofs_topological
, this is clearly needed, and it is not clear why we want to force users to call it for this function.
Also note that if we remove it, we need proper error handling (a simple assert isn't enough), as this is not checked in release mode. Then we would need a runtime error saying "Missing connectivity between entities of dim {dim} and {tdim}".
I think you're right about the error handling. |
I know, and if we want to be consistent, we follow your code (and add an appropriate error message). |
I for sure agree with all comments above, but I just want to point that these commits did not change a single test or demo. It seems to me that, for all intents and purposes, in any of our actual use cases (C++ demos, C++ tests, python demos, python tests) those entities and connectives are indeed already computed in practice, so most of the users won't even notice this change. |
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 is good, but need to change assertions to exceptions.
On Python side we're ok with more implicit behaviour so any required initialisation can happen in the Python layer.
As for other functions in
dolfinx
, the user should callcreate_connectivity
explicitly.Locating dofs shouldn't modify the topology.