From: Luca Heltai Date: Fri, 24 Jul 2015 17:43:17 +0000 (+0200) Subject: Added IndexSet constructor with Epetra_Map X-Git-Tag: v8.4.0-rc2~719^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f62f61a025a0f5e34f2b2f5ce9724acbf9c512d;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 ec16a1ad0c..efe0c550a8 100644 --- a/include/deal.II/base/index_set.h +++ b/include/deal.II/base/index_set.h @@ -104,6 +104,14 @@ public: */ explicit IndexSet (const size_type 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. @@ -1198,6 +1206,24 @@ IndexSet::IndexSet (const size_type 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); } };