static char help[] = "Tests DMCreateDomainDecomposition.\n\n"; /* Use the options -da_grid_x - number of grid points in x direction, if M < 0 -da_grid_y - number of grid points in y direction, if N < 0 -da_processors_x number of processors in x directio -da_processors_y number of processors in x direction */ #include #include PetscErrorCode FillLocalSubdomain(DM da, Vec gvec) { DMDALocalInfo info; PetscMPIInt rank; PetscInt i,j,k,l; PetscFunctionBeginUser; PetscCallMPI(MPI_Comm_rank(PETSC_COMM_WORLD,&rank)); PetscCall(DMDAGetLocalInfo(da,&info)); if (info.dim == 3) { PetscScalar ***g; PetscCall(DMDAVecGetArray(da,gvec,&g)); /* loop over ghosts */ for (k=info.zs; k