[petsc-users] Difference between DMGetLocalVector and DMCreateLocalVector

2024-02-22 Thread 袁煕
Hello, I found DMGetLocalVector and DMCreateLocalVector generate Vec of different size in my following codes call PetscSectionSetup(section,ierr) call DMSetLocalSection(dm_mesh,section,ierr) ..do something call PetscSectionSetup(section,ierr) call DMSetLocalSection(dm_m

Re: [petsc-users] Difference between DMGetLocalVector and DMCreateLocalVector

2024-02-22 Thread Stefano Zampini
I guess we are missing to clear the internal scratch vectors, matt can confirm Can you please add this call AFTER you set the local section to confirm? call DMClearLocalVectors(dm_mesh, ierr); Il giorno gio 22 feb 2024 alle ore 11:36 袁煕 ha scritto: > Hello, I found DMGetLocalVector and DMCr

Re: [petsc-users] Difference between DMGetLocalVector and DMCreateLocalVector

2024-02-22 Thread Matthew Knepley
You are right. I was not clearing the caches when the section was reset. Stefano ahs fixed this now: https://urldefense.us/v3/__https://gitlab.com/petsc/petsc/-/merge_requests/7314__;!!G_uCfscf7eWS!ZPkq_k9vdzTZxeW53aWVTIcDgeGnywSm0tGKDJkJqdwgTomfYjw1lsTMyRtAjtruSslcgLIoKGg7IILlBxbJ$ Thanks