[petsc-users] locate DMSwarm particles with respect to a background DMDA mesh

Semplice Matteo matteo.semplice at uninsubria.it
Thu Oct 27 10:57:20 CDT 2022


Dear Petsc developers,
    I am trying to use a DMSwarm to locate a cloud of points with respect to a background mesh. In the real application the points will be loaded from disk, but I have created a small demo in which

  *   each processor creates Npart particles, all within the domain covered by the mesh, but not all in the local portion of the mesh
  *   migrate the particles

After migration most particles are not any more in the DMSwarm (how many and which ones seems to depend on the number of cpus, but it never happens that all particle survive the migration process).

I am clearly missing some step, since I'd expect that a DMDA would be able to locate particles without the need to go through a DMShell as it is done in src/dm/tutorials/swarm_ex3.c.html<https://petsc.org/main/src/dm/tutorials/swarm_ex3.c.html>

I attach my demo code.

Could someone give me a hint?

Best
    Matteo

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20221027/c9362fa4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dmSwarmDemo.cpp
Type: text/x-c++src
Size: 4868 bytes
Desc: dmSwarmDemo.cpp
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20221027/c9362fa4/attachment.bin>


More information about the petsc-users mailing list