From 6c108887f17cbdf62dcf54620daef6b8a08d67ca Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Wed, 5 Jun 2013 20:55:55 +0000 Subject: [PATCH] add new function for trilinos blockvectors git-svn-id: https://svn.dealii.org/branches/branch_unify_linear_algebra@29770 0785d39b-7218-0410-832d-ea1e28bc413d --- .../lac/trilinos_parallel_block_vector.h | 8 +++++++ deal.II/source/lac/trilinos_block_vector.cc | 22 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/deal.II/include/deal.II/lac/trilinos_parallel_block_vector.h b/deal.II/include/deal.II/lac/trilinos_parallel_block_vector.h index 8c5408572d..1d2c473851 100644 --- a/deal.II/include/deal.II/lac/trilinos_parallel_block_vector.h +++ b/deal.II/include/deal.II/lac/trilinos_parallel_block_vector.h @@ -225,6 +225,14 @@ namespace TrilinosWrappers void reinit (const std::vector ¶llel_partitioning, const MPI_Comm &communicator = MPI_COMM_WORLD, const bool fast = false); + /** + * like above, but with a second set of indices for + * ghost entries. + */ + void reinit (const std::vector &partitioning, + const std::vector &ghost_values, + const MPI_Comm &communicator = MPI_COMM_WORLD); + /** * Change the dimension to that diff --git a/deal.II/source/lac/trilinos_block_vector.cc b/deal.II/source/lac/trilinos_block_vector.cc index aaa3eb830c..010eeeebe3 100644 --- a/deal.II/source/lac/trilinos_block_vector.cc +++ b/deal.II/source/lac/trilinos_block_vector.cc @@ -136,6 +136,28 @@ namespace TrilinosWrappers collect_sizes(); } + void + BlockVector::reinit (const std::vector ¶llel_partitioning, + const std::vector &ghost_values, + const MPI_Comm &communicator) + { + const size_type no_blocks = parallel_partitioning.size(); + std::vector block_sizes (no_blocks); + + for (size_type i=0; iblock_indices.reinit (block_sizes); + if (components.size() != n_blocks()) + components.resize(n_blocks()); + + for (size_type i=0; i