]> https://gitweb.dealii.org/ - dealii.git/commitdiff
extend gla/vec_02 to complex-valued PETSc
authorDenis Davydov <davydden@gmail.com>
Tue, 29 Mar 2016 05:20:22 +0000 (07:20 +0200)
committerDenis Davydov <davydden@gmail.com>
Tue, 29 Mar 2016 18:48:46 +0000 (20:48 +0200)
tests/gla/vec_02.cc

index f84dc3ebd41835fc3e0d72656427c2535d2d17ec..3b92a2923628c9eb509a7a2c709bc8f61de2c50a 100644 (file)
@@ -68,26 +68,26 @@ void test ()
   // check local values
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
     {
-      deallog << myid*2 << ":" << v(myid*2) << std::endl;
-      deallog << myid*2+1 << ":" << v(myid*2+1) << std::endl;
+      deallog << myid*2 << ":" << get_real_assert_zero_imag(v(myid*2)) << std::endl;
+      deallog << myid*2+1 << ":" << get_real_assert_zero_imag(v(myid*2+1)) << std::endl;
     }
 
   //assignment from ghosted to ghosted
   v2 = v;
-  Assert(v2(1) == 2.0, ExcInternalError());
-  Assert(v2(myid*2) == myid*4.0, ExcInternalError());
-  Assert(v2(myid*2+1) == myid*4.0+2.0, ExcInternalError());
+  Assert(get_real_assert_zero_imag(v2(1)) == 2.0, ExcInternalError());
+  Assert(get_real_assert_zero_imag(v2(myid*2)) == myid*4.0, ExcInternalError());
+  Assert(get_real_assert_zero_imag(v2(myid*2+1)) == myid*4.0+2.0, ExcInternalError());
 
 
 
-  Assert(v(myid*2) == myid*4.0, ExcInternalError());
-  Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
+  Assert(get_real_assert_zero_imag(v(myid*2)) == myid*4.0, ExcInternalError());
+  Assert(get_real_assert_zero_imag(v(myid*2+1)) == myid*4.0+2.0, ExcInternalError());
 
 
   // check ghost values
   if (Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) == 0)
-    deallog << "ghost: " << v(1) << std::endl;
-  Assert(v(1) == 2.0, ExcInternalError());
+    deallog << "ghost: " << get_real_assert_zero_imag(v(1)) << std::endl;
+  Assert(get_real_assert_zero_imag(v(1)) == 2.0, ExcInternalError());
 
   // done
   if (myid==0)

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.