Reference documentation for deal.II version GIT relicensing-216-gcda843ca70 2024-03-28 12:20:02+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# ifdef DEAL_II_WITH_MPI
28# include <Epetra_MpiComm.h>
29# else
30# include <Epetra_SerialComm.h>
31# endif
32#endif
33
34#ifdef DEAL_II_TRILINOS_WITH_TPETRA
35# include <Teuchos_RCPDecl.hpp>
36#endif // DEAL_II_TRILINOS_WITH_TPETRA
37
39
47namespace Utilities
48{
49#ifdef DEAL_II_WITH_TRILINOS
55 namespace Trilinos
56 {
66 const Epetra_Comm &
67 comm_world();
68
78 const Epetra_Comm &
79 comm_self();
80
89 const Teuchos::RCP<const Teuchos::Comm<int>> &
91
124 Epetra_Comm *
125 duplicate_communicator(const Epetra_Comm &communicator);
126
149 void
150 destroy_communicator(Epetra_Comm &communicator);
151
160 unsigned int
161 get_n_mpi_processes(const Epetra_Comm &mpi_communicator);
162
169 unsigned int
170 get_this_mpi_process(const Epetra_Comm &mpi_communicator);
171
182 Epetra_Map
183 duplicate_map(const Epetra_BlockMap &map, const Epetra_Comm &comm);
184 } // namespace Trilinos
185#endif
186
187
188#ifdef DEAL_II_TRILINOS_WITH_TPETRA
189 namespace Trilinos
190 {
199 const Teuchos::RCP<const Teuchos::Comm<int>> &teuchos_comm);
200
201 namespace internal
202 {
214# if defined(DOXYGEN) || !DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0)
215 template <class T, class... Args>
216 Teuchos::RCP<T>
217 make_rcp(Args &&...args);
218# else
219 using Teuchos::make_rcp;
220# endif // defined DOXYGEN || !DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0)
221 } // namespace internal
222
223
224
225 /* ------------------------- Inline functions ---------------------- */
226 namespace internal
227 {
228# if !DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0)
229 template <class T, class... Args>
230 inline Teuchos::RCP<T>
231 make_rcp(Args &&...args)
232 {
233 return Teuchos::RCP<T>(new T(std::forward<Args>(args)...));
234 }
235# endif // !DEAL_II_TRILINOS_VERSION_GTE(14, 0, 0)
236 } // namespace internal
237
238 } // namespace Trilinos
239#endif // DEAL_II_TRILINOS_WITH_TPETRA
240
241} // namespace Utilities
242
244
245#endif
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:502
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:503
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