19#ifdef DEAL_II_WITH_TRILINOS
20# ifdef DEAL_II_WITH_MPI
21# include <Epetra_MpiComm.h>
22# include <Teuchos_DefaultComm.hpp>
24# include <Epetra_SerialComm.h>
25# include <Teuchos_RCP.hpp>
32#ifdef DEAL_II_WITH_TRILINOS
38# ifdef DEAL_II_WITH_MPI
39 static Teuchos::RCP<Epetra_MpiComm> communicator =
40 Teuchos::rcp(
new Epetra_MpiComm(MPI_COMM_WORLD),
true);
42 static Teuchos::RCP<Epetra_SerialComm> communicator =
43 Teuchos::rcp(
new Epetra_SerialComm(),
true);
51 const Teuchos::RCP<const Teuchos::Comm<int>> &
54# ifdef DEAL_II_WITH_MPI
55 static auto communicator = Teuchos::RCP<const Teuchos::Comm<int>>(
56 new Teuchos::MpiComm<int>(MPI_COMM_SELF));
58 static auto communicator =
59 Teuchos::RCP<const Teuchos::Comm<int>>(
new Teuchos::Comm<int>());
70# ifdef DEAL_II_WITH_MPI
71 static Teuchos::RCP<Epetra_MpiComm> communicator =
72 Teuchos::rcp(
new Epetra_MpiComm(MPI_COMM_SELF),
true);
74 static Teuchos::RCP<Epetra_SerialComm> communicator =
75 Teuchos::rcp(
new Epetra_SerialComm(),
true);
86# ifdef DEAL_II_WITH_MPI
91 const Epetra_MpiComm *mpi_comm =
92 dynamic_cast<const Epetra_MpiComm *
>(&communicator);
93 if (mpi_comm !=
nullptr)
94 return new Epetra_MpiComm(
102 Assert(
dynamic_cast<const Epetra_SerialComm *
>(&communicator) !=
nullptr,
104 return new Epetra_SerialComm(
105 dynamic_cast<const Epetra_SerialComm &
>(communicator));
115# ifdef DEAL_II_WITH_MPI
116 Epetra_MpiComm *mpi_comm =
dynamic_cast<Epetra_MpiComm *
>(&communicator);
117 if (mpi_comm !=
nullptr)
120 *mpi_comm = Epetra_MpiComm(MPI_COMM_SELF);
132 return mpi_communicator.NumProc();
139 return static_cast<unsigned int>(mpi_communicator.MyPID());
147 if (map.LinearMap() ==
true)
154 return Epetra_Map(map.NumGlobalElements(),
163 return Epetra_Map(map.NumGlobalElements(),
165 map.MyGlobalElements(),
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcInternalError()
MPI_Comm duplicate_communicator(const MPI_Comm mpi_communicator)
void free_communicator(MPI_Comm mpi_communicator)
void destroy_communicator(Epetra_Comm &communicator)
Epetra_Map duplicate_map(const Epetra_BlockMap &map, const Epetra_Comm &comm)
unsigned int get_this_mpi_process(const Epetra_Comm &mpi_communicator)
unsigned int get_n_mpi_processes(const Epetra_Comm &mpi_communicator)
const Epetra_Comm & comm_self()
const Teuchos::RCP< const Teuchos::Comm< int > > & tpetra_comm_self()
Epetra_Comm * duplicate_communicator(const Epetra_Comm &communicator)
const Epetra_Comm & comm_world()