]> https://gitweb.dealii.org/ - dealii.git/commitdiff
partly extend mpi/p4est_save_03 to comple-valued PETSc
authorDenis Davydov <davydden@gmail.com>
Mon, 28 Mar 2016 20:59:14 +0000 (22:59 +0200)
committerDenis Davydov <davydden@gmail.com>
Tue, 29 Mar 2016 18:48:46 +0000 (20:48 +0200)
tests/mpi/p4est_save_03.cc

index ac1dfac7cf6c0c8418bfa14e7538de3e8e0f64b3..384776f972968a32ecda048e13dda1ff80af6511 100644 (file)
@@ -90,8 +90,8 @@ void test()
     for (unsigned int i = 0; i < locally_owned_dofs.n_elements(); ++i)
       {
         unsigned int idx = locally_owned_dofs.nth_index_in_set (i);
-        x (idx) = idx;
-        x2 (idx) = 2 * idx;
+        x (idx) = static_cast<PETScWrappers::MPI::Vector::value_type>(idx);;
+        x2 (idx) = static_cast<PETScWrappers::MPI::Vector::value_type>(2 * idx);
 
 //  std::cout << '[' << idx << ']' << ' ' << solution(idx) << std::endl;
       }
@@ -138,7 +138,7 @@ void test()
     PETScWrappers::MPI::Vector solution2 (locally_owned_dofs, MPI_COMM_WORLD);
     parallel::distributed::SolutionTransfer<dim, PETScWrappers::MPI::Vector> soltrans (dh);
     parallel::distributed::SolutionTransfer<dim, PETScWrappers::MPI::Vector> soltrans2 (dh);
-    solution = 2;
+    solution = static_cast<PETScWrappers::MPI::Vector::value_type>(2);
     soltrans.deserialize (solution);
     soltrans2.deserialize (solution2);
 
@@ -146,8 +146,8 @@ void test()
       {
         unsigned int idx = locally_owned_dofs.nth_index_in_set (i);
         //std::cout << '[' << idx << ']' << ' ' << solution(idx) << std::endl;
-        AssertThrow (idx == solution (idx), ExcInternalError());
-        AssertThrow (2*idx == solution2 (idx), ExcInternalError());
+        AssertThrow (idx == PetscRealPart(solution (idx)), ExcInternalError());
+        AssertThrow (2*idx == PetscRealPart(solution2 (idx)), ExcInternalError());
       }
 
     double norm = solution.l1_norm();

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.