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
Deprecate DoFHandler initialization interface. #11160
Deprecate DoFHandler initialization interface. #11160
Conversation
/rebuild |
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.
Let's get some more feedback before merging this one!
Do you want to summarize what the motivation behind this deprecation is? It doesn't seem to be a terrible feature to have... |
My idea behind this deprecation is to remove ambiguity by providing a clear interface. I wanted to separate the initialization process from the actual enumeration of degrees of freedom. After merging When I worked on the parallelization of the hp elements, I introduced the I do not like about the Apart from that, the As we are using |
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'm for this simplification of the interface. It makes it easier to reason about the state the object is in (e.g., it always has an associated Triangulation
object). It also only removes/deprecates functions that are not in wide use.
The only reason, I believe, to have the DoFHandler()
constructor and associated initialize(Triangulation)
function was so that one can store DoFHandler
objects in collections that require default initialization. But the fact that we never seem to do that in the tutorials is a good indication that that's not a common use case, and there is also always the possibility to use a collection of pointers instead.
So I'm in favor.
@tjhei What do you say? I think you were the lone voice of question here.
This comment reminds me that I am using it like this. I have a |
This is a good point. More intuitive would have been a
I am not opposed to this change but wanted to understand the motivation. Every deprecation/removal has downstream effort for at least some users so that has to be considered. Peter makes a good point though: usage of DoFHandler in containers becomes more difficult without |
I can always use a smart pointer (although it is my last choice). My personal use case should be not a problem. However, this will involve with replacing a couple of I think
would be a good idea. What do others think? |
I didn't think of default construction in containers either. I would be okay with leaving the |
I've provided a patch for the default constructor and a |
700f297
to
6597aac
Compare
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. Thanks! But I am a bit confused why the constructor that takes a triangulation does not call the reinit function?
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!
For some reason I felt like not altering the initializer list in the non-default constructor. It makes sense to use the |
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 happy with this change.
Thank you for your feedback! I will squash the commits so we can finally get this merged! |
2e15da2
to
44ae758
Compare
@marcfehling I have replaced the |
Split from #11133 and only addresses the deprecation of the DoFHandler initialization.
Part of #11102 and #10333.
This PR simplifies the initialization interface for the DoFHandler class by keeping the most common way of initialization (
DoFHandler(tria)
anddistribute_dofs(fe)
) and deprecating the remaining.