]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add get_mpi_communicator(), locally_owned_range_indices() and locally_owned_domain_in...
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 9 May 2017 12:00:17 +0000 (14:00 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 9 May 2017 19:49:28 +0000 (21:49 +0200)
doc/news/changes/minor/20170509DanielArndt [new file with mode: 0644]
include/deal.II/lac/trilinos_block_sparse_matrix.h
source/lac/trilinos_block_sparse_matrix.cc

diff --git a/doc/news/changes/minor/20170509DanielArndt b/doc/news/changes/minor/20170509DanielArndt
new file mode 100644 (file)
index 0000000..800ffbf
--- /dev/null
@@ -0,0 +1,7 @@
+New: TrilinosWrappers::MPI::BlockMatrix can now return its MPI_Comm via
+get_mpi_communicator() and its range and domain indices via
+locally_owned_range_indices() and locally_owned_domain_indices()
+relying on the information of the TrilinosWrappers::MPI::Matrix
+object it is based on.
+<br>
+(Daniel Arndt, 2017/05/09)
index 9753e38bb2c90da23180b73a6c5674f31f94b0be..4c0331bb2c0f945484e474e4e8633ba860e8b20a 100644 (file)
@@ -224,6 +224,11 @@ namespace TrilinosWrappers
      */
     size_type n_nonzero_elements () const;
 
+    /**
+     * Return the MPI communicator object in use with this matrix.
+     */
+    MPI_Comm get_mpi_communicator () const;
+
     /**
      * Return a vector of the underlying Trilinos Epetra_Map that sets the
      * partitioning of the domain space of this block matrix, i.e., the
@@ -246,6 +251,19 @@ namespace TrilinosWrappers
      */
     std::vector<Epetra_Map> range_partitioner () const DEAL_II_DEPRECATED;
 
+    /**
+     * Return the partitioning of the domain space for the individual blocks of
+     * this matrix, i.e., the partitioning of the block vectors this matrix has
+     * to be multiplied with.
+     */
+    std::vector<IndexSet> locally_owned_domain_indices() const;
+
+    /**
+     * Return the partitioning of the range space for the individual blocks of
+     * this matrix, i.e., the partitioning of the block vectors that result
+     * from matrix-vector products.
+     */
+    std::vector<IndexSet> locally_owned_range_indices() const;
 
     /**
      * Matrix-vector multiplication: let $dst = M*src$ with $M$ being this
@@ -565,6 +583,38 @@ namespace TrilinosWrappers
 
 
 
+  inline
+  std::vector<IndexSet>
+  BlockSparseMatrix::locally_owned_domain_indices () const
+  {
+    Assert (this->n_block_cols() != 0, ExcNotInitialized());
+    Assert (this->n_block_rows() != 0, ExcNotInitialized());
+
+    std::vector<IndexSet> domain_indices;
+    for (size_type c = 0; c < this->n_block_cols(); ++c)
+      domain_indices.push_back(this->sub_objects[0][c]->locally_owned_domain_indices());
+
+    return domain_indices;
+  }
+
+
+
+  inline
+  std::vector<IndexSet>
+  BlockSparseMatrix::locally_owned_range_indices () const
+  {
+    Assert (this->n_block_cols() != 0, ExcNotInitialized());
+    Assert (this->n_block_rows() != 0, ExcNotInitialized());
+
+    std::vector<IndexSet> range_indices;
+    for (size_type r = 0; r < this->n_block_rows(); ++r)
+      range_indices.push_back(this->sub_objects[r][0]->locally_owned_range_indices());
+
+    return range_indices;
+  }
+
+
+
   namespace internal
   {
     namespace BlockLinearOperator
index 0ae6ff37bf1f90fe113df8ddf1cd10b9b6d5deeb..69a4a2c9356dc04a4e7654c0733dd755041b1816 100644 (file)
@@ -416,7 +416,13 @@ namespace TrilinosWrappers
 
 
 
-
+  MPI_Comm
+  BlockSparseMatrix::get_mpi_communicator () const
+  {
+    Assert (this->n_block_cols() != 0, ExcNotInitialized());
+    Assert (this->n_block_rows() != 0, ExcNotInitialized());
+    return this->sub_objects[0][0]->get_mpi_communicator();
+  }
 
 
 

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.