From 9d29fc4e0eadcfdcaf02824aa074124c5ef48f87 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 29 Mar 2016 07:33:03 +0200 Subject: [PATCH] extend gla/mat_01 to complex-valued PETSc --- tests/gla/mat_01.cc | 6 +++--- tests/tests.h | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/gla/mat_01.cc b/tests/gla/mat_01.cc index 199bafda83..a690c32e11 100644 --- a/tests/gla/mat_01.cc +++ b/tests/gla/mat_01.cc @@ -72,9 +72,9 @@ void test () // check local values if (myid==0) { - deallog << myid*2 << ": " << mat(myid*2,myid*2) << std::endl; - deallog << myid*2+1 << ": " << mat(myid*2+1,myid*2+1) << std::endl; - deallog << "0,1 : " << mat(0,1) << std::endl; + deallog << myid*2 << ": " << get_real_assert_zero_imag(mat(myid*2,myid*2)) << std::endl; + deallog << myid*2+1 << ": " << get_real_assert_zero_imag(mat(myid*2+1,myid*2+1)) << std::endl; + deallog << "0,1 : " << get_real_assert_zero_imag(mat(0,1)) << std::endl; } // done diff --git a/tests/tests.h b/tests/tests.h index 3525a34384..086ef88cab 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -77,6 +77,13 @@ PetscReal get_real_assert_zero_imag(const PETScWrappers::internal::VectorReferen } #endif +template +number get_real_assert_zero_imag(const std::complex &a) +{ + Assert (a.imag() == 0.0, ExcInternalError()); + return a.real(); +} + template number get_real_assert_zero_imag(const number &a) { -- 2.39.5