Reference documentation for deal.II version GIT relicensing-1321-g19b0133728 2024-07-26 07:50: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: LGPL-2.1-or-later
4// Copyright (C) 2022 - 2023 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# include <Epetra_Comm.h>
24# include <Epetra_Map.h>
25# include <Teuchos_Comm.hpp>
26# include <Teuchos_RCP.hpp>
27
28# ifdef DEAL_II_WITH_MPI
29# include <Epetra_MpiComm.h>
30# else
31# include <Epetra_SerialComm.h>
32# endif
33
34# ifdef DEAL_II_TRILINOS_WITH_TPETRA
35# include <Teuchos_RCPDecl.hpp>
36# endif // DEAL_II_TRILINOS_WITH_TPETRA
37#endif
38
39
41
49namespace Utilities
50{
51#ifdef DEAL_II_WITH_TRILINOS
57 namespace Trilinos
58 {
68 const Epetra_Comm &
69 comm_world();
70
80 const Epetra_Comm &
81 comm_self();
82
91 const Teuchos::RCP<const Teuchos::Comm<int>> &
93
126 Epetra_Comm *
127 duplicate_communicator(const Epetra_Comm &communicator);
128
151 void
152 destroy_communicator(Epetra_Comm &communicator);
153
162 unsigned int
163 get_n_mpi_processes(const Epetra_Comm &mpi_communicator);
164
171 unsigned int
172 get_this_mpi_process(const Epetra_Comm &mpi_communicator);
173
184 Epetra_Map
185 duplicate_map(const Epetra_BlockMap &map, const Epetra_Comm &comm);
186 } // namespace Trilinos
187#endif
188
189
190#ifdef DEAL_II_TRILINOS_WITH_TPETRA
191 namespace Trilinos
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:503
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:504
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