[petsc-users] Update DMDA attached to DMSWARM

Matthew Knepley knepley at gmail.com
Wed Jan 15 09:48:52 CST 2025


On Wed, Jan 15, 2025 at 10:41 AM MIGUEL MOLINOS PEREZ <mmolinos at us.es>
wrote:

> Thank you Matt.
>
> Yes, I am getting the "CellDM" from the DMSwarm.
>
> 1. I have recently overhauled this functionality because it was not
> flexible enough for the plasma simulation we do. Thus main and release work
> differently.
>
>
> Nice to hear that. Should I move to main?
>

The changes allow you to have several cell DMs. I want to bin particles in
space, but also in velocity, and then in the tensor product of space and
velocity. Moreover, sometimes I want to use different Swarm fields as the
DM field for the solver. You can do all that with main now. If you just
need a single DM with the same DM fields, release is fine.


> 2. I assume you are using release
>
>
> You are correct.
>
> 3. In both main and release, if you change the coordinates of your CellDM
> mesh, you need to rebin the particles. The easiest way to do this is to
> call DMSwarmMigrate(sw, PETSC_FALSE).
>
>
> What do you mean by rebin?
>

When you provide the cell DM, Swrm makes a "sort context" that bins the
particles into DM cells. If you change the coordinates, this binning will
change, so you need it to "rebin" or recreate the sort context.

  Thanks,

    Matt


> Miguel
>
>
>   Thanks,
>
>      Matt
>
>
>> Best,
>> Miguel
>>
> --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
> https://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!cs7VQs2Vvv3qqKf-bK_QjlnDN84TOjBUPDxytpXpB_UrrHMrPPxBGKpOPYbAimaxa64C4W_zvOSRIFCoE9Uo$ 
> <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!cs7VQs2Vvv3qqKf-bK_QjlnDN84TOjBUPDxytpXpB_UrrHMrPPxBGKpOPYbAimaxa64C4W_zvOSRIKc86v-Q$ >
>
>
>

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener

https://urldefense.us/v3/__https://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!cs7VQs2Vvv3qqKf-bK_QjlnDN84TOjBUPDxytpXpB_UrrHMrPPxBGKpOPYbAimaxa64C4W_zvOSRIFCoE9Uo$  <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!cs7VQs2Vvv3qqKf-bK_QjlnDN84TOjBUPDxytpXpB_UrrHMrPPxBGKpOPYbAimaxa64C4W_zvOSRIKc86v-Q$ >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250115/55bb1314/attachment-0001.html>


More information about the petsc-users mailing list