Hi,

I would like to modify src/ksp/ksp/tutorials/ex45.c to implement Dirichlet 
boundary conditions using DM_BOUNDARY_GHOSTED instead of using DM_BOUNDARY_NONE 
and explicitly implementing the boundary by adding diagnonal-only rows.

My assumption was that with DM_BOUNDARY_GHOSTED all vectors from that DM have 
the extra memory for the ghost entries and that I can basically use 
DMDAGetGhostCorners instead of DMDAGetCorners to access the array gotten via 
DMDAVecGetArray. But when I access (gxs, gys, gzs) = (-1,-1,-1) I get a 
segmentation fault. When looking at the implementation of DMDAVecGetArray it 
looked to me as if accessing (-1, -1, -1) should work as DMDAVecGetArray passes 
the ghost corners to VecGetArray3d which then adds the right offsets.

I could not find any example using DM_BOUNDARY_GHOSTED and then actually 
accessing the ghost/boundary elements. Can I assume that they are set to zero 
for the solution vector, i.e. the u=0 on \del\Omega and I do not need to access 
them at all?

Best,
Paul Große-Bley

Reply via email to