]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
check that PETSc solvers work with the same communicators for Matrix/Vectors
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 31 Jan 2013 19:46:17 +0000 (19:46 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 31 Jan 2013 19:46:17 +0000 (19:46 +0000)
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

index ad9f1dfd5069705fdd3477cc0c3d401401c6eb46..e6c9a59d47d33ccf642476d156e5ffdd8001d130 100644 (file)
@@ -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)

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.