]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add get_mpi_communicator() to PETScWrappers::*::Vector
authorTimo Heister <timo.heister@gmail.com>
Thu, 31 Jan 2013 19:45:27 +0000 (19:45 +0000)
committerTimo Heister <timo.heister@gmail.com>
Thu, 31 Jan 2013 19:45:27 +0000 (19:45 +0000)
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

index 4f7b4ffc85714070043175c4243ff646991e208c..92bbaae15054efc2ce928a9691da2d12af84e69f 100644 (file)
@@ -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
 }

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.