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_tpetra_communication_pattern.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) 2018 - 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_tpetra_communication_pattern_h
14#define dealii_trilinos_tpetra_communication_pattern_h
15
16
17#include <deal.II/base/config.h>
18
20
22
23#ifdef DEAL_II_TRILINOS_WITH_TPETRA
24
27
28# include <Tpetra_Export.hpp>
29# include <Tpetra_Import.hpp>
30
31# include <memory>
32
33#endif
34
36
37#ifdef DEAL_II_TRILINOS_WITH_TPETRA
38namespace LinearAlgebra
39{
40 namespace TpetraWrappers
41 {
45 template <typename MemorySpace = ::MemorySpace::Host>
47 {
48 static_assert(std::is_same_v<MemorySpace, ::MemorySpace::Default> ||
49 std::is_same_v<MemorySpace, ::MemorySpace::Host>);
50
51 public:
65 CommunicationPattern(const IndexSet &locally_owned_indices,
66 const IndexSet &ghost_indices,
67 const MPI_Comm communicator);
68
82 virtual void
83 reinit(const IndexSet &locally_owned_indices,
84 const IndexSet &ghost_indices,
85 const MPI_Comm communicator) override;
86
90 virtual MPI_Comm
91 get_mpi_communicator() const override;
92
97 get_tpetra_import() const;
98
102 Teuchos::RCP<TpetraTypes::ImportType<MemorySpace>>
103 get_tpetra_import_rcp() const;
104
109 get_tpetra_export() const;
110
114 Teuchos::RCP<TpetraTypes::ExportType<MemorySpace>>
115 get_tpetra_export_rcp() const;
116
117 private:
121 Teuchos::RCP<const MPI_Comm> comm;
122
126 Teuchos::RCP<TpetraTypes::ImportType<MemorySpace>> tpetra_import;
127
131 Teuchos::RCP<TpetraTypes::ExportType<MemorySpace>> tpetra_export;
132 };
133 } // end of namespace TpetraWrappers
134} // end of namespace LinearAlgebra
135
136#endif
137
139
140#endif
const TpetraTypes::ImportType< MemorySpace > & get_tpetra_import() const
virtual void reinit(const IndexSet &locally_owned_indices, const IndexSet &ghost_indices, const MPI_Comm communicator) override
Teuchos::RCP< TpetraTypes::ImportType< MemorySpace > > tpetra_import
Teuchos::RCP< TpetraTypes::ImportType< MemorySpace > > get_tpetra_import_rcp() const
Teuchos::RCP< TpetraTypes::ExportType< MemorySpace > > tpetra_export
Teuchos::RCP< TpetraTypes::ExportType< MemorySpace > > get_tpetra_export_rcp() const
const TpetraTypes::ExportType< MemorySpace > & get_tpetra_export() const
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
Tpetra::Import< LO, GO, NodeType< MemorySpace > > ImportType
Tpetra::Export< LO, GO, NodeType< MemorySpace > > ExportType