From b4bebacd6f815f42e4c33325cfe03f92e9a9cb87 Mon Sep 17 00:00:00 2001 From: heister Date: Thu, 31 Jan 2013 19:45:27 +0000 Subject: [PATCH] Add get_mpi_communicator() to PETScWrappers::*::Vector git-svn-id: https://svn.dealii.org/branches/branch_unify_linear_algebra@28203 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/lac/petsc_vector_base.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/deal.II/include/deal.II/lac/petsc_vector_base.h b/deal.II/include/deal.II/lac/petsc_vector_base.h index 4f7b4ffc85..92bbaae150 100644 --- a/deal.II/include/deal.II/lac/petsc_vector_base.h +++ b/deal.II/include/deal.II/lac/petsc_vector_base.h @@ -810,6 +810,13 @@ namespace PETScWrappers */ std::size_t memory_consumption () const; + /** + * Return a reference to the MPI + * communicator object in use with this + * object. + */ + virtual const MPI_Comm &get_mpi_communicator () const; + protected: /** * A generic vector object in @@ -1182,6 +1189,14 @@ namespace PETScWrappers return operator()(index); } + inline + const MPI_Comm & + VectorBase::get_mpi_communicator () const + { + static MPI_Comm comm; + PetscObjectGetComm((PetscObject)vector, &comm); + return comm; + } #endif // DOXYGEN } -- 2.39.5