<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Feb 12, 2016 at 9:20 AM, Paul T. Bauman <span dir="ltr"><<a href="mailto:ptbauman@gmail.com" target="_blank">ptbauman@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 dir="ltr">Hi Barry,<br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 11, 2016 at 2:45 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</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"><span><br>
> On Feb 11, 2016, at 1:36 PM, Boris Boutkov <<a href="mailto:borisbou@buffalo.edu" target="_blank">borisbou@buffalo.edu</a>> wrote:<br>
><br>
> Hello All,<br>
><br>
> I'm currently working on hooking into the PETSc multi-grid infrastructure by creating my own DMShell and providing my own interpolation and injection operators. The issue I am currently facing is that while PCSetUp_MG is running, PETSc begins by attempting to create an interpolation (through DMCreateInterpolation) for the finest grid that I am passing it.<br>
><br>
> What would be a good way to try and let the PCSetUp_MG procedure know the first mesh it is receiving is the finest one, so there should be no interpolation provided to it?<br>
<br>
</span> Boris,<br>
<br>
I do not understand the question, perhaps it is a matter of language.</blockquote><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"> Say you have two levels total: call them coarse and fine. the PCSetUp_MG will try to create a single interpolation "for/to the fine grid" FROM the coarse grid. This is necessary to do the geometric multigrid. You would then through your DMSHELL provide the function that creates the interpolation matrix. The PCSetUp_MG will not attempt to create an interpolation "for the coarse mesh" since there is no mesh coarser than the coarse mesh. So<br>
PCSetUp_MG() should be trying to create only the needed interpolations, so you should not need to tell them not to try to create certain ones.</blockquote><div><br></div><div>The information I think we're missing is, more or less, the order of operations during the MG setup and how PETSc is expecting us to behave with our DMShell implementation. I'll stick with your coarse and fine grid. On our side, we can construct the coarse and the fine grids, supplying the DMs and accompanying PetscSections, at simulation setup time since we know what our grid hierarchy is (we're focusing on hierarchical meshes to start with). Then, for DMRefine and DMCoarsen, we can just return the correct DM that we've built. (Maybe this the wrong way to do it?) We also have implementations of DMCreateInterpolation and DMCreateInjection for moving between each of the levels.</div><div><br></div><div>Our main confusion is, once we've set up of all that, which of the DMs we've constructed do we go ahead and give to SNES? The fine or the coarse? Is it expected that we should be checking the DM supplied to, e.g., DMCreateInterpolation for which of the operators PETSc is wanting? We were guessing that we should supply the fine DM to SNES (and then not expecting DMCreateInterpolation to be called yet).</div></div></div></div></blockquote><div><br></div><div>Ah, good question. I think it should be the fine grid, and this is the default for FAS. Some stuff used to take a coarse grid because</div><div>DMDA was easier to refine, but that should all be fixed now.</div><div><br></div><div>Also, it looks like Lawrence responded.</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 dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Clearly, there's some setup steps we're missing or we're just going about this all the wrong way. Is there an existing example of setting up a problem using a DMShell? I poked a little but couldn't find one.</div><div><br></div><div>Thanks much.</div><div><br></div><div>Best,</div><div><br></div><div>Paul</div></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>