From: Timo Heister Date: Thu, 31 Jan 2013 19:45:27 +0000 (+0000) Subject: Add get_mpi_communicator() to PETScWrappers::*::Vector X-Git-Tag: v8.0.0~120^2~94 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f26801c0b6ad60aa3a6751c778ce4e57be8bf58;p=dealii.git 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 --- 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 }