On Wed, Dec 21, 2022 at 1:34 PM Matteo Semplice < matteo.sempl...@uninsubria.it> wrote:
> Dear Matt, > > I am trying to translate the local nCell numbers returned by swarm > particle location routines into the global (i,j,k) indices in the dmda > and I have run into some oddities in the 3d case. I have dug into the > private_DMDALocatePointsIS_2D_Regular and > private_DMDALocatePointsIS_3D_Regular routines and, using 14 points per > direction and 1 ghost for the DMDA, on 2 cpus: > > - the 2d routine thinks to have 13x6 Q1 elements on cpu0 and 13x7 on cpu > 1 (which looks correct to me as 6+7 makes 13 elements in the y direction) > > - the 2d routine thinks to have 13x13x6 elements on cpu0 and 13x13x8 on > cpu1 (which looks one too many) > > Removing lines 155-157 from src/dm/impls/da/dageometry.c (patch > attached) seems to fix some things in my code. I have not studied in > depth the code of private_DMDALocatePointsIS_3D_Regular, but I have seen > that the left shift of xs,ys,zs are already performed at lines 137-139. > > Could you have a look, please? > > (This looked more appropriate for petsc-dev than petsc-users, but I am > not a subscriber, so could you please reply to me directly as well?) > Dang! You can see it was fixed in 2D but not in 3D. Thanks for finding this. I put it in this branch knepley/fix-da-point-location which is the last one I mailed you. Matt > Thanks > > 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/>