Commits

Jed Brown committed 48aa37d Merge

Merge branch 'madams/gamg-aggasm'

* madams/gamg-aggasm:
some fixes in using AMG 'aggregates' in GASM smoothers

Comments (0)

Files changed (1)

src/ksp/pc/impls/gamg/gamg.c

       } else Parr[level1] = NULL;
 
       if (pc_gamg->use_aggs_in_gasm) {
+        PetscInt bs;
+        ierr = MatGetBlockSizes(Prol11, &bs, NULL);CHKERRQ(ierr);
         ierr = PetscCDGetASMBlocks(agg_lists, bs, &nASMBlocksArr[level], &ASMLocalIDsArr[level]);CHKERRQ(ierr);
       }
 
       /* set defaults */
       ierr = KSPSetType(smoother, KSPCHEBYSHEV);CHKERRQ(ierr);
 
-      /* override defaults and command line args (!) */
+      /* set blocks for GASM smoother that uses the 'aggregates' */
       if (pc_gamg->use_aggs_in_gasm) {
         PetscInt sz;
         IS       *is;
         sz   = nASMBlocksArr[level];
         is   = ASMLocalIDsArr[level];
         ierr = PCSetType(subpc, PCGASM);CHKERRQ(ierr);
+        ierr = PCGASMSetOverlap(subpc, 0);CHKERRQ(ierr);
         if (sz==0) {
           IS       is;
           PetscInt my0,kk;
           }
           ierr = PetscFree(is);CHKERRQ(ierr);
         }
-        ierr = PCGASMSetOverlap(subpc, 0);CHKERRQ(ierr);
-
         ASMLocalIDsArr[level] = NULL;
         nASMBlocksArr[level]  = 0;
         ierr                  = PCGASMSetType(subpc, PC_GASM_BASIC);CHKERRQ(ierr);