<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Mar 20, 2020 at 6:26 PM Xiaodong Liu <<a href="mailto:xliu29@ncsu.edu">xliu29@ncsu.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi, Petsc team, <div> </div><div>I am practising PCMG using the following case (3DQ1)</div><div><a href="https://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/examples/tutorials/ex45.c.html" target="_blank">https://www.mcs.anl.gov/petsc/petsc-current/src/ksp/ksp/examples/tutorials/ex45.c.html</a> </div><div><br></div><div>I have several questions. </div><div><b>1) About the interpolation and restriction matrix</b></div><div><br></div><div>For both Galerkin and non-Galerkin type, the interpolation matrix P is based on the trilinear interpolation (<i>I found the source code</i>) and the restriction one R is 1/8*P^T?</div></div></blockquote><div><br></div><div>That sounds right if the course grid operator is not Galerkin. If it Galerkin you do not need the 1/8 scaling.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><i>Could you please tell me where the source code to define the restriction matrix is? </i></div><div><b>2) About the operator on the coarse level</b></div><div><br></div><div> It is straightforward to calculate the operator on the coarse level for Galerkin type by R*A*P. But how did you define the operator for non-Galerkin type? Did you use DMRestrict ? </div></div></blockquote><div><br></div><div>When I have these questions I just search for where restricthook is set. Or run a debugger and step through the code. Maybe someone else knows this.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Could you please tell me where is the source code to define </div><div>(*link->restricthook)(fine,restrct,rscale,inject,coarse,link->ctx);<br></div><div>in</div><div>2933: PetscErrorCode DMRestrict(DM fine,Mat restrct,Vec rscale,Mat inject,DM coarse)<br>2934: {<br>2935: PetscErrorCode ierr;<br>2936: DMCoarsenHookLink link;<br><br>2939: for (link=fine->coarsenhook; link; link=link->next) {<br>2940: if (link->restricthook) {<br>2941: (*link->restricthook)(fine,restrct,rscale,inject,coarse,link->ctx);<br>2942: }<br>2943: }<br>2944: return(0);<br>2945: }<br></div><div>on </div><div><a href="https://www.mcs.anl.gov/petsc/petsc-current/src/dm/interface/dm.c.html#DMRestrict" target="_blank">https://www.mcs.anl.gov/petsc/petsc-current/src/dm/interface/dm.c.html#DMRestrict</a> <br></div><div><br></div><div>Thanks a lot !</div><div>Take care!</div><div>Xiaodong </div><div><br></div><div> </div><div><br clear="all"><div><div dir="ltr"><div dir="ltr"><div>Xiaodong Liu, PhD<br>X: Computational Physics Division<br>Los Alamos National Laboratory<br>P.O. Box 1663, <br>Los Alamos, NM 87544<br>505-709-0534<br></div></div></div></div></div></div>
</blockquote></div></div>