Commits

BarryFSmith committed 5680405

Microsoft very picky about complex number conversion from real

  • Participants
  • Parent commits fa39208

Comments (0)

Files changed (3)

src/dm/examples/tests/ex36.c

   PetscReal r,theta;
   r      = PetscSqrtReal(a.real*a.real + a.imag*a.imag);
   theta  = atan2(a.imag,a.real);
-  b.real = PetscPowRealInt(r,n) * PetscCosReal(n*theta);
-  b.imag = PetscPowRealInt(r,n) * PetscSinReal(n*theta);
+  b.real = PetscPowReal(r,n) * PetscCosReal(n*theta);
+  b.imag = PetscPowReal(r,n) * PetscSinReal(n*theta);
   return b;
 }
 CCmplx CCmplxExp(CCmplx a)

src/ts/examples/tutorials/ex31.c

   PetscFunctionBegin;
   if (!strcmp(p,"hull1972a1")) {
     ierr = VecGetArray(Y,&y);CHKERRQ(ierr);
-    y[0] = PetscExpScalar(-t);
+    y[0] = PetscExpReal(-t);
     *flag = PETSC_TRUE;
     ierr = VecRestoreArray(Y,&y);CHKERRQ(ierr);
   } else if (!strcmp(p,"hull1972a2")) {
     ierr = VecGetArray(Y,&y);CHKERRQ(ierr);
-    y[0] = 1.0/PetscSqrtScalar(t+1);
+    y[0] = 1.0/PetscSqrtReal(t+1);
     *flag = PETSC_TRUE;
     ierr = VecRestoreArray(Y,&y);CHKERRQ(ierr);
   } else if (!strcmp(p,"hull1972a3")) {
     ierr = VecGetArray(Y,&y);CHKERRQ(ierr);
-    y[0] = PetscExpScalar(PetscSinReal(t));
+    y[0] = PetscExpReal(PetscSinReal(t));
     *flag = PETSC_TRUE;
     ierr = VecRestoreArray(Y,&y);CHKERRQ(ierr);
   } else if (!strcmp(p,"hull1972a4")) {
     ierr = VecGetArray(Y,&y);CHKERRQ(ierr);
-    y[0] = 20.0/(1+19.0*PetscExpScalar(-t/4.0));
+    y[0] = 20.0/(1+19.0*PetscExpReal(-t/4.0));
     *flag = PETSC_TRUE;
     ierr = VecRestoreArray(Y,&y);CHKERRQ(ierr);
   } else {

src/ts/examples/tutorials/phasefield/biharmonic2.c

         break;
       case 3: /* logarithmic */
         if (PetscRealPart(x[i].u) < -1.0 + 2.0*ctx->tol)     f[i].w += .5*ctx->theta*(-PetscLogReal(ctx->tol) + PetscLogScalar((1.0-x[i].u)/2.0)) + ctx->theta_c*x[i].u;
-        else if (PetscRealPart(x[i].u) > 1.0 - 2.0*ctx->tol) f[i].w += .5*ctx->theta*(-PetscLogScalar((1.0+x[i].u)/2.0) + PetscLogScalar(ctx->tol)) + ctx->theta_c*x[i].u;
+        else if (PetscRealPart(x[i].u) > 1.0 - 2.0*ctx->tol) f[i].w += .5*ctx->theta*(-PetscLogScalar((1.0+x[i].u)/2.0) + PetscLogReal(ctx->tol)) + ctx->theta_c*x[i].u;
         else                                                 f[i].w += .5*ctx->theta*(-PetscLogScalar((1.0+x[i].u)/2.0) + PetscLogScalar((1.0-x[i].u)/2.0)) + ctx->theta_c*x[i].u;
         break;
       }