Skip to content

Commit 153f223

Browse files
filoferraFilippo Ferrazzini
andauthored
Fix DMStagGetIndices vertex range (no extra points for periodic BCs) (#234)
Co-authored-by: Filippo Ferrazzini <filippo.ferrazzini@gmail.com>
1 parent cd4ba86 commit 153f223

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/dmstag.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,16 +341,17 @@ function DMStagGetIndices(dm::PetscDM{PetscLib}) where {PetscLib}
341341
Diff = c.lower - gc.lower;
342342
Start = c.lower + Diff;
343343
End = Start + CartesianIndex(c.size) - CartesianIndex(1,1,1) ;
344+
Nextra = c.nextra
344345

345346
# Note that we add the shift for julia/petsc consistency
346347
shift = 0;
347348
center = ( x= Start[1]:End[1],
348349
y= Start[2]:End[2],
349350
z= Start[3]:End[3] )
350351

351-
vertex = ( x= Start[1]:End[1]+1 ,
352-
y= Start[2]:End[2]+1 ,
353-
z= Start[3]:End[3]+1 )
352+
vertex = ( x= Start[1]:End[1]+Nextra[1] ,
353+
y= Start[2]:End[2]+Nextra[2] ,
354+
z= Start[3]:End[3]+Nextra[3] )
354355

355356
return (center=center, vertex=vertex)
356357

0 commit comments

Comments
 (0)