<html><head></head><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:16px"><div id="yui_3_16_0_1_1468907431186_147274"><span id="yui_3_16_0_1_1468907431186_147295">Thanks Barry. </span></div><div id="yui_3_16_0_1_1468907431186_147274"><span><br></span></div><div id="yui_3_16_0_1_1468907431186_147274" dir="ltr">I will give it a look. If not before my holidays, than in the second half of August. </div><div id="yui_3_16_0_1_1468907431186_147274" dir="ltr"><br></div><div id="yui_3_16_0_1_1468907431186_147274" dir="ltr">Best wishes. Domenico. </div><div id="yui_3_16_0_1_1468907431186_147274"><br></div><div id="yui_3_16_0_1_1468907431186_147274"><br></div><div></div><div id="yui_3_16_0_1_1468907431186_147277"> <b style="font-family: Arial;">From:</b><span style="font-family: Arial; font-size: small;"> Barry Smith <bsmith@mcs.anl.gov></span></div><div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" id="yui_3_16_0_1_1468907431186_147290" style="display: block;"><div style="font-family: times new roman, new york, times, serif; font-size: 16px;" id="yui_3_16_0_1_1468907431186_147288"><div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_1_1468907431186_147286"><div dir="ltr" id="yui_3_16_0_1_1468907431186_147284"><font size="2" face="Arial" id="yui_3_16_0_1_1468907431186_147283"> <b id="yui_3_16_0_1_1468907431186_147294"><span style="font-weight: bold;" id="yui_3_16_0_1_1468907431186_147293">To:</span></b> domenico lahaye <domenico_lahaye@yahoo.com> <br><b id="yui_3_16_0_1_1468907431186_147292"><span style="font-weight: bold;" id="yui_3_16_0_1_1468907431186_147291">Cc:</span></b> "petsc-users@mcs.anl.gov" <petsc-users@mcs.anl.gov><br> <b><span style="font-weight: bold;">Sent:</span></b> Sunday, July 24, 2016 2:52 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [petsc-users] Regarding ksp ex42 - Citations<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_1_1468907431186_147429"><br><br clear="none"> Took a little more time than I expected but the branch barry/extend-pcmg-galerkin now supports <br clear="none"><br clear="none">PCMGSetGalerkin() and -pc_mg_galerkin now take PC_MG_GALERKIN_BOTH,PC_MG_GALERKIN_PMAT,PC_MG_GALERKIN_MAT, PC_MG_GALERKIN_NONE as arguments instead of PetscBool<br clear="none">This allows computing either mat, or pmat or both via the Galerkin process<br clear="none"><br clear="none">so you should be able to provide A and M with KSPSetOperators() and then run with -pc_mg_galerkin both to get both generated on the coarse meshes via the Galekin process. Note that if you use the additional option -pc_use_amat false it will use only the M for both mat and pmat in the multigrid process (while A is only used for the outer Krylov solver definition of the operator.) For some problems this is actually a better approach.<br clear="none"><br clear="none"><br clear="none"> Please let me know if you have any difficulties with it.<br clear="none"><br clear="none">Barry<br clear="none"><div class="yqt4568029077" id="yqtfd94864"><br clear="none">> On Jul 22, 2016, at 3:42 AM, domenico lahaye <<a shape="rect" ymailto="mailto:domenico_lahaye@yahoo.com" href="mailto:domenico_lahaye@yahoo.com">domenico_lahaye@yahoo.com</a>> wrote:<br clear="none">> <br clear="none">> Dear Barry, <br clear="none">> <br clear="none">> Thank you for your suggestion. <br clear="none">> <br clear="none">> I will be happy to test drive the new code when available. <br clear="none">> <br clear="none">> Kind wishes, Domenico. <br clear="none">> <br clear="none">> <br clear="none">> <br clear="none">> From: Barry Smith <<a shape="rect" ymailto="mailto:bsmith@mcs.anl.gov" href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>><br clear="none">> To: Lawrence Mitchell <<a shape="rect" ymailto="mailto:lawrence.mitchell@imperial.ac.uk" href="mailto:lawrence.mitchell@imperial.ac.uk">lawrence.mitchell@imperial.ac.uk</a>> <br clear="none">> Cc: domenico lahaye <<a shape="rect" ymailto="mailto:domenico_lahaye@yahoo.com" href="mailto:domenico_lahaye@yahoo.com">domenico_lahaye@yahoo.com</a>>; PETSc Users List <<a shape="rect" ymailto="mailto:petsc-users@mcs.anl.gov" href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>><br clear="none">> Sent: Friday, July 22, 2016 1:41 AM<br clear="none">> Subject: Re: [petsc-users] Regarding ksp ex42 - Citations<br clear="none">> <br clear="none">> <br clear="none">> I'll add support for handling both A and M via Galerkin. It is easy to write the code, picking a good simple API that doesn't break anything is more difficult. I'm leaning to change PCMGSetGalerkin(PC,PetscBool) to PCMGSetGalerkin(PC, PCMGGalerkinType) where <br clear="none">> <br clear="none">> typedef enum { PC_MG_GALERKIN_BOTH,PC_MG_GALERKIN_PMAT,PC_MG_GALERKIN_MAT, PC_MG_GALERKIN_NONE<br clear="none">> } PCMGGalerkinType;<br clear="none">> <br clear="none">> Barry<br clear="none">> <br clear="none">> <br clear="none">> <br clear="none">> > On Jul 21, 2016, at 6:09 AM, Lawrence Mitchell <<a shape="rect" ymailto="mailto:lawrence.mitchell@imperial.ac.uk" href="mailto:lawrence.mitchell@imperial.ac.uk">lawrence.mitchell@imperial.ac.uk</a>> wrote:<br clear="none">> > <br clear="none">> > <br clear="none">> >> On 21 Jul 2016, at 10:55, domenico lahaye <<a shape="rect" ymailto="mailto:domenico_lahaye@yahoo.com" href="mailto:domenico_lahaye@yahoo.com">domenico_lahaye@yahoo.com</a>> wrote:<br clear="none">> >> <br clear="none">> >> Apologies for being not sufficient clear in my previous message.<br clear="none">> >> <br clear="none">> >> I would like to be able to Galerkin coarsen A^h to obtain A^H<br clear="none">> >> and to separately Galerkin coarsen M^h to obtain M^H.<br clear="none">> >> <br clear="none">> >> So, yes, the way in which I currently (partially) understand your<br clear="none">> >> description of the new DMCreateMatrices would do the job.<br clear="none">> > <br clear="none">> > If you want to separately coarsen A and M via Galerkin, I think it will be easier to just change the code in PCSetUp_MG to handle the case where A and M are different on the coarse levels. Effectively you just need to replicate the code that computes the coarse grid "B" matrix to separately compute coarse grid A and B matrices and pass them in to KSPSetOperators.<br clear="none">> > <br clear="none">> > Cheers,<br clear="none">> > <br clear="none">> > Lawrence<br clear="none">> > <br clear="none">> <br clear="none">> <br clear="none"></div><br><br></div> </div> </div> </div></div></body></html>