]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix test cc.
authoryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 17 Oct 2013 14:18:41 +0000 (14:18 +0000)
committeryoung <young@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 17 Oct 2013 14:18:41 +0000 (14:18 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_petscscalar_complex@31281 0785d39b-7218-0410-832d-ea1e28bc413d

tests/petsc_scalar_complex/00-manipulate_petsc_scalar.cc
tests/petsc_scalar_complex/00-manipulate_petsc_scalar/cmp/generic [new file with mode: 0644]
tests/petsc_scalar_complex/00-manipulate_petsc_scalar/generic [deleted file]

index 3c353b83a4864fcd4d1482663755aae46b389c29..5cab80c1d259498d7176e0a2ecedb4b0b484b779 100644 (file)
@@ -33,7 +33,7 @@ std::ofstream logfile ("00-manipulate_petsc_scalar/output");
 // Divide a PETSc complex number by a real number.
 void divide_petsc_complex_by_a_number ()
 {
-  PetscScalar alpha      = 1.0 + 2.0i;
+  PetscScalar alpha      = 1.0 + 2.0*PETSC_i;
   const PetscScalar beta = alpha/2.;
 
   logfile << "   divide a petsc complex by 2.: "
@@ -58,7 +58,7 @@ void divide_petsc_complex_by_a_number ()
 // Initialize a std::complex number from an PETSc complex number
 void make_std_complex_from_petsc_complex ()
 {
-  const PetscScalar alpha         = 1.0 + 2.0i;
+  const PetscScalar alpha         = 1.0 + 2.0*PETSC_i;
   const std::complex<double> beta = alpha;
   
   logfile << "   make std::complex from petsc complex: "
@@ -89,7 +89,7 @@ void make_petsc_complex_from_std_complex ()
 // Initialize a PETSc complex number directly.
 void make_petsc_complex ()
 {
-  const PetscScalar alpha = 1.0 + 2.0i; 
+  const PetscScalar alpha = 1.0 + 2.0*PETSC_i; 
   
   logfile << "   make petsc complex: "
          << PetscRealPart (alpha)
@@ -157,7 +157,7 @@ int main (int argc, char **argv)
        // then try to use operators to do the same thing - except it
        // seems to work without(!)
        logfile << "   make std::complex from petsc complex: ";
-       const PetscScalar alpha2 = 1.0 + 2.0i; 
+       const PetscScalar alpha2 = 1.0 + 2.0*PETSC_i; 
        std::complex<double> number2;
        number2 += alpha2; 
        
@@ -168,7 +168,7 @@ int main (int argc, char **argv)
                << std::endl;
 
        logfile << "   make std::complex from petsc complex: ";
-       const PetscScalar alpha3 = 1.0 - 2.0i; 
+       const PetscScalar alpha3 = 1.0 - 2.0*PETSC_i; 
        number2 += alpha3; 
        
        logfile << std::real (number2)
diff --git a/tests/petsc_scalar_complex/00-manipulate_petsc_scalar/cmp/generic b/tests/petsc_scalar_complex/00-manipulate_petsc_scalar/cmp/generic
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/tests/petsc_scalar_complex/00-manipulate_petsc_scalar/generic b/tests/petsc_scalar_complex/00-manipulate_petsc_scalar/generic
deleted file mode 100644 (file)
index d76579b..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-
-   make petsc complex: 0.00000+0.00000i should be 0+0i
-   make petsc complex: 0.00000+0.00000i should be 0+0i
-   make petsc complex: 1.00000+2.00000i should be 1+2i
-   make petsc complex from std::complex: 1.00000+2.00000i
-   make std::complex from petsc complex: 1.00000+2.00000i
-   make petsc complex from std::complex: 1.00000+2.00000i should be 1+2i
-   make std::complex from petsc complex: 1.00000+2.00000i should be 1+2i
-   make std::complex from petsc complex: 2.00000+0.00000i should be 2+0i
-   divide a petsc complex by 2.: 0.500000+1.00000i should be 0.5+1i
-   divide-equals a petsc complex by 2.: 0.500000+1.00000i should be 0.5+1i
-

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.