<div dir="ltr"><div dir="ltr">On Sun, Apr 30, 2023 at 1:12 PM Matthew Young <<a href="mailto:myoung.space.science@gmail.com">myoung.space.science@gmail.com</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"><div>Hi all,</div><div><br></div><div>I am developing a particle-in-cell code that models ions as particles and electrons as an inertialess fluid. I use a PIC DMSWARM for the ions, which I gather into density and flux before solving a linear system for the electrostatic potential (phi). I currently have one DMDA with 5 degrees of freedom -- one each for density, 3 flux components, and phi.</div><div><br></div><div>When setting up the linear system to solve for phi, I've been following examples like KSP ex34.c and ex42.c when writing the KSP operator and RHS functions but I'm not sure I have the right approach, since 4 of the DOFs are known and 1 is unknown.</div><div><br></div><div>I saw <a href="https://lists.mcs.anl.gov/pipermail/petsc-users/2016-November/031031.html" target="_blank">this thread</a> that recommended using DMDAGetReducedDMDA, which I gather has been deprecated in favor of DMDACreateCompatibleDMDA. Is that a good approach for managing a regular grid with known and unknown quantities on each node? Could a composite DM be useful? Has anyone else worked on a problem like this?</div></div></blockquote><div><br></div><div>I recommend making a different DM for each kind of solve you want. DMDACreateCompatibleDMDA() should be the implementation of DMClone(), but we have yet to harmonize all things for all DMs. I would create one DM for your Vlasov components and one for the Poisson.</div><div>We follow this strategy in our Vlasov-Poisson test for Landau damping: <a href="https://gitlab.com/petsc/petsc/-/blob/main/src/dm/impls/swarm/tests/ex9.c">https://gitlab.com/petsc/petsc/-/blob/main/src/dm/impls/swarm/tests/ex9.c</a></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"><div><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div>--Matt</div><div dir="ltr">==========================<br></div><div dir="ltr">Matthew Young, PhD (he/him)<div><div><div><div>Research Scientist II</div><div>Space Science Center<br></div></div></div><div>University of New Hampshire</div><div><a href="mailto:Matthew.Young@unh.edu" target="_blank">Matthew.Young@unh.edu</a><br></div></div><div><div dir="ltr"><div dir="ltr">==========================<br></div></div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><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>