<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Sep 12, 2015 at 1:54 PM, Gideon Simpson <span dir="ltr"><<a href="mailto:gideon.simpson@gmail.com" target="_blank">gideon.simpson@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>I’m not sure how good a problem this would be as a toy model, but, once this is all done, I’d be happy to share the code. </div><div><br></div><div>I’ve got a few comments on this:</div><div><br></div><div>1. The underlying problem is in the study of derivative nonlinear Schrödinger equations - see <a href="http://arxiv.org/abs/1301.1048" target="_blank">http://arxiv.org/abs/1301.1048</a> for details of the equation. The problem has features of the Airy equation, which as you’d guess, has exactly this problem of highly oscillatory structures which don’t get along with linear interpolation.</div><div><br></div><div>2. The problem is complex valued with a real and imaginary components at each site on the mesh. At the origin, the boundary conditions are Dirichlet on the imaginary component, and Neumann on the real component. This led me to make the value of the real component at the origin, u0, one of the three parameters in the first component of the DMComposite structure. Consequently, (u0, 0), the values of the function at the origin, should be involved in the interpolation strategy. Is there a way, through ghost points, for the current DM interpolation strategy to make use of these under refinement? Does it use ghost point values?</div><div><br></div><div>3. Is DMShellSetCreateInterpolation what I want to use here? Where I would define my own interpolation strategy across dm’s? </div></div></blockquote><div><br></div><div>Ah, crap. This breaks the current DMComposite interpolation (in packm.c), which assumes that it is block diagonal. However, it produces</div><div>a MatNest object, so we could conceivably just stick in another block, but that would not be general in any sense.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><span class="HOEnZb"><font color="#888888"><div>
<span style="border-collapse:separate;border-spacing:0px">-gideon</span>
</div></font></span><div><div class="h5">
<br><div><blockquote type="cite"><div>On Sep 12, 2015, at 2:36 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Sep 12, 2015 at 1:26 PM, Gideon Simpson <span dir="ltr"><<a href="mailto:gideon.simpson@gmail.com" target="_blank">gideon.simpson@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">Got it. I wanted to follow up on something that I had been suspicious of for some time. I took my initial solution, the one which we want to apply grid sequencing to, and did the following. I loved into spicy, and manually did grid refinement using SciPy, dumped to disk, and then ran that through petsc, with the refined mesh. When I say “manual” here, I just mean that I called the SciPy spline interplant commands on uniform meshes that had twice the resolution, not that I manually picked out the refinement points. When I use a linear interpolant, and run my solver on it, it fails miserably, just as the first grid sequence refinement does. The numbers are a little different, but the residuals are still O(100).<div><br></div><div>If, instead, I use a second order interpolant, it solves it 11 iterations, wiithout a problem, and the result is physically consistent. While this may be two sides of the same coin, it makes me think that the real challenge in my is the interpolation strategy used under grid refinement. Is there a way to, manually, I suppose, set the interpolation that will be used under the grid sequence?</div></div></blockquote><div><br></div><div>Excellent! And also somewhat bizarre. This would be great to analyze. Is there any bribe we could give you to</div><div>convert this to a real PETSc example? It would be a nice way to show that dumping in high frequency energy</div><div>when interpolating can be bad for coupled problems.</div><div><br></div><div>Actual Solution: I think this will involve some coding. The quick and dirty way is to just stick the code you want</div><div>into dainterp.c:DMCreateInterpolation_DA(). If that works, we add it to interptype and enable it from the command</div><div>line. It would be nice to have a spline interpolant.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><span><font color="#888888">
-gideon
</font></span><div><div>
<br><div><blockquote type="cite"><div>On Sep 12, 2015, at 7:14 AM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div><br><div><div dir="ltr" style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 11, 2015 at 4:30 PM, Gideon Simpson<span> </span><span dir="ltr"><<a href="mailto:gideon.simpson@gmail.com" target="_blank">gideon.simpson@gmail.com</a>></span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Are there any built in routines for freezing variables in SNES, or will that need to be handled by hand.</div></div></blockquote><div><br></div><div>We used to have this for KSP, but it looks like someone removed it. The only thing left is KSPMonitorRange().</div><div>What we did is find the few largest residual elements, take a small halo around them, project the problem to this</div><div>small space using MatGetSubMatrix() and VecScatter, solve, and VecScatter back.</div><div><br></div><div>We do not have this for nonlinear stuff (like many other things) because there is no explicit matrix to manipulate,</div><div>and language support for computing only parts of the nonlinear function is really weak. What we really want</div><div>is something like what Victor Eijkout was proposing a few years ago, namely automatic discovery of index sets</div><div>for communication, in this case with main memory. We would need the residual code, given an output set, to tell</div><div>us what input set is needed. Then we make a Scatter, select part of the DM, and we could compute. Now it has</div><div>to be done by hand.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Also, I remain curious about the starting guess that the grid sequence uses during each refinement. Is there a way to dump those to disk for inspection?</div><br><div><span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">-gideon</span></div><br><div><blockquote type="cite"><span><div>On Sep 11, 2015, at 4:05 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div><br></span><div><div dir="ltr" style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_extra"><div class="gmail_quote"><span>On Fri, Sep 11, 2015 at 1:05 PM, Gideon Simpson<span> </span><span dir="ltr"><<a href="mailto:gideon.simpson@gmail.com" target="_blank">gideon.simpson@gmail.com</a>></span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">Since the problem has not only the two components in the DM, but the second component has 4 degrees of freedom per mesh point, I thought it best to do the post processing separately. See attached</div></blockquote><div><br></div><div>So the whole thing is being controlled by 1 variable.</div><div><br></div><div>We should try freezing everything else, and just solving that scalar equation I guess.</div><div><br></div><div> Matt</div><div> </div></span><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><span style="border-collapse:separate;font-family:Helvetica;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">-gideon</span></div><span><Screen Shot 2015-09-11 at 2.04.25 PM.png></span><div><div><br><div><blockquote type="cite"><div>On Sep 11, 2015, at 10:16 AM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div><br><div><div dir="ltr" style="font-family:Helvetica;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 11, 2015 at 9:08 AM, Gideon Simpson<span> </span><span dir="ltr"><<a href="mailto:gideon.simpson@gmail.com" target="_blank">gideon.simpson@gmail.com</a>></span><span> </span>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">Following up on the previous thread, for my dm composite problem, I find that at the end of the first grid sequence,where it fails to converge, the distribution of the norms between the two pieces are:<div><br></div><div><div style="margin:0px;font-family:Menlo"><span style="font-size:12px"> 39 SNES Function norm 2.253098577796e+02 </span></div><div style="margin:0px;font-family:Menlo"><span style="font-size:12px"> 40 SNES Function norm 2.253098577331e+02 </span></div><div style="margin:0px;font-family:Menlo"><span style="font-size:12px"> 41 SNES Function norm 2.253098577228e+02 </span></div><div style="margin:0px;font-family:Menlo"><span style="font-size:12px"> 42 SNES Function norm 2.253098577212e+02 </span></div><div style="margin:0px;font-family:Menlo"><span style="font-size:12px"> 43 SNES Function norm 2.253098577174e+02 </span></div><div style="margin:0px;font-family:Menlo"><span style="font-size:12px"> 44 SNES Function norm 2.253098577166e+02 </span></div><div style="margin:0px;font-family:Menlo"><span style="font-size:12px"> 45 SNES Function norm 2.253098577158e+02 </span></div><div style="margin:0px;font-family:Menlo"><span style="font-size:12px"> 46 SNES Function norm 2.253098577157e+02 </span></div><div style="margin:0px;font-family:Menlo"><span style="font-size:12px"> 47 SNES Function norm 2.253098577156e+02 </span></div><div style="margin:0px;font-family:Menlo"><span style="font-size:12px"> 48 SNES Function norm 2.253098577156e+02 </span></div><div><div style="margin:0px;font-family:Menlo"><span style="font-size:12px">Nonlinear solve did not converge due to DIVERGED_LINE_SEARCH iterations 48</span></div><div style="margin:0px;font-family:Menlo"><span style="font-size:12px"> ||r|| = 225.31, 7999 entries</span></div><div style="margin:0px;font-family:Menlo"><span style="font-size:12px"> ||rp|| = 140.021, 3 entries</span></div><div style="margin:0px;font-family:Menlo"><span style="font-size:12px"> ||rQ|| = 176.518, 7996 entries</span></div></div><div><br></div><div>Since I think we were convinced that this was intrinsic to the problem, and not a function of the Jacobian function, I am using my Jacobian.</div></div></div></blockquote><div><br></div><div>Okay, I see no pattern in the fields. Lets plot these 2 vectors, -vec_view draw, and screenshot.</div><div><br></div><div> <span> </span>Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span><font color="#888888">-gideon<br></font></span></div></div></blockquote></div><br><br clear="all"><span><font color="#888888"><div><br></div>--<span> </span><br><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div></font></span></div></div></div></blockquote></div><br></div></div></div></div></blockquote></div><div><div><br><br clear="all"><div><br></div>--<span> </span><br><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div></div></div></div></div></div></blockquote></div><br></div></blockquote></div><br><br clear="all"><div><br></div>--<span> </span><br><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div></div></div></div></blockquote></div><br></div></div></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>
</div></blockquote></div><br></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>