[petsc-users] FD Dirichlet boundary conditions with ghosted DMDA

Adrian Croucher a.croucher at auckland.ac.nz
Wed Mar 18 22:28:24 CDT 2015


>    Use either the results for DMDAGetGhostCorners() or DMDAGetCorners() to determine if the first or last node is local. This extends trivially to 2 and 3d. See for example src/ksp/ksp/examples/tutorials/ex34.c ComputeMatrix() if (i==0 || j==0 || k==0 || i==mx-1 || j==my-1 || k==mz-1) { etc

Aha, of course. Thanks, that works great.

- Adrian

-- 
Dr Adrian Croucher
Senior Research Fellow
Department of Engineering Science
University of Auckland, New Zealand
email: a.croucher at auckland.ac.nz
tel: +64 (0)9 923 84611



More information about the petsc-users mailing list