1. petsc
  2. PETSc
  3. petsc

Commits

BarryFSmith  committed c8a43d3

cannot printf a complex number nor use %d for a PetscInt

  • Participants
  • Parent commits f9cfb50
  • Branches master

Comments (0)

Files changed (1)

File src/mat/examples/tests/ex18.c

View file
     for (b=0; b<bs; b++, Ii++) {
       boundary_indices[k*bs+b] = Ii;
       boundary_values[k*bs+b] = v;
-      ierr = PetscSynchronizedPrintf(PETSC_COMM_WORLD, "%d %d %f\n", rank, Ii, v);CHKERRQ(ierr);
+      ierr = PetscSynchronizedPrintf(PETSC_COMM_WORLD, "%d %D %f\n", rank, Ii, (double)PetscRealPart(v));CHKERRQ(ierr);
       v += 0.1;
     }
   }
   ierr = VecAXPY(y, -1.0, rhs);CHKERRQ(ierr);
   ierr = VecNorm(y, NORM_INFINITY, &norm);CHKERRQ(ierr);
   if (norm > 1.0e-10) {
-    ierr = PetscPrintf(PETSC_COMM_WORLD, "*** Difference between rhs and y, inf-norm: %f\n", norm);CHKERRQ(ierr);
+    ierr = PetscPrintf(PETSC_COMM_WORLD, "*** Difference between rhs and y, inf-norm: %f\n", (double)norm);CHKERRQ(ierr);
     ierr = VecView(y,PETSC_VIEWER_STDOUT_WORLD);CHKERRQ(ierr);
     SETERRQ(PETSC_COMM_WORLD, PETSC_ERR_PLIB, "Bug in MatZeroRowsColumns");
   }