From a960fa82d5dd1db7449d1d9f2baa73199a4b75bf Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Mon, 28 Mar 2016 21:06:13 +0200 Subject: [PATCH] partly extend tests/mpi/p4est_save_04.cc to complex-valued PETSc --- tests/mpi/p4est_save_04.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/mpi/p4est_save_04.cc b/tests/mpi/p4est_save_04.cc index d77b202357..53a621dccb 100644 --- a/tests/mpi/p4est_save_04.cc +++ b/tests/mpi/p4est_save_04.cc @@ -87,8 +87,12 @@ 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); +#ifdef PETSC_USE_COMPLEX + x (idx) = std::complex(idx,0); +#else x (idx) = idx; - deallog << '[' << idx << ']' << ' ' << x(idx) << std::endl; +#endif + deallog << '[' << idx << ']' << ' ' << PetscRealPart(x(idx)) << std::endl; } @@ -124,7 +128,7 @@ void test() DoFTools::extract_locally_relevant_dofs (dh, locally_relevant_dofs); PETScWrappers::MPI::Vector solution (locally_owned_dofs, com_all); - solution = 0; + solution = PetscScalar(); parallel::distributed::SolutionTransfer soltrans (dh); soltrans.deserialize (solution); @@ -132,7 +136,7 @@ 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); - deallog << '[' << idx << ']' << ' ' << solution(idx) << std::endl; + deallog << '[' << idx << ']' << ' ' << PetscRealPart(solution(idx)) << std::endl; } deallog << "#cells = " << tr.n_global_active_cells() << std::endl; -- 2.39.5