deal.II version GIT relicensing-6834-g5b78e6bcdf 2026-10-01 11:20:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
trilinos_utilities.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2022 - 2026 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_trilinos_utilities_h
14#define dealii_trilinos_utilities_h
15
16#include <deal.II/base/config.h>
17
20
21#ifdef DEAL_II_WITH_TRILINOS
22
24# ifdef DEAL_II_TRILINOS_WITH_EPETRA
25# include <Epetra_Comm.h>
26# include <Epetra_Map.h>
27
28# ifdef DEAL_II_WITH_MPI
29# include <Epetra_MpiComm.h>
30# else
31# include <Epetra_SerialComm.h>
32# endif
33# endif
34# include <Teuchos_Comm.hpp>
35# include <Teuchos_RCP.hpp>
37#endif
38
39
41
49namespace Utilities
50{
51#ifdef DEAL_II_TRILINOS_WITH_EPETRA
57 namespace Trilinos
58 {
68 const Epetra_Comm &
69 comm_world();
70
80 const Epetra_Comm &
81 comm_self();
82
115 Epetra_Comm *
116 duplicate_communicator(const Epetra_Comm &communicator);
117
140 void
141 destroy_communicator(Epetra_Comm &communicator);
142
151 unsigned int
152 get_n_mpi_processes(const Epetra_Comm &mpi_communicator);
153
160 unsigned int
161 get_this_mpi_process(const Epetra_Comm &mpi_communicator);
162
173 Epetra_Map
174 duplicate_map(const Epetra_BlockMap &map, const Epetra_Comm &comm);
175 } // namespace Trilinos
176#endif
177
178
179#ifdef DEAL_II_TRILINOS_WITH_TPETRA
180 namespace Trilinos
181 {
190 const Teuchos::RCP<const Teuchos::Comm<int>> &
192
201 const Teuchos::RCP<const Teuchos::Comm<int>> &teuchos_comm);
202
203 namespace internal
204 {
216# if defined(DOXYGEN) || !DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0)
217 template <class T, class... Args>
218 Teuchos::RCP<T>
219 make_rcp(Args &&...args);
220# else
221 using Teuchos::make_rcp;
222# endif // defined DOXYGEN || !DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0)
223 } // namespace internal
224
225
226
227 /* ------------------------- Inline functions ---------------------- */
228 namespace internal
229 {
230# if !DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0)
231 template <class T, class... Args>
232 inline Teuchos::RCP<T>
233 make_rcp(Args &&...args)
234 {
235 return Teuchos::RCP<T>(new T(std::forward<Args>(args)...));
236 }
237# endif // !DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0)
238 } // namespace internal
239
240 } // namespace Trilinos
241#endif // DEAL_II_TRILINOS_WITH_TPETRA
242
243} // namespace Utilities
244
246
247#endif
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
Definition config.h:636
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
#define DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
Definition config.h:680
const MPI_Comm comm
Definition mpi.cc:912
Teuchos::RCP< T > make_rcp(Args &&...args)
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()
MPI_Comm teuchos_comm_to_mpi_comm(const Teuchos::RCP< const Teuchos::Comm< int > > &teuchos_comm)
const Teuchos::RCP< const Teuchos::Comm< int > > & tpetra_comm_self()
Epetra_Comm * duplicate_communicator(const Epetra_Comm &communicator)
const Epetra_Comm & comm_world()