[petsc-users] Update DMDA attached to DMSWARM

Matthew Knepley knepley at gmail.com
Fri Jan 17 09:00:46 CST 2025


On Fri, Jan 17, 2025 at 9:45 AM MIGUEL MOLINOS PEREZ <mmolinos at us.es> wrote:

> I tried what you suggested, but still I got this error message. Maybe I
> should use main release?
>

No. I suspect something is wrong with the way you are setting coordinates.
Can you share the code?

  Thanks,

     Matt


> Miguel
>
> [4]PETSC ERROR:
> ------------------------------------------------------------------------
> [4]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation,
> probably memory access out of range
> [4]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
> [4]PETSC ERROR: or see https://urldefense.us/v3/__https://petsc.org/release/faq/*valgrind__;Iw!!G_uCfscf7eWS!fRsK-PFNSlripVuSruNIQ68cC07TBw84XzXS8GiZFt5Und2Bn4pktbwZWLLMUnYQSUJWt9KgT-B7uNoaftse$  and
> https://urldefense.us/v3/__https://petsc.org/release/faq/__;!!G_uCfscf7eWS!fRsK-PFNSlripVuSruNIQ68cC07TBw84XzXS8GiZFt5Und2Bn4pktbwZWLLMUnYQSUJWt9KgT-B7uPrfhqQG$ 
> [4]PETSC ERROR: ---------------------  Stack Frames
> ------------------------------------
> [4]PETSC ERROR: The line numbers in the error traceback are not always
> exact.
> [4]PETSC ERROR: #1 Pack_PetscReal_1_0() at
> /Users/migmolper/petsc/src/vec/is/sf/impls/basic/sfpack.c:373
> [4]PETSC ERROR: #2 PetscSFLinkPackRootData_Private() at
> /Users/migmolper/petsc/src/vec/is/sf/impls/basic/sfpack.c:932
> [4]PETSC ERROR: #3 PetscSFLinkPackRootData() at
> /Users/migmolper/petsc/src/vec/is/sf/impls/basic/sfpack.c:966
> [4]PETSC ERROR: #4 PetscSFBcastBegin_Basic() at
> /Users/migmolper/petsc/src/vec/is/sf/impls/basic/sfbasic.c:357
> [4]PETSC ERROR: #5 PetscSFBcastWithMemTypeBegin() at
> /Users/migmolper/petsc/src/vec/is/sf/interface/sf.c:1513
> [4]PETSC ERROR: #6 VecScatterBegin_Internal() at
> /Users/migmolper/petsc/src/vec/is/sf/interface/vscat.c:70
> [4]PETSC ERROR: #7 VecScatterBegin() at
> /Users/migmolper/petsc/src/vec/is/sf/interface/vscat.c:1316
> [4]PETSC ERROR: #8 DMGlobalToLocalBegin_DA() at
> /Users/migmolper/petsc/src/dm/impls/da/dagtol.c:15
> [4]PETSC ERROR: #9 DMGlobalToLocalBegin() at
> /Users/migmolper/petsc/src/dm/interface/dm.c:2844
> [4]PETSC ERROR: #10 DMGetCoordinatesLocalSetUp() at
> /Users/migmolper/petsc/src/dm/interface/dmcoordinates.c:565
> [4]PETSC ERROR: #11 DMGetCoordinatesLocal() at
> /Users/migmolper/petsc/src/dm/interface/dmcoordinates.c:599
> [4]PETSC ERROR: #12 _DMLocatePoints_DMDARegular_IS() at
> /Users/migmolper/DMD/SOLERA/Atoms/Atom.cpp:531
> [4]PETSC ERROR: #13 DMLocatePoints_DMDARegular() at
> /Users/migmolper/DMD/SOLERA/Atoms/Atom.cpp:586
> [4]PETSC ERROR: #14 DMLocatePoints() at
> /Users/migmolper/petsc/src/dm/interface/dmcoordinates.c:1194
> [4]PETSC ERROR: #15 DMSwarmMigrate_CellDMScatter() at
> /Users/migmolper/petsc/src/dm/impls/swarm/swarm_migrate.c:219
> [4]PETSC ERROR: #16 DMSwarmMigrate() at
> /Users/migmolper/petsc/src/dm/impls/swarm/swarm.c:1349
> [4]PETSC ERROR: #17 main() at
> /Users/migmolper/DMD/driver-tasting-SOLERA.cpp:41
>
>
>
> On Jan 15, 2025, at 4:56 PM, MIGUEL MOLINOS PEREZ <mmolinos at us.es> wrote:
>
> Thank you Matt for the useful info. I’ll try your idea.
>
> Miguel
>
> On 15 Jan 2025, at 16:48, Matthew Knepley <knepley at gmail.com> wrote:
>
> 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!fRsK-PFNSlripVuSruNIQ68cC07TBw84XzXS8GiZFt5Und2Bn4pktbwZWLLMUnYQSUJWt9KgT-B7uECqyoJk$ 
>> <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!fRsK-PFNSlripVuSruNIQ68cC07TBw84XzXS8GiZFt5Und2Bn4pktbwZWLLMUnYQSUJWt9KgT-B7uMRJ6J46$ >
>>
>>
>>
>
> --
> 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!fRsK-PFNSlripVuSruNIQ68cC07TBw84XzXS8GiZFt5Und2Bn4pktbwZWLLMUnYQSUJWt9KgT-B7uECqyoJk$ 
> <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!fRsK-PFNSlripVuSruNIQ68cC07TBw84XzXS8GiZFt5Und2Bn4pktbwZWLLMUnYQSUJWt9KgT-B7uMRJ6J46$ >
>
>
>
>

-- 
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!fRsK-PFNSlripVuSruNIQ68cC07TBw84XzXS8GiZFt5Und2Bn4pktbwZWLLMUnYQSUJWt9KgT-B7uECqyoJk$  <https://urldefense.us/v3/__http://www.cse.buffalo.edu/*knepley/__;fg!!G_uCfscf7eWS!fRsK-PFNSlripVuSruNIQ68cC07TBw84XzXS8GiZFt5Und2Bn4pktbwZWLLMUnYQSUJWt9KgT-B7uMRJ6J46$ >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250117/8e37a703/attachment-0001.html>


More information about the petsc-users mailing list