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; PetscErrorCode ierr; PetscFunctionBeginUser; ierr = MPI_Comm_rank(PETSC_COMM_WORLD,&rank);CHKERRMPI(ierr); ierr = DMDAGetLocalInfo(da,&info);CHKERRQ(ierr); if (info.dim == 3) { PetscScalar ***g; ierr = DMDAVecGetArray(da,gvec,&g);CHKERRQ(ierr); /* loop over ghosts */ for (k=info.zs; k