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

Matthew Knepley knepley at gmail.com
Thu Nov 3 20:43:28 CDT 2022


On Thu, Nov 3, 2022 at 8:36 PM Matthew Knepley <knepley at gmail.com> wrote:

> On Thu, Oct 27, 2022 at 11:57 AM Semplice Matteo <
> matteo.semplice at uninsubria.it> wrote:
>
>> 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?
>>
>
> Thanks for sending this. I found the problem. Someone has some overly
> fancy code inside DMDA to figure out the local bounding box from the
> coordinates.
> It is broken for DM_BOUNDARY_GHOSTED, but we never tested with this. I
> will fix it.
>

Okay, I think this fix is correct

  https://gitlab.com/petsc/petsc/-/merge_requests/5802

I incorporated your test as src/dm/impls/da/tests/ex1.c. Can you take a
look and see if this fixes your issue?

  Thanks,

     Matt


>   Thanks,
>
>      Matt
>
>
>> Best
>>     Matteo
>>
>>
>
> --
> 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/>
>


-- 
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/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20221103/faabf2a5/attachment-0001.html>


More information about the petsc-users mailing list