Commits

sarich committed 155b6e5

tao: fix eptorsion2 warning

  • Participants
  • Parent commits fc217af
  • Branches sarich/fix-tao-example-warning

Comments (0)

Files changed (1)

File src/tao/unconstrained/examples/tutorials/eptorsion2.c

     if (ksp) {
       ierr = KSPGetPC(ksp,&pc);CHKERRQ(ierr);
       ierr = PCSetType(pc,PCNONE);CHKERRQ(ierr);
-    }
+    } else {
+    /* So no warnings are given if no ksp is used */
+    ierr = PetscOptionsHasName(PETSC_NULL,"-pc_type",&flg);CHKERRQ(ierr);
+    ierr = PetscOptionsHasName(PETSC_NULL,"-ksp_type",&flg);CHKERRQ(ierr);
+  }
 
     /* SOLVE THE APPLICATION */
     ierr = TaoSolve(tao); CHKERRQ(ierr);