<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">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 class=""><br class=""></div><div class="">I’ve got a few comments on this:</div><div class=""><br class=""></div><div class="">1.  The underlying problem is in the study of derivative nonlinear Schrödinger equations - see <a href="http://arxiv.org/abs/1301.1048" class="">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 class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">3.  Is DMShellSetCreateInterpolation what I want to use here?  Where I would define my own interpolation strategy across dm’s?  </div><br class=""><div class="">
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;">-gideon</span>

</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Sep 12, 2015, at 2:36 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" class="">knepley@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">On Sat, Sep 12, 2015 at 1:26 PM, Gideon Simpson <span dir="ltr" class=""><<a href="mailto:gideon.simpson@gmail.com" target="_blank" class="">gideon.simpson@gmail.com</a>></span> wrote:<br class=""><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" class="">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 class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">Excellent! And also somewhat bizarre. This would be great to analyze. Is there any bribe we could give you to</div><div class="">convert this to a real PETSc example? It would be a nice way to show that dumping in high frequency energy</div><div class="">when interpolating can be bad for coupled problems.</div><div class=""><br class=""></div><div class="">Actual Solution: I think this will involve some coding. The quick and dirty way is to just stick the code you want</div><div class="">into dainterp.c:DMCreateInterpolation_DA(). If that works, we add it to interptype and enable it from the command</div><div class="">line. It would be nice to have a spline interpolant.</div><div class=""><br class=""></div><div class="">  Thanks,</div><div class=""><br class=""></div><div class="">     Matt</div><div class=""> </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" class=""><div class=""><div class=""><span class=""><font color="#888888" class="">
-gideon

</font></span><div class=""><div class="h5">
<br class=""><div class=""><blockquote type="cite" class=""><div class="">On Sep 12, 2015, at 7:14 AM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank" class="">knepley@gmail.com</a>> wrote:</div><br class=""><div class=""><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" class=""><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 11, 2015 at 4:30 PM, Gideon Simpson<span class=""> </span><span dir="ltr" class=""><<a href="mailto:gideon.simpson@gmail.com" target="_blank" class="">gideon.simpson@gmail.com</a>></span><span class=""> </span>wrote:<br class=""><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" class=""><div class="">Are there any built in routines for freezing variables in SNES, or will that need to be handled by hand.</div></div></blockquote><div class=""><br class=""></div><div class="">We used to have this for KSP, but it looks like someone removed it. The only thing left is KSPMonitorRange().</div><div class="">What we did is find the few largest residual elements, take a small halo around them, project the problem to this</div><div class="">small space using MatGetSubMatrix() and VecScatter, solve, and VecScatter back.</div><div class=""><br class=""></div><div class="">We do not have this for nonlinear stuff (like many other things) because there is no explicit matrix to manipulate,</div><div class="">and language support for computing only parts of the nonlinear function is really weak. What we really want</div><div class="">is something like what Victor Eijkout was proposing a few years ago, namely automatic discovery of index sets</div><div class="">for communication, in this case with main memory. We would need the residual code, given an output set, to tell</div><div class="">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 class="">to be done by hand.</div><div class=""><br class=""></div><div class="">  Thanks,</div><div class=""><br class=""></div><div class="">     Matt</div><div class=""> </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" class=""><div class="">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 class=""><div class=""><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" class="">-gideon</span></div><br class=""><div class=""><blockquote type="cite" class=""><span class=""><div class="">On Sep 11, 2015, at 4:05 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank" class="">knepley@gmail.com</a>> wrote:</div><br class=""></span><div class=""><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" class=""><div class="gmail_extra"><div class="gmail_quote"><span class="">On Fri, Sep 11, 2015 at 1:05 PM, Gideon Simpson<span class=""> </span><span dir="ltr" class=""><<a href="mailto:gideon.simpson@gmail.com" target="_blank" class="">gideon.simpson@gmail.com</a>></span><span class=""> </span>wrote:<br class=""><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" class="">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 class=""><br class=""></div><div class="">So the whole thing is being controlled by 1 variable.</div><div class=""><br class=""></div><div class="">We should try freezing everything else, and just solving that scalar equation I guess.</div><div class=""><br class=""></div><div class="">   Matt</div><div class=""> </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" class=""><div class=""><div class=""><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" class="">-gideon</span></div><span class=""><Screen Shot 2015-09-11 at 2.04.25 PM.png></span><div class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Sep 11, 2015, at 10:16 AM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank" class="">knepley@gmail.com</a>> wrote:</div><br class=""><div class=""><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" class=""><div class="gmail_extra"><div class="gmail_quote">On Fri, Sep 11, 2015 at 9:08 AM, Gideon Simpson<span class=""> </span><span dir="ltr" class=""><<a href="mailto:gideon.simpson@gmail.com" target="_blank" class="">gideon.simpson@gmail.com</a>></span><span class=""> </span>wrote:<br class=""><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" class="">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 class=""><br class=""></div><div class=""><div style="margin:0px;font-family:Menlo" class=""><span style="font-size:12px" class=""> 39 SNES Function norm 2.253098577796e+02 </span></div><div style="margin:0px;font-family:Menlo" class=""><span style="font-size:12px" class=""> 40 SNES Function norm 2.253098577331e+02 </span></div><div style="margin:0px;font-family:Menlo" class=""><span style="font-size:12px" class=""> 41 SNES Function norm 2.253098577228e+02 </span></div><div style="margin:0px;font-family:Menlo" class=""><span style="font-size:12px" class=""> 42 SNES Function norm 2.253098577212e+02 </span></div><div style="margin:0px;font-family:Menlo" class=""><span style="font-size:12px" class=""> 43 SNES Function norm 2.253098577174e+02 </span></div><div style="margin:0px;font-family:Menlo" class=""><span style="font-size:12px" class=""> 44 SNES Function norm 2.253098577166e+02 </span></div><div style="margin:0px;font-family:Menlo" class=""><span style="font-size:12px" class=""> 45 SNES Function norm 2.253098577158e+02 </span></div><div style="margin:0px;font-family:Menlo" class=""><span style="font-size:12px" class=""> 46 SNES Function norm 2.253098577157e+02 </span></div><div style="margin:0px;font-family:Menlo" class=""><span style="font-size:12px" class=""> 47 SNES Function norm 2.253098577156e+02 </span></div><div style="margin:0px;font-family:Menlo" class=""><span style="font-size:12px" class=""> 48 SNES Function norm 2.253098577156e+02 </span></div><div class=""><div style="margin:0px;font-family:Menlo" class=""><span style="font-size:12px" class="">Nonlinear solve did not converge due to DIVERGED_LINE_SEARCH iterations 48</span></div><div style="margin:0px;font-family:Menlo" class=""><span style="font-size:12px" class=""> ||r|| = 225.31, 7999 entries</span></div><div style="margin:0px;font-family:Menlo" class=""><span style="font-size:12px" class=""> ||rp|| = 140.021, 3 entries</span></div><div style="margin:0px;font-family:Menlo" class=""><span style="font-size:12px" class=""> ||rQ|| = 176.518, 7996 entries</span></div></div><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">Okay, I see no pattern in the fields. Lets plot these 2 vectors, -vec_view draw, and screenshot.</div><div class=""><br class=""></div><div class=""> <span class=""> </span>Matt</div><div class=""> </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" class=""><div class=""><span class=""><font color="#888888" class="">-gideon<br class=""></font></span></div></div></blockquote></div><br class=""><br clear="all" class=""><span class=""><font color="#888888" class=""><div class=""><br class=""></div>--<span class=""> </span><br class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div></font></span></div></div></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><div class=""><div class=""><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class=""> </span><br class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div></div></div></div></div></div></blockquote></div><br class=""></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>--<span class=""> </span><br class=""><div class="">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br class="">-- Norbert Wiener</div></div></div></div></blockquote></div><br class=""></div></div></div></div></div></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><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 class="">-- Norbert Wiener</div>
</div></div>
</div></blockquote></div><br class=""></body></html>