Commits

Peter Brune committed 6774142

Complex fixes for classical

Comments (0)

Files changed (1)

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

 
     /* create the local and global sparsity patterns */
     for (c = 0; c < ncols; c++) {
-      if (PetscAbsScalar(rval[c]) > gamg->threshold*Amax[r]) {
+      if (PetscAbsScalar(rval[c]) > gamg->threshold*PetscRealPart(Amax[r])) {
         idx++;
       }
     }
       idx = 0;
       ierr = MatGetRow(gA,r,&ncols,&rcol,&rval);CHKERRQ(ierr);
       for (c = 0; c < ncols; c++) {
-        if (PetscAbsScalar(rval[c]) > gamg->threshold*Amax[r]) {
+        if (PetscAbsScalar(rval[c]) > gamg->threshold*PetscRealPart(Amax[r])) {
           idx++;
         }
       }
     idx = 0;
     for (c = 0; c < ncols; c++) {
       /* classical strength of connection */
-      if (PetscAbsScalar(rval[c]) > gamg->threshold*Amax[r-s]) {
+      if (PetscAbsScalar(rval[c]) > gamg->threshold*PetscRealPart(Amax[r-s])) {
         gcol[idx] = rcol[c];
         gval[idx] = rval[c];
         idx++;