From: Timo Heister Date: Wed, 5 Jun 2013 20:55:55 +0000 (+0000) Subject: add new function for trilinos blockvectors X-Git-Tag: v8.0.0~120^2~42 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c108887f17cbdf62dcf54620daef6b8a08d67ca;p=dealii.git add new function for trilinos blockvectors git-svn-id: https://svn.dealii.org/branches/branch_unify_linear_algebra@29770 0785d39b-7218-0410-832d-ea1e28bc413d --- 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