Commits

Lisandro Dalcin committed fd30bc2

Update format %G -> %g after changes in petsc-dev

Comments (0)

Files changed (8)

demo/BoundaryIntegral.c

   ierr = IGAComputeScalar(iga,x,1,&error,Error,&user);CHKERRQ(ierr);
   error = PetscSqrtReal(PetscRealPart(error));
 
-  if (print_error) {ierr = PetscPrintf(PETSC_COMM_WORLD,"L2 error = %G\n",error);CHKERRQ(ierr);}
-  if (check_error) {if (PetscRealPart(error)>1e-4) SETERRQ1(PETSC_COMM_WORLD,1,"L2 error=%G\n",error);}
+  if (print_error) {ierr = PetscPrintf(PETSC_COMM_WORLD,"L2 error = %g\n",(double)error);CHKERRQ(ierr);}
+  if (check_error) {if (PetscRealPart(error)>1e-4) SETERRQ1(PETSC_COMM_WORLD,1,"L2 error=%g\n",(double)error);}
   if (draw&&dim<3) {ierr = VecView(x,PETSC_VIEWER_DRAW_WORLD);CHKERRQ(ierr);}
 
   ierr = KSPDestroy(&ksp);CHKERRQ(ierr);
   ierr = IGAComputeScalar(iga,x,1,&error,Error,NULL);CHKERRQ(ierr);
   error = PetscSqrtReal(PetscRealPart(error));
 
-  if (print_error) {ierr = PetscPrintf(PETSC_COMM_WORLD,"L2 error = %G\n",error);CHKERRQ(ierr);}
-  if (check_error) {if (PetscRealPart(error)>1e-4) SETERRQ1(PETSC_COMM_WORLD,1,"L2 error=%G\n",error);}
+  if (print_error) {ierr = PetscPrintf(PETSC_COMM_WORLD,"L2 error = %g\n",(double)error);CHKERRQ(ierr);}
+  if (check_error) {if (PetscRealPart(error)>1e-4) SETERRQ1(PETSC_COMM_WORLD,1,"L2 error=%g\n",(double)error);}
   if (draw&&dim<3) {ierr = VecView(x,PETSC_VIEWER_DRAW_WORLD);CHKERRQ(ierr);}
   if (save)        {ierr = IGAWrite(iga,"LaplaceGeometry.dat");CHKERRQ(ierr);}
   if (save)        {ierr = IGAWriteVec(iga,x,"LaplaceSolution.dat");CHKERRQ(ierr);}
   ierr = IGAComputeScalar(iga,x,1,&error,Error,NULL);CHKERRQ(ierr);
   error = PetscSqrtReal(PetscRealPart(error));
 
-  if (print_error) {ierr = PetscPrintf(PETSC_COMM_WORLD,"Error=%G\n",error);CHKERRQ(ierr);}
-  if (check_error) {if (PetscRealPart(error)>1e-4) SETERRQ1(PETSC_COMM_WORLD,1,"Error=%G\n",error);}
+  if (print_error) {ierr = PetscPrintf(PETSC_COMM_WORLD,"Error=%g\n",(double)error);CHKERRQ(ierr);}
+  if (check_error) {if (PetscRealPart(error)>1e-4) SETERRQ1(PETSC_COMM_WORLD,1,"Error=%g\n",(double)error);}
   if (draw&&dim<3) {ierr = VecView(x,PETSC_VIEWER_DRAW_WORLD);CHKERRQ(ierr);}
 
   ierr = KSPDestroy(&ksp);CHKERRQ(ierr);
     /* check increasing sequence */
     if (U[k-1] > U[k])
       SETERRQ4(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,
-               "Knot sequence must be increasing, got U[%D]=%G > U[%D]=%G",
-               k-1,U[k-1],k,U[k]);
+               "Knot sequence must be increasing, got U[%D]=%g > U[%D]=%g",
+               k-1,(double)U[k-1],k,(double)U[k]);
     /* check multiplicity */
     while (++k < m && U[i] == U[k]) s++;
     if (s > p)
       SETERRQ4(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,
-               "Knot U[%D]=%G has multiplicity %D greater than polynomial degree %D",
-               i,U[i],s,p);
+               "Knot U[%D]=%g has multiplicity %D greater than polynomial degree %D",
+               i,(double)U[i],s,p);
   }
 
   if (m != axis->m) {
     if (u[i-1] >= u[i])
       SETERRQ5(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,
                "Break sequence must be strictly increasing, "
-               "got u[%D]=%G %s u[%D]=%G",
-               i-1,u[i-1],i,u[i],(u[i]==u[i-1])?"==":">");
+               "got u[%D]=%g %s u[%D]=%g",
+               i-1,(double)u[i-1],(u[i]==u[i-1])?"==":">",i,(double)u[i]);
   if (C < 0 || C >= axis->p)
     SETERRQ2(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONG,
              "Continuity must be in range [0,%D], got %D",axis->p-1,C);
              "Number of elements must be greater than zero, got %D",N);
   if (Ui >= Uf)
     SETERRQ2(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONG,
-             "Initial value %G must be less than final value %G",Ui,Uf);
+             "Initial value %g must be less than final value %g",(double)Ui,(double)Uf);
   if (C < 0 || C >= axis->p)
     SETERRQ2(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONG,
              "Continuity must be in range [0,%D], got %D",axis->p-1,C);
       j = k; s = 1; while (++k < m && U[j] == U[k]) s++;
       if (s < p) SETERRQ5(PETSC_COMM_SELF,PETSC_ERR_ARG_OUTOFRANGE,
                           "Basis type %s requires C^0 continuity, "
-                          "Knot U[%D]=%G has multiplicity %D "
+                          "Knot U[%D]=%g has multiplicity %D "
                           "less than polynomial degree %D",
-                          IGABasisTypes[basis->type],j,U[j],s,p);
+                          IGABasisTypes[basis->type],j,(double)U[j],s,p);
     }
   }
 
   PetscFunctionBegin;
   ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERASCII,&ascii);CHKERRQ(ierr);
   if (ascii) {
-    ierr = PetscViewerASCIIPrintf(viewer,"  Alpha_m=%G, Alpha_f=%G, Gamma=%G, Beta=%G\n",th->Alpha_m,th->Alpha_f,th->Gamma,th->Beta);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  Alpha_m=%g, Alpha_f=%g, Gamma=%g, Beta=%g\n",(double)th->Alpha_m,(double)th->Alpha_f,(double)th->Gamma,(double)th->Beta);CHKERRQ(ierr);
   }
   ierr = SNESView(ts->snes,viewer);CHKERRQ(ierr);
   PetscFunctionReturn(0);
   PetscFunctionBegin;
   PetscValidHeaderSpecific(ts,TS_CLASSID,1);
   PetscValidLogicalCollectiveReal(ts,radius,2);
-  if (radius < 0 || radius > 1) SETERRQ1(((PetscObject)ts)->comm,PETSC_ERR_ARG_OUTOFRANGE,"Radius %G not in range [0,1]",radius);
+  if (radius < 0 || radius > 1) SETERRQ1(((PetscObject)ts)->comm,PETSC_ERR_ARG_OUTOFRANGE,"Radius %g not in range [0,1]",(double)radius);
   ierr = PetscTryMethod(ts,"TSAlpha2SetRadius_C",(TS,PetscReal),(ts,radius));CHKERRQ(ierr);
   PetscFunctionReturn(0);
 }
   ierr = IGAComputeScalar(iga,x,1,&error,Error,NULL);CHKERRQ(ierr);
   error = PetscSqrtReal(PetscRealPart(error));
 
-  if (print_error) {ierr = PetscPrintf(PETSC_COMM_WORLD,"L2 error = %G\n",error);CHKERRQ(ierr);}
-  if (check_error) {if (PetscRealPart(error)>error_tol) SETERRQ2(PETSC_COMM_WORLD,1,"L2 error=%G > %G\n",error,error_tol);}
+  if (print_error) {ierr = PetscPrintf(PETSC_COMM_WORLD,"L2 error = %g\n",(double)error);CHKERRQ(ierr);}
+  if (check_error) {if (PetscRealPart(error)>error_tol) SETERRQ2(PETSC_COMM_WORLD,1,"L2 error=%g > %g\n",(double)error,(double)error_tol);}
   if (draw&&dim<3) {ierr = VecView(x,PETSC_VIEWER_DRAW_WORLD);CHKERRQ(ierr);}
 
   ierr = MatDestroy(&A);CHKERRQ(ierr);
   ierr = TSGetSolution2(ts,&X,&V);CHKERRQ(ierr);
   ierr = VecGetArrayRead(X,&x);CHKERRQ(ierr);
   ierr = VecGetArrayRead(V,&v);CHKERRQ(ierr);
-  ierr = PetscFPrintf(PETSC_COMM_SELF,fp,"%G %G %G\n",t,x[0],v[0]);CHKERRQ(ierr);
+  ierr = PetscFPrintf(PETSC_COMM_SELF,fp,"%g %g %g\n",(double)t,(double)x[0],(double)v[0]);CHKERRQ(ierr);
   ierr = VecRestoreArrayRead(X,&x);CHKERRQ(ierr);
   ierr = VecRestoreArrayRead(V,&v);CHKERRQ(ierr);
   ierr = TSGetConvergedReason(ts,&reason); CHKERRQ(ierr);