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_epetra_communication_pattern.cc
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) 2016 - 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
14
15#ifdef DEAL_II_WITH_TRILINOS
16
18
20# include <Epetra_Map.h>
22
23# include <memory>
24
25
26#endif
27
29
30#ifdef DEAL_II_WITH_TRILINOS
31
32namespace LinearAlgebra
33{
34 namespace EpetraWrappers
35 {
37 const IndexSet &locally_owned_indices,
38 const IndexSet &ghost_indices,
39 const MPI_Comm communicator)
40 {
41 // virtual functions called in constructors and destructors never use the
42 // override in a derived class
43 // for clarity be explicit on which function is called
44 CommunicationPattern::reinit(locally_owned_indices,
45 ghost_indices,
46 communicator);
47 }
48
49
50
51 void
52 CommunicationPattern::reinit(const IndexSet &locally_owned_indices,
53 const IndexSet &ghost_indices,
54 const MPI_Comm communicator)
55 {
56 comm = std::make_shared<const MPI_Comm>(communicator);
57
58 Epetra_Map vector_space_vector_map =
59 locally_owned_indices.make_trilinos_map(*comm, false);
60 Epetra_Map read_write_vector_map =
61 ghost_indices.make_trilinos_map(*comm, true);
62
63 // Target map is read_write_vector_map
64 // Source map is vector_space_vector_map. This map must have uniquely
65 // owned GID.
66 importer = std::make_unique<Epetra_Import>(read_write_vector_map,
67 vector_space_vector_map);
68 }
69
70
71
74 {
75 return *comm;
76 }
77
78
79
80 const Epetra_Import &
85 } // namespace EpetraWrappers
86} // namespace LinearAlgebra
87
88
89#endif
Epetra_Map make_trilinos_map(const MPI_Comm communicator=MPI_COMM_WORLD, const bool overlapping=false) const
virtual void reinit(const IndexSet &locally_owned_indices, const IndexSet &ghost_indices, const MPI_Comm communicator) override
CommunicationPattern(const IndexSet &locally_owned_indices, const IndexSet &ghost_indices, const MPI_Comm communicator)
#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