static char help[] = "Test MatAXPY and SUBSET_NONZERO_PATTERN [-different] [-skip]\n by default subset pattern is used \n\n"; /* A test contributed by Jose E. Roman, Oct. 2014 */ #include int main(int argc,char **args) { Mat A,B,C; PetscBool different=PETSC_FALSE,skip=PETSC_FALSE; PetscInt m0,m1,n=128,i; PetscCall(PetscInitialize(&argc,&args,(char*)0,help)); PetscCall(PetscOptionsGetBool(NULL,NULL,"-different",&different,NULL)); PetscCall(PetscOptionsGetBool(NULL,NULL,"-skip",&skip,NULL)); /* Create matrices A = tridiag(1,-2,1) and B = diag(7); */ PetscCall(MatCreate(PETSC_COMM_WORLD,&A)); PetscCall(MatCreate(PETSC_COMM_WORLD,&B)); PetscCall(MatSetSizes(A,PETSC_DECIDE,PETSC_DECIDE,n,n)); PetscCall(MatSetSizes(B,PETSC_DECIDE,PETSC_DECIDE,n,n)); PetscCall(MatSetFromOptions(A)); PetscCall(MatSetFromOptions(B)); PetscCall(MatSetUp(A)); PetscCall(MatSetUp(B)); PetscCall(MatGetOwnershipRange(A,&m0,&m1)); for (i=m0;i0) PetscCall(MatSetValue(A,i,i-1,-1.0,INSERT_VALUES)); if (i ex172.tmp 2>&1 output_file: output/ex172.out test: suffix: mpibaij nsize: 4 args: -mat_type baij> ex172.tmp 2>&1 output_file: output/ex172.out test: suffix: mpisbaij nsize: 4 args: -mat_type sbaij> ex172.tmp 2>&1 output_file: output/ex172.out test: suffix: sbaij args: -mat_type sbaij> ex172.tmp 2>&1 output_file: output/ex172.out TEST*/