<div dir="ltr"><div dir="ltr">On Sun, Aug 28, 2022 at 12:44 PM Nicholas Arnold-Medabalimi <<a href="mailto:narnoldm@umich.edu">narnoldm@umich.edu</a>> wrote:<br></div><div class="gmail_quote"><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 <br><br>I'm working on a finite volume implementation using DMPlex. I was wondering what the best-considered way to add cell variables to the DM that we don't want to be part of the ksp/snes solve. As far as I can tell, if I add an extra section with those, they will still be part of the F and U vectors in the solver callbacks (to be expected). But my impression is that that will just inflate the system size even if they have an F=0? Or is the solver able to notice variables that are not dependent for the solve.<br><br>Alternatively, I have been just making a separate DM with those but that feels a bit clunky especially if any mesh refinement occurs. <br></div></blockquote><div><br></div><div>Mark is correct. We have been using a two DM strategy. You can attach this auxiliary data using</div><div><br></div><div>  <a href="https://petsc.org/main/docs/manualpages/DM/DMSetAuxiliaryVec/">https://petsc.org/main/docs/manualpages/DM/DMSetAuxiliaryVec/</a></div><div><br></div><div>The idea is that you define a layout for your extra information using a new DM, then create a Vec for it, and attach it to the DM. This</div><div>can  be pulled out by any callback function, and the DM can be pulled out of the vector. In the Plex pointwise functions for residual</div><div>and Jacobian, auxiliary data is automatically interpolated to the quadrature points as well.</div><div><br></div><div>Is this what you were looking for?</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:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Any advice would be much appreciated.<br><br>Thanks<br>Nicholas<br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div style="font-family:arial;font-size:small"><font color="#000000">Nicholas Arnold-Medabalimi<br><br></font><span style="font-family:sans-serif;font-size:14px">Ph.D. Candidate</span><font color="#000000"><br>Computational Aeroscience Lab<br>University of Michigan</font></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_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>