From abc928283d12651f3cbe82221ffe77ec749a2b1f Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Wed, 8 Apr 2015 12:11:54 +0200 Subject: [PATCH] Add range_partitioner and domain_partitioner member functions TrilinosWrappers::BlockSparseMatrix now has member functions returning an std::vector of the underlying, blockwise Epetra_Map object --- doc/news/changes.h | 8 +++ .../lac/trilinos_block_sparse_matrix.h | 51 ++++++++++++++++++- 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/doc/news/changes.h b/doc/news/changes.h index 71e426b3b1..916737a1ed 100644 --- a/doc/news/changes.h +++ b/doc/news/changes.h @@ -450,6 +450,14 @@ inconvenience this causes.

Specific improvements

    +
  1. New: TrilinosWrappers::BlockSparseMatrix now has member functions + TrilinosWrappers::BlockSparseMatrix::domain_paritioner() and + TrilinosWrappers::BlockSparseMatrix::range_partitioner() that return a + vector of the underlying block Epetra_Map. +
    + (Matthias Maier, 2015/04/08) + +
  2. Fixed: The class SymmetricTensor<2,dim> is now usable also for dim>3.
    (Martin Kronbichler, 2015/04/14) diff --git a/include/deal.II/lac/trilinos_block_sparse_matrix.h b/include/deal.II/lac/trilinos_block_sparse_matrix.h index 179411b061..5c055f17b4 100644 --- a/include/deal.II/lac/trilinos_block_sparse_matrix.h +++ b/include/deal.II/lac/trilinos_block_sparse_matrix.h @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2008 - 2014 by the deal.II authors +// Copyright (C) 2008 - 2015 by the deal.II authors // // This file is part of the deal.II library. // @@ -223,6 +223,23 @@ namespace TrilinosWrappers */ size_type n_nonzero_elements () 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 + * partitioning of the individual block vectors this matrix has to be + * multiplied with. + */ + std::vector domain_partitioner () const; + + /** + * Return a vector of the underlying Trilinos Epetra_Map that sets the + * partitioning of the range space of this block matrix, i.e., the + * partitioning of the individual block vectors that are the result + * from matrix-vector products. + */ + std::vector range_partitioner () const; + + /** * Matrix-vector multiplication: let $dst = M*src$ with $M$ being this * matrix. The vector types can be block vectors or non-block vectors @@ -413,6 +430,38 @@ namespace TrilinosWrappers + inline + std::vector + BlockSparseMatrix::domain_partitioner () const + { + Assert (this->n_block_cols() != 0, ExcNotInitialized()); + Assert (this->n_block_rows() != 0, ExcNotInitialized()); + + std::vector domain_partitioner; + for (size_type c = 0; c < this->n_block_cols(); ++c) + domain_partitioner.push_back(this->sub_objects[0][c]->domain_partitioner()); + + return domain_partitioner; + } + + + + inline + std::vector + BlockSparseMatrix::range_partitioner () const + { + Assert (this->n_block_cols() != 0, ExcNotInitialized()); + Assert (this->n_block_rows() != 0, ExcNotInitialized()); + + std::vector range_partitioner; + for (size_type r = 0; r < this->n_block_rows(); ++r) + range_partitioner.push_back(this->sub_objects[r][0]->range_partitioner()); + + return range_partitioner; + } + + + inline BlockSparseMatrix & BlockSparseMatrix::operator = (const double d) -- 2.39.5