]> https://gitweb.dealii.org/ - dealii.git/commitdiff
extend mpi/ghost_01 to complex-valued PETSc
authorDenis Davydov <davydden@gmail.com>
Mon, 28 Mar 2016 21:24:45 +0000 (23:24 +0200)
committerDenis Davydov <davydden@gmail.com>
Tue, 29 Mar 2016 18:48:46 +0000 (20:48 +0200)
tests/mpi/ghost_01.cc

index 1e46569a05f7653bba4dec0e023299d760b6a91b..71578edf2b4bd2e396d248410096da099a684ddf 100644 (file)
@@ -59,18 +59,18 @@ 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 << ":" << PetscRealPart(v(myid*2)) << std::endl;
+      deallog << myid*2+1 << ":" << PetscRealPart(v(myid*2+1)) << std::endl;
     }
 
-  Assert(v(myid*2) == myid*4.0, ExcInternalError());
-  Assert(v(myid*2+1) == myid*4.0+2.0, ExcInternalError());
+  Assert(PetscRealPart(v(myid*2)) == myid*4.0, ExcInternalError());
+  Assert(PetscRealPart(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: " << PetscRealPart(v(1)) << std::endl;
+  Assert(PetscRealPart(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.