deal.II version 9.7.0
\(\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: LGPL-2.1-or-later
4// Copyright (C) 2022 - 2024 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_trilinos_utilities_h
16#define dealii_trilinos_utilities_h
17
18#include <deal.II/base/config.h>
19
21
22#ifdef DEAL_II_WITH_TRILINOS
23
25# include <Epetra_Comm.h>
26# include <Epetra_Map.h>
27# include <Teuchos_Comm.hpp>
28# include <Teuchos_RCP.hpp>
29
30# ifdef DEAL_II_WITH_MPI
31# include <Epetra_MpiComm.h>
32# else
33# include <Epetra_SerialComm.h>
34# endif
35
36# ifdef DEAL_II_TRILINOS_WITH_TPETRA
37# include <Teuchos_RCPDecl.hpp>
38# endif // DEAL_II_TRILINOS_WITH_TPETRA
40#endif
41
42
44
52namespace Utilities
53{
54#ifdef DEAL_II_WITH_TRILINOS
60 namespace Trilinos
61 {
71 const Epetra_Comm &
72 comm_world();
73
83 const Epetra_Comm &
84 comm_self();
85
94 const Teuchos::RCP<const Teuchos::Comm<int>> &
96
129 Epetra_Comm *
130 duplicate_communicator(const Epetra_Comm &communicator);
131
154 void
155 destroy_communicator(Epetra_Comm &communicator);
156
165 unsigned int
166 get_n_mpi_processes(const Epetra_Comm &mpi_communicator);
167
174 unsigned int
175 get_this_mpi_process(const Epetra_Comm &mpi_communicator);
176
187 Epetra_Map
188 duplicate_map(const Epetra_BlockMap &map, const Epetra_Comm &comm);
189 } // namespace Trilinos
190#endif
191
192
193#ifdef DEAL_II_TRILINOS_WITH_TPETRA
194 namespace Trilinos
195 {
204 const Teuchos::RCP<const Teuchos::Comm<int>> &teuchos_comm);
205
206 namespace internal
207 {
219# if defined(DOXYGEN) || !DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0)
220 template <class T, class... Args>
221 Teuchos::RCP<T>
222 make_rcp(Args &&...args);
223# else
224 using Teuchos::make_rcp;
225# endif // defined DOXYGEN || !DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0)
226 } // namespace internal
227
228
229
230 /* ------------------------- Inline functions ---------------------- */
231 namespace internal
232 {
233# if !DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0)
234 template <class T, class... Args>
235 inline Teuchos::RCP<T>
236 make_rcp(Args &&...args)
237 {
238 return Teuchos::RCP<T>(new T(std::forward<Args>(args)...));
239 }
240# endif // !DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0)
241 } // namespace internal
242
243 } // namespace Trilinos
244#endif // DEAL_II_TRILINOS_WITH_TPETRA
245
246} // namespace Utilities
247
249
250#endif
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:40
#define DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
Definition config.h:603
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:41
#define DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
Definition config.h:647
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()
*braid_SplitCommworld & comm