-
Notifications
You must be signed in to change notification settings - Fork 14
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
[WIP] Quadrature Revamping #86
[WIP] Quadrature Revamping #86
Conversation
splitting into separate files in subdirectory note: just include 'quadrature.hpp' for all the quadrature stuff
98230b2
to
a6f92d5
Compare
I like where this is going but need to be educated a bit... Can you give an example of how the trait mechanism for Splitting up all the different types of quadrature seems to have resulted in a boat load of boiler plate code -- can this be shortened up significantly? Is there some fundamental reason why the matrices are square (aside from making it easier to compute Q*Q)? Do we really need those We need to fix that |
No fundamental reason for Q to be quadratic, but IMHO much more consistent and easier to handle (e.g. for Q*Q or St. Martin's trick). Plus: no special treatment (in Q and number of nodes) for quadrature rules where the left boundary point is not a quadrature node. |
How do you propose to handle Guass-Legendre nodes with a square matrix M On 9/4/2014 11:54 AM, Robert Speck wrote:
|
Quite true, but we agreed on a special treatment for the boundaries anyway. We have a vector q which includes the weights from t_n to t_{n+1} and is used only if the last node is not equal to t_{n+1}. Similarly, we test whether the first node is equal to t_n and if not, we use the first row of Q (otherwise, we don't, so no adding up zeros). The reason for that: SDC is an iterator for u at the nodes tau_m only. u_1 = u(t_n) and/or u_M = u(t_{n+1}) are special cases, where we can save a few operations and we do so using |
@pancetta Can you just clarify: if the user asks for 3 Gauss-Legendre nodes, do we get a 3x3 matrix? |
@memmett exactly, you will always get an MxM matrix Q, an MxM matrix S and the weights vector q for the full interval , no matter what kind of nodes you request. First row might be all zeros in S and Q, but who cares.. we can (and will) catch those cases in the sweeper. And the order of your quadrature is always directly linked to M, i.e. 2M for Gauss-Legendre, 2M-2 for Gauss-Lobatto. Principle of least surprise :-). |
Yep, LGTM except for those technical questions that I raised... |
Oh please don't start calling the left endpoint u_1! u_1 = u(t_n) |
@mlminion u_1 was meant to be the first node... sorry for the confusion. |
On 09/04/2014 01:27 PM, Robert Speck wrote:
I like the notation in the MLSDC paper (see the footnote at the bottom I don't understand how having matrices of different sizes is going to M |
Thanks for your remarks. I'll comment on the traits and boilerplate code. The traits are meant only for internal use and were the result of my inability to achieve the same effect with plain ( Regarding the boilerplate code, you probably mean all the copy and move constructors and |
using naming convention of rest of codebase
why does clang not complain? o.O
everything should still work as before
also adjusted AdVec Vanilla SDC example note: only vanilla_sdc compiles and runs
@@ -150,6 +154,12 @@ namespace pfasst | |||
*/ | |||
virtual void advance() = 0; | |||
|
|||
virtual void do_inner_nodes(const size_t m, const time t, const time ds) = 0; |
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.
Do these belong at the interface level?
@torbjoernk The changes you made to remove traits and most of the boiler plate code look good. I made a few comments inline. @mlminion @pancetta I think there is a conservation-of-pain law lurking around here: with either convention (left/right always included vs not) the sweeper will have some extra logic to deal with all variations (eg, Lobatto, Radau and Legendre). LIBPFASST uses the augmented/virtual node route, and this PR goes with the square Q route. My guess is that, in the end, the logic for the square Q route will be more explicit and easier to follow. Let's see how it goes... |
if (initial) { this->evaluate(0); } | ||
if (initial) { | ||
this->f_expl_eval(this->fs_expl_start, this->u_start, t + dt * this->quad->get_nodes()[0]); | ||
this->f_impl_eval(this->fs_impl_start, this->u_start, t + dt * this->quad->get_nodes()[0]); |
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 you want the t + dt...
(just t
). Also, I don't think the implicit piece is necessary here.
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.
Somehow, I managed to "tune" the IMEX sweeper in such a way, that the implicit evaluation is necessary for overall convergence of the AdVec vanilla_sdc
example. 😕
I think we should put this into a branch where we can all hack on it... |
I agree on having a common branch for that. I just pushed my current feature branch to upstream. You should all be able to work there. In case there are only us two working on that, it should be fine to directly push onto upstream without PRs. I'll close this PR for now. |
Here is a proposed layout for the new quadrature. Only the quadrature tests are supposed to compile. The sweepers and examples have yet to be altered to not use "augmented nodes" any more.
The Q and S matrices are now square and
nodes
only holds "real" quadrature nodes. Thequadrature_traits
template is used to specify whether the left/right node are the start and/or end of the time interval. This is in preparation for #71 and #31.To shorten the source files, I've split up the different quadrature types into separate files in a separate namespace.