On Tue, Mar 15, 2022 at 9:33 AM Joauma Marichal < [email protected]> wrote:
> Hello, > > I am writing to you as I am trying to implement a Lagrangian Particle > Tracking method to my eulerian solver that relies on a 3D DMDA. To that > end, I want to use the DMSwarm library but cannot find much documentation > on it. Is there any examples that you would recommend for this specific > application? I understood the very basics but do not really understand how > to use the following fields: DMSwarm_pid, DMSwarmPIC_coor and > DMSwarm_cellid. > I also understood that particles could be moved from one processor to > another using DMSwarm_rank and the migrate functions. However, is there any > way to link directly the coordinates of my particle to the processor on > which it should be stored? > I was trying to do a similar thing. Here is my attempt: https://gitlab.com/petsc/petsc/-/blob/main/src/ts/tutorials/ex77.c It is simple, but hopefully how you integrate the particles in is somewhat clear. DMSwarmPIC_coor is the coordinate field, and it is updated by the user. Then you call DMSwarmMigrate() to move the particles to the appropriate process. DMSwarm_cellid is the cell number of the cell that contains each particle. It is updated by Migrate(). Thanks, Matt > Thanks a lot for your help. > > Best regards, > Joauma > > -- 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://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
