33
44// This includes all types we know of.
55#include " lac/lac_type.h"
6+ #include < deal.II/base/mpi.h>
67#include < mpi.h>
78
89/* *
@@ -15,20 +16,20 @@ class ScopedLACInitializer
1516 ScopedLACInitializer (const std::vector<types::global_dof_index> &dofs_per_block,
1617 const std::vector<IndexSet> &owned,
1718 const std::vector<IndexSet> &relevant,
18- const MPI_Comm &comm = MPI_COMM_WORLD):
19+ const MPI_Comm extcomm = MPI_COMM_WORLD):
1920 dofs_per_block (dofs_per_block),
2021 owned(owned),
2122 relevant(relevant),
22- comm(comm )
23- {};
23+ comm(Utilities::MPI::duplicate_communicator(extcomm) )
24+ {}
2425
2526 /* *
2627 * Initialize a non ghosted TrilinosWrappers::MPI::BlockVector.
2728 */
2829 void operator () (TrilinosWrappers::MPI::BlockVector &v, bool fast=false )
2930 {
3031 v.reinit (owned, comm, fast);
31- };
32+ }
3233
3334
3435 /* *
@@ -37,15 +38,15 @@ class ScopedLACInitializer
3738 void ghosted (TrilinosWrappers::MPI::BlockVector &v, bool fast=false )
3839 {
3940 v.reinit (owned, relevant, comm, fast);
40- };
41+ }
4142
4243 /* *
4344 * Initialize a serial BlockVector<double>.
4445 */
4546 void operator () (BlockVector<double > &v, bool fast=false )
4647 {
4748 v.reinit (dofs_per_block, fast);
48- };
49+ }
4950
5051
5152 /* *
@@ -56,7 +57,7 @@ class ScopedLACInitializer
5657 {
5758 Assert (false , ExcInternalError (" You tried to create a ghosted vector in a serial run." ));
5859 (void )fast;
59- };
60+ }
6061
6162 /* *
6263 * Initialize a Trilinos Sparsity Pattern.
@@ -112,7 +113,7 @@ class ScopedLACInitializer
112113 /* *
113114 * MPI Communicator.
114115 */
115- const MPI_Comm & comm;
116+ MPI_Comm comm;
116117};
117118
118119
0 commit comments