<div dir="ltr"><div dir="ltr"><div>Hi,  I'm just wondering if this ties into the issues I brought up in : <a href="https://lists.mcs.anl.gov/pipermail/petsc-dev/2018-October/023615.html">https://lists.mcs.anl.gov/pipermail/petsc-dev/2018-October/023615.html</a> ?<br></div><div><br></div><div>From my perspective, I think I would prefer the copy everything mechanism, but I'm not sure about the nature of the introduced dependencies and if I would have to make extra adjustments from my end.<br><br></div><div>Thanks for any clarification,<br></div><div>-  Boris <br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Oct 26, 2018 at 10:49 AM Matthew Knepley <<a href="mailto:knepley@gmail.com">knepley@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr">I am having a problem, and every solution I can think of would seem to do violence to encapsulation or to DMKSP/DMSNES.<div><br></div><div>I want to have GMG automatically work on the velocity part of Stokes. So I give</div><div><br></div><div>  -fieldsplit_velocity_pc_type mg</div><div><br></div><div>in SNES ex62. This complains that the KSP has a DM but KSPSetComputeOperator() has not been called. It is fine on the global system because SNES called that in SNESSetupMatrices(). Thus in FieldSplit, I inserted<br clear="all"><div><br></div><div><div>          {</div><div>            PetscErrorCode (*func)(KSP,Mat,Mat,void*);</div><div>            void            *ctx;</div><div><br></div><div>            ierr = DMKSPGetComputeOperators(pc->dm, &func, &ctx);CHKERRQ(ierr);</div><div>            ierr = DMKSPSetComputeOperators(dms[i],  func,  ctx);CHKERRQ(ierr);</div><div>          }</div></div><div><br></div><div>where we call KSPSetDM(). However, this does not work, because the subDM has a new DMSNES, which does not have the information about the problem.</div><div><br></div><div>Solution #1:</div><div><br></div><div>  Copy the info from the old DMSNES to the subDMSNES. This inserts a dependence between KSP and SNES which we do not want.</div><div><br></div><div>Solution #2:</div><div><br></div><div>  Have DMCreateSubDM() copy everything from the solvers. This also inserts dependencies, unless we have a "copy everything" mechanism, but is this what we want.</div><div><br></div><div>Solution #3:</div><div><br></div><div>  Rethink DMKSP/DMSNES. Is this how we should store problem information. Dave already had another problem with the organization.</div><div><br></div><div>What should be done? I have never understood this construct very well. Right now, this is holding up doing some computations I need.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt</div>-- <br><div dir="ltr" class="m_2444950667872843158gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><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>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div></div></div>
</blockquote></div>