From: Luca Heltai Date: Fri, 24 Jul 2015 17:43:17 +0000 (+0200) Subject: Added IndexSet constructor with Epetra_Map X-Git-Tag: v8.3.0-rc2~1^2~5 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b620b7b7dc9cebe3aabcf481b9eb8deed89bb0d0;p=dealii.git Added IndexSet constructor with Epetra_Map --- diff --git a/include/deal.II/base/index_set.h b/include/deal.II/base/index_set.h index b8dd4bd236..3549ce1d56 100644 --- a/include/deal.II/base/index_set.h +++ b/include/deal.II/base/index_set.h @@ -88,6 +88,14 @@ public: */ explicit IndexSet (const types::global_dof_index size); + +#ifdef DEAL_II_WITH_TRILINOS + /** + * Constructor from a trilinos Epetra_Map. + */ + IndexSet(const Epetra_Map &map); +#endif + /** * Remove all indices from this index set. The index set retains its size, * however. @@ -534,6 +542,24 @@ IndexSet::IndexSet (const types::global_dof_index size) + +#ifdef DEAL_II_WITH_TRILINOS +inline +IndexSet::IndexSet (const Epetra_Map &map) + : + is_compressed (true), + index_space_size (map.NumGlobalElements()), + largest_range (numbers::invalid_unsigned_int) +{ + int *map_indices = map.MyGlobalElements(); + for (int i=0; i @@ -997,7 +997,7 @@ namespace internal TrilinosWrappers::MPI::Vector &v, bool fast) { - v.reinit(matrix.domain_partitioner(), fast); + v.reinit(IndexSet(matrix.domain_partitioner()), MPI_COMM_WORLD, fast); } }; @@ -1015,7 +1015,7 @@ namespace internal TrilinosWrappers::Vector &v, bool fast) { - v.reinit(matrix.range_partitioner(), fast); + v.reinit(IndexSet(matrix.range_partitioner()), MPI_COMM_WORLD, fast); } template @@ -1024,7 +1024,7 @@ namespace internal TrilinosWrappers::Vector &v, bool fast) { - v.reinit(matrix.domain_partitioner(), fast); + v.reinit(IndexSet(matrix.domain_partitioner()), MPI_COMM_WORLD, fast); } };