<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jul 18, 2016 at 1:41 AM, domenico lahaye <span dir="ltr"><<a href="mailto:domenico_lahaye@yahoo.com" target="_blank">domenico_lahaye@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div style="color:rgb(0,0,0);font-family:"times new roman","new york",times,serif;font-size:16px;background-color:rgb(255,255,255)"><div>Dear Matthew, </div><div><br></div><div dir="ltr">  I would like to place the FormJacobian statement in ex25.c in such a way that I can view </div><div dir="ltr">the result on the different levels. Can you please point me to an example? </div></div></div></blockquote><div><br></div><div>You can use options to do this. For any KSP solve, you can use</div><div><br></div><div>  -ksp_view_mat draw</div><div><br></div><div>for whatever viewer you want. In the mg cycle, you can use</div><div><br></div><div>  -mg_level_2_ksp_view_mat draw</div><div><br></div><div>or for all levels</div><div><br></div><div>  -mg_levels_ksp_view_mat draw</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div style="color:rgb(0,0,0);font-family:"times new roman","new york",times,serif;font-size:16px;background-color:rgb(255,255,255)"><div dir="ltr">  I would like to do above with Galerkin coarsening as well. So yes, I do expect that I will need the </div><div dir="ltr">hooks attached to the different MG levels. I appreciate more pointers here as well. </div></div></div></blockquote><div><br></div><div>The above should work with either method.</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-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div style="color:rgb(0,0,0);font-family:"times new roman","new york",times,serif;font-size:16px;background-color:rgb(255,255,255)"><div dir="ltr">   Thanks, Domenico.  </div><div><br></div><div><br></div><div><b style="font-family:Arial">From:</b><span style="font-family:Arial;font-size:small"> Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span><br></div><div><br><br></div><div style="display:block"><div style="font-family:"times new roman","new york",times,serif;font-size:16px"><div style="font-family:HelveticaNeue,"Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:16px"><div dir="ltr"><font size="2" face="Arial"> <b><span style="font-weight:bold">To:</span></b> domenico lahaye <<a href="mailto:domenico_lahaye@yahoo.com" target="_blank">domenico_lahaye@yahoo.com</a>> <br><b><span style="font-weight:bold">Cc:</span></b> PETSc Users List <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br> <b><span style="font-weight:bold">Sent:</span></b> Monday, July 18, 2016 8:16 AM<div><div class="h5"><br> <b><span style="font-weight:bold">Subject:</span></b> Re: [petsc-users] Regarding ksp ex42 - Citations<br> </div></div></font> </div><div><div class="h5"> <div><br><div><div><div dir="ltr"><div><div>On Mon, Jul 18, 2016 at 12:59 AM, domenico lahaye <span dir="ltr"><<a rel="nofollow" shape="rect" href="mailto:domenico_lahaye@yahoo.com" target="_blank">domenico_lahaye@yahoo.com</a>></span> wrote:<br clear="none"><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div style="color:rgb(0,0,0);font-family:"times new roman","new york",times,serif;font-size:16px;background-color:rgb(255,255,255)"><div><div><div style="color:rgb(0,0,0);font-family:"times new roman","new york",times,serif;font-size:16px;background-color:rgb(255,255,255)"><div><span>Thanks for all the pointers. </span></div><div><span><br clear="none"></span></div><div dir="ltr"><span>I am happy to switch to </span><span style="font-family:HelveticaNeue,"Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif">ksp/examples/tutorials/ex25.c in a first instance as you suggest.</span></div><div dir="ltr"><span style="font-family:HelveticaNeue,"Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif"><br clear="none"></span></div><div dir="ltr"><span style="font-family:HelveticaNeue,"Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif">    I am still stuck with the same issue as before though. I am trying to extract the hierarchy </span></div><div dir="ltr">    of coarser grid matrices and the intergrid transfer operators from the DMDA data structure. I would </div><div dir="ltr">    like to modify these operators and define a multigrid cycle with the modified operators. </div><div dir="ltr"><br clear="none"></div><div dir="ltr">    Given A^h (Helmholtz) and M^h (shifted Laplace), I would like to define a multigrid cycle involving </div><div dir="ltr">    both A^H and M^H. Can I rely on the multilevel DMDA structure to construct A^H and M^H for me </div><div dir="ltr">    in a set-up phase, plug them into a user-defined context, and plug them back out in a solve phase? </div></div></div></div></div></div></blockquote><div><br clear="none"></div><div>If you are not using -pc_mg_galerkin, then the FormJacobian is called separately on each level to rediscretize the operator.</div><div>The only thing that changes is the DMDA that is passed to the call. If you need more information, there are hooks to</div><div>attach different contexts to each MG level. Do you need this?</div><div><br clear="none"></div><div>  Thanks,</div><div><br clear="none"></div><div>     Matt</div><div> <br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div style="color:rgb(0,0,0);font-family:"times new roman","new york",times,serif;font-size:16px;background-color:rgb(255,255,255)"><div><div><div style="color:rgb(0,0,0);font-family:"times new roman","new york",times,serif;font-size:16px;background-color:rgb(255,255,255)"><div dir="ltr">Thanks, Domenico. </div><div dir="ltr"><br clear="none"></div><div><br clear="none"></div><div></div></div></div></div><div>  <div style="font-family:"times new roman","new york",times,serif;font-size:16px"> <div style="font-family:HelveticaNeue,"Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;font-size:16px"> <div dir="ltr"> <font size="2" face="Arial"> </font><hr size="1"> <b><span style="font-weight:bold">From:</span></b> Matthew Knepley <<a rel="nofollow" shape="rect" href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>><br clear="none"> <b><span style="font-weight:bold">To:</span></b> Barry Smith <<a rel="nofollow" shape="rect" href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>> <br clear="none"><b><span style="font-weight:bold">Cc:</span></b> domenico lahaye <<a rel="nofollow" shape="rect" href="mailto:domenico_lahaye@yahoo.com" target="_blank">domenico_lahaye@yahoo.com</a>>; "<a rel="nofollow" shape="rect" href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>" <<a rel="nofollow" shape="rect" href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br clear="none"> <b><span style="font-weight:bold">Sent:</span></b> Sunday, July 17, 2016 2:29 PM<br clear="none"> <b><span style="font-weight:bold">Subject:</span></b> Re: [petsc-users] Regarding ksp ex42 - Citations<br clear="none">  </div> <div><br clear="none"><div><div><div dir="ltr"><div><div>On Sat, Jul 16, 2016 at 10:11 PM, Barry Smith <span dir="ltr"><<a rel="nofollow" shape="rect" href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br clear="none"><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span><br clear="none">
> On Jul 14, 2016, at 12:21 PM, domenico lahaye <<a rel="nofollow" shape="rect" href="mailto:domenico_lahaye@yahoo.com" target="_blank">domenico_lahaye@yahoo.com</a>> wrote:<br clear="none">
><br clear="none">
</span><div><div>> Dear PETSc team,<br clear="none">
><br clear="none">
> 1) I am looking into ks/examples/tutorials/ex42.c I am still new to the DMDA structure<br clear="none">
>     and likely not giving it as much time as it deserves. However, I do not see immediately<br clear="none">
>     what function is responsible for calling PCMGSetSmoother and PCMGSetResidual.<br clear="none">
><br clear="none">
>      I tried to call PCMGGetCoarseSolve(pc, &kcpc) and subsequently<br clear="none">
>      KSPGetOperators (kspc, ... ) to check how the coarse grid operator is defined<br clear="none">
>      after calling DMCoarsenHierarchy, but that failed.<br clear="none">
><br clear="none">
>      I am solving Helmholtz with shifted Laplace, and managed to exploit DMDA to perform<br clear="none">
>      a multigrid solve on the preconditioner. In a next stage I want to implement the deflation<br clear="none">
>      using DMDA as well.<br clear="none">
><br clear="none">
> 2) On <a rel="nofollow" shape="rect" href="http://www.mcs.anl.gov/petsc/documentation/referencing.html" target="_blank">http://www.mcs.anl.gov/petsc/documentation/referencing.html</a> I see<br clear="none">
><br clear="none">
> @Misc{petsc-web-page,<br clear="none">
>             author = {Satish Balay and Shrirang Abhyankar and Mark~F. Adams and Jed Brown and Peter Brune<br clear="none">
>                       and Kris Buschelman and Lisandro Dalcin and Victor Eijkhout and William~D. Gropp<br clear="none">
>                       and Dinesh Kaushik and Matthew~G. Knepley<br clear="none">
>                       and Lois Curfman McInnes and Karl Rupp and Barry~F. Smith<br clear="none">
>                       and Stefano Zampini and Hong Zhang and Hong Zhang},<br clear="none">
>             title =  {{PETS}c {W}eb page},<br clear="none">
>             url =    {<a rel="nofollow" shape="rect" href="http://www.mcs.anl.gov/petsc" target="_blank">http://www.mcs.anl.gov/petsc</a>},<br clear="none">
>             howpublished = {\url{<a rel="nofollow" shape="rect" href="http://www.mcs.anl.gov/petsc%7D" target="_blank">http://www.mcs.anl.gov/petsc}</a>},<br clear="none">
>             year = {2016}<br clear="none">
>           }<br clear="none">
><br clear="none">
><br clear="none">
><br clear="none">
> Is the last author mentioned twice intentionally?<br clear="none">
><br clear="none">
> 3) On <a rel="nofollow" shape="rect" href="http://www.mcs.anl.gov/petsc/publications/petscapps-bib.html#OpenFOAM%202.2.1" target="_blank">http://www.mcs.anl.gov/petsc/publications/petscapps-bib.html#OpenFOAM%202.2.1</a> I see<br clear="none">
><br clear="none">
> @misc{OpenFOAM<br clear="none">
> ,<br clear="none">
><br clear="none">
><br clear="none">
> title =       "OpenFOAM",<br clear="none">
><br clear="none">
> howpublished  =       "\url{<a rel="nofollow" shape="rect" href="http://www.openfoam.com/" target="_blank">http://www.openfoam.com</a>}",<br clear="none">
><br clear="none">
> url   =       {<a rel="nofollow" shape="rect" href="http://www.openfoam.com/" target="_blank">http://www.openfoam.com</a>},<br clear="none">
><br clear="none">
> note  =       "OpenFOAM is a free, open source CFD software package. It allows PETSc linear algebra and solvers to be used underneath.",<br clear="none">
><br clear="none">
> key   =       "OpenFOAM 2.2.1"<br clear="none">
><br clear="none">
> }<br clear="none">
><br clear="none">
><br clear="none">
> Do you have more information on the use of PETSc within OpenFoam?<br clear="none">
<br clear="none">
</div></div>  Very good question. It seems that this citation is wrong or no longer valid; I have removed it from the PETSc repository. I could find no mention of PETSc usage in the OpenFoam and its third party packages. I think we should not have been listing this citation.</blockquote><div><br clear="none"></div><div>This suggests that people are using it with OpenFOAM: <a rel="nofollow" shape="rect" href="http://powerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/PatersonNuTTS2009.pdf" target="_blank">http://powerlab.fsb.hr/ped/kturbo/OpenFOAM/slides/PatersonNuTTS2009.pdf</a></div><div><br clear="none"></div><div>In fact, they use PETSc in the dynamic overset grid implementation for OpenFOAM, which I think is an approved extension:</div><div><br clear="none"></div><div>  <a rel="nofollow" shape="rect" href="http://web.student.chalmers.se/groups/ofw5/Abstracts/DavidBogerAbstractOFW5.pdf" target="_blank">http://web.student.chalmers.se/groups/ofw5/Abstracts/DavidBogerAbstractOFW5.pdf</a></div><div><div><br clear="none"></div><div>     Matt</div><div> </div></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><span><font color="#888888"><br clear="none">
   Barry<br clear="none">
</font></span></div><div><div><div><br clear="none">
><br clear="none">
> 4) @matt in response to a question he raised in Vienna<br clear="none">
><br clear="none">
> MIPSE is a BEM solver. Details are on:<br clear="none">
> <a rel="nofollow" shape="rect" href="http://www.g2elab.grenoble-inp.fr/plateforms/mipse-modeling-of-interconnected-power-systems-632862.kjsp?RH=G2ELAB_R-MAGE" target="_blank">http://www.g2elab.grenoble-inp.fr/plateforms/mipse-modeling-of-interconnected-power-systems-632862.kjsp?RH=G2ELAB_R-MAGE</a><br clear="none">
><br clear="none">
> Cheers, Domenico Lahaye.</div><br clear="none">
><br clear="none">
<br clear="none"><span><font color="#888888">
</font></span></div></div></blockquote></div><span><font color="#888888"><br clear="none"><br clear="all"></font></span><div><br clear="none"></div>-- <br clear="none"><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 clear="none">-- Norbert Wiener</div><div><div>
</div></div></div></div></div></div><div><br clear="none"><br clear="none"></div></div><div> </div></div><div> </div></div><div>  </div></div></div></div></blockquote></div><div><br clear="none"><br clear="all"><div><br clear="none"></div>-- <br clear="none"><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 clear="none">-- Norbert Wiener</div>
</div></div></div></div></div><br><br></div> </div></div></div> </div>  </div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="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>