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
Move AdditionalData outside of class definition #14837
base: master
Are you sure you want to change the base?
Conversation
I like the idea. Due to the large number of changes required, I would suggest that we do not deprecate the old names. Arguments against this change:
|
Agree. I would not deprecate it. Referring to the type in a generic way via the class-internal typedef is useful.
Should we add
Maybe. I think it is quite similar for the case of the |
Let's see what the test say... /rebuild |
Since the tests pass: any more opinions on the proposed change? Should I adapt it for all the Solver classes? |
As this is a bigger change, I would suggest we wait for a few more opinions on this. |
I think this can be helpful, as it is annoying to state all parameters. I would definitely vote for the |
Hm, that's unfortunate. At least PreconditionerType only requires |
I'm not opposed to this, but if we do it I would like it if we did it for all 11 places at once where we currently have an I will say that
or
I think the work involved results in a rather small gain, but then I don't have to do it myself :-) |
Agreed. I will change it everywhere.
My intention behind this change is not brevity. I want to specify solver parameters in a very general place where I have no idea what the |
55c3632
to
7d22245
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.
I don't think these are all places where AdditionalData
is within a class. See PreconditionChebyshev
, MatrixFree
, ...
Correct. I am not done yet. Neverteheless, the question is whether this change is truly useful for every class. Personally, I would not benefit from having the parameters of MatrixFree outside the class, since these are not something I would enter in an input file. Others might have other requirements though. Changing every I planned to also do the preconditioners and other solvers. However, I would leave the structs inside the class if the class is not a template. |
I would really like it if we did it uniformly across the entire library. |
@bangerth @peterrum Ok, makes sense I guess for consistencies sake. I'll do the following:
|
Still not finished. There are some packages that I don't use locally and thus will not be able to adapt right now. These include arpack, gingko, slepc, cgal. |
@sebproell What do we want to do with this PR? It's become stale with merge conflicts. Are you still interested in this, or should we just close it? |
When one wants to fill the
AdditionalData
struct of a class (especially solvers), currently one needs to know theVectorType
template parameter although it is not necessary for the struct and only for the surrounding solver. This patch suggests a way to move these structure outside and still retain the convenient access for generic code. Instead ofExampleClass::AdditionalData
the struct is now calledExampleClassAdditionalData
. Due to the using statement, I think this should be backward-compatible (not sure about the binary representation of the struct though)?I only changed it for GMRES. If we decide to go for such a change I am happy to change it everywhere.
fyi @mschreter