Actual source code: ex26.c
2: static char help[] = "Tests error message in DAGetColoring() with periodic boundary conditions. \n\n";
5: #include petscda.h
6: #include petscmat.h
10: int main(int argc,char **argv)
11: {
12: Mat J;
14: DA da;
15: MatFDColoring matfdcoloring = 0;
16: ISColoring iscoloring;
18: PetscInitialize(&argc,&argv,(char *)0,help);
19: /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
20: Create distributed array (DA) to manage parallel grid and vectors
21: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
22: DACreate2d(PETSC_COMM_WORLD,DA_XPERIODIC,DA_STENCIL_BOX,-5,-5,
23: PETSC_DECIDE,PETSC_DECIDE,1,2,0,0,&da);
24: DAGetMatrix(da,MATAIJ,&J);
25: DAGetColoring(da,IS_COLORING_GHOSTED,MATAIJ,&iscoloring);
26: MatFDColoringCreate(J,iscoloring,&matfdcoloring);
27: ISColoringDestroy(iscoloring);
29: /* free spaces */
30: MatDestroy(J);
31: MatFDColoringDestroy(matfdcoloring);
32: DADestroy(da);
33: PetscFinalize();
34: return(0);
35: }