-
Notifications
You must be signed in to change notification settings - Fork 708
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
Remove Quadrature(unsigned int) from the public interface. #17017
Conversation
We need to address the error
This was recently introduced by @jh66637 in #16394 - any comments on how to address this? I think it would make sense to not store quadrature formulas but merely points (depending on how the consumer site looks like), or fill the quadrature objects with one of the other constructors. |
The code you point out looks like this:
I think it's worth pointing out that what one ends up with here is a quadrature object with In other words, I think that the design used here is broken. The object as initialized is unusable. We shouldn't create it. I don't know where that is, but assume that points and weights are set somewhere else, and we should leave resizing to the correct size to the place where we do the initialization of points and weights. I'm afraid I have no overview of this code. Could someone help me with this location? |
I can definitely help if @jh66637 is busy, let us wait for a day or two (as my schedule is overly crowded today and tomorrow). |
Changed: The Quadrature class used to have a constructor that took an | ||
integer argument. This was error prone because it was easy to accidentally |
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.
Changed: The Quadrature class used to have a constructor that took an | |
integer argument. This was error prone because it was easy to accidentally | |
Changed: The Quadrature class used to have a constructor that took an | |
integer argument. This was error-prone because it was easy to accidentally |
@bangerth @kronbichler The reason I used this is the following: We only need the size of the quadrature objects. At some point I pointed out, that we have to decide if we keep the interface similar to Long story short, we can simply replace
by
and similar for all overloads. This functionality is quite new, was in no release and is probably not used by a lot of people, so this can be easily changed in my opinion. I can do that in a separate PR if you want to, or you can do it with this PR. What do you prefer? |
Since you know the code, I'd love if you could make that change in a separate PR. Once that's merged, I can rebase the current one. Thank you in advance! |
I will try to find the time tomorrow :) |
Now ready given that the one place where this failed has been addressed in #17032. |
There are still failing tests:
|
6f3f10d
to
cd2dd9e
Compare
I made it to work now. |
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.
One less pitfall. Very nice!
You can also use the default constructor in the tests.
Fixes #16818.
This is strictly speaking an incompatible change. I don't think there should be many places where someone creates a correctly sized but otherwise invalid quadrature object, so the impact is likely small to zero.
I did think about alternatives. The obvious one is the introduction of a default constructor
Quadrature()
and removing the default value from the constructor in question here, followed by marking the latter as deprecated. That could work to retain backward compatibility. But because derived classes uniformly seem to be using this constructor, once we remove deprecated functions, we have to remember that this one cannot be removed but must be madeprotected
instead. That just seemed unnecessary use of brain power, so I decided that the impact here is small enough to warrant outright removal.