From: Denis Davydov Date: Mon, 28 Mar 2016 18:28:36 +0000 (+0200) Subject: extend mpi/petsc_distribute_01_block to complex-valued PETSc X-Git-Tag: v8.5.0-rc1~1153^2~40 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb1844bc1841245c32dd31ddb694fa7ed2534c1a;p=dealii.git extend mpi/petsc_distribute_01_block to complex-valued PETSc --- diff --git a/tests/mpi/petsc_distribute_01_block.cc b/tests/mpi/petsc_distribute_01_block.cc index 441480e2a9..fc176c4afc 100644 --- a/tests/mpi/petsc_distribute_01_block.cc +++ b/tests/mpi/petsc_distribute_01_block.cc @@ -112,19 +112,19 @@ void test() // verify correctness if (myid != 0) - AssertThrow (vec(vec.block(0).local_range().first+10) == vec.block(0).local_range().first-25, + AssertThrow (PetscRealPart(vec(vec.block(0).local_range().first+10)) == vec.block(0).local_range().first-25, ExcInternalError()); if (myid != n_processes-1) - AssertThrow (vec(vec.block(0).local_range().first+90) == vec.block(0).local_range().first+105, + AssertThrow (PetscRealPart(vec(vec.block(0).local_range().first+90)) == vec.block(0).local_range().first+105, ExcInternalError()); if (myid != 0) - AssertThrow (vec(vec.block(0).size()+vec.block(1).local_range().first+10) == vec.block(1).local_range().first-25, + AssertThrow (PetscRealPart(vec(vec.block(0).size()+vec.block(1).local_range().first+10)) == vec.block(1).local_range().first-25, ExcInternalError()); if (myid != n_processes-1) - AssertThrow (vec(vec.block(0).size()+vec.block(1).local_range().first+90) == vec.block(1).local_range().first+105, + AssertThrow (PetscRealPart(vec(vec.block(0).size()+vec.block(1).local_range().first+90)) == vec.block(1).local_range().first+105, ExcInternalError()); @@ -134,8 +134,9 @@ void test() && (i != vec.block(0).local_range().first+90)) { - double val = vec.block(0)(i); - AssertThrow (std::fabs(val - i) <= 1e-6, ExcInternalError()); + PetscScalar val = vec.block(0)(i); + AssertThrow (std::fabs(PetscRealPart(val) - i) <= 1e-6, ExcInternalError()); + AssertThrow (PetscImaginaryPart(val) == 0.0, ExcInternalError()); } } for (unsigned int i=vec.block(1).local_range().first; i