From bbc7eb9d72a8eed6dbf7f78c1cf39531c058880c Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Thu, 31 Jan 2013 19:46:17 +0000 Subject: [PATCH] check that PETSc solvers work with the same communicators for Matrix/Vectors git-svn-id: https://svn.dealii.org/branches/branch_unify_linear_algebra@28204 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/lac/petsc_solver.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deal.II/source/lac/petsc_solver.cc b/deal.II/source/lac/petsc_solver.cc index ad9f1dfd50..e6c9a59d47 100644 --- a/deal.II/source/lac/petsc_solver.cc +++ b/deal.II/source/lac/petsc_solver.cc @@ -63,6 +63,11 @@ namespace PETScWrappers const PreconditionerBase &preconditioner) { int ierr; + + Assert(A.get_mpi_communicator()==mpi_communicator, ExcMessage("PETSc Solver and Matrix need to use the same MPI_Comm.")); + Assert(x.get_mpi_communicator()==mpi_communicator, ExcMessage("PETSc Solver and Vector need to use the same MPI_Comm.")); + Assert(b.get_mpi_communicator()==mpi_communicator, ExcMessage("PETSc Solver and Vector need to use the same MPI_Comm.")); + // first create a solver object if this // is necessary if (solver_data.get() == 0) -- 2.39.5