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_index_access.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2017 - 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_index_access_h
16#define dealii_trilinos_index_access_h
17
18#include <deal.II/base/config.h>
19
20#ifdef DEAL_II_WITH_TRILINOS
21
22# include <deal.II/base/types.h>
23
24
26# include <Epetra_BlockMap.h>
27# include <Epetra_CrsGraph.h>
28# include <Epetra_CrsMatrix.h>
29# include <Epetra_MultiVector.h>
31
33
34namespace TrilinosWrappers
35{
42 n_global_elements(const Epetra_BlockMap &map)
43 {
44 return map.NumGlobalElements64();
45 }
46
52 min_my_gid(const Epetra_BlockMap &map)
53 {
54# ifdef DEAL_II_WITH_64BIT_INDICES
55 return map.MinMyGID64();
56# else
57 return map.MinMyGID();
58# endif
59 }
60
66 max_my_gid(const Epetra_BlockMap &map)
67 {
68# ifdef DEAL_II_WITH_64BIT_INDICES
69 return map.MaxMyGID64();
70# else
71 return map.MaxMyGID();
72# endif
73 }
74
80 global_index(const Epetra_BlockMap &map,
81 const ::types::global_dof_index i)
82 {
83# ifdef DEAL_II_WITH_64BIT_INDICES
84 return map.GID64(i);
85# else
86 return map.GID(i);
87# endif
88 }
89
96 my_global_elements(const Epetra_BlockMap &map)
97 {
98# ifdef DEAL_II_WITH_64BIT_INDICES
99 return map.MyGlobalElements64();
100# else
101 return map.MyGlobalElements();
102# endif
103 }
104
110 n_global_rows(const Epetra_CrsGraph &graph)
111 {
112# ifdef DEAL_II_WITH_64BIT_INDICES
113 return graph.NumGlobalRows64();
114# else
115 return graph.NumGlobalRows();
116# endif
117 }
118
124 n_global_cols(const Epetra_CrsGraph &graph)
125 {
126# ifdef DEAL_II_WITH_64BIT_INDICES
127 return graph.NumGlobalCols64();
128# else
129 return graph.NumGlobalCols();
130# endif
131 }
132
138 n_global_entries(const Epetra_CrsGraph &graph)
139 {
140 return graph.NumGlobalEntries64();
141 }
142
148 global_row_index(const Epetra_CrsMatrix &matrix,
149 const ::types::global_dof_index i)
150 {
151# ifdef DEAL_II_WITH_64BIT_INDICES
152 return matrix.GRID64(i);
153# else
154 return matrix.GRID(i);
155# endif
156 }
157
163 global_column_index(const Epetra_CrsMatrix &matrix,
164 const ::types::global_dof_index i)
165 {
166# ifdef DEAL_II_WITH_64BIT_INDICES
167 return matrix.GCID64(i);
168# else
169 return matrix.GCID(i);
170# endif
171 }
172
178 global_length(const Epetra_MultiVector &vector)
179 {
180# ifdef DEAL_II_WITH_64BIT_INDICES
181 return vector.GlobalLength64();
182# else
183 return vector.GlobalLength();
184# endif
185 }
186
192 n_global_rows(const Epetra_RowMatrix &matrix)
193 {
194# ifdef DEAL_II_WITH_64BIT_INDICES
195 return matrix.NumGlobalRows64();
196# else
197 return matrix.NumGlobalRows();
198# endif
199 }
200} // namespace TrilinosWrappers
201
203
204#else
205
206// Make sure the scripts that create the C++20 module input files have
207// something to latch on if the preprocessor #ifdef above would
208// otherwise lead to an empty content of the file.
211
212#endif // DEAL_II_WITH_TRILINOS
213#endif // dealii_trilinos_index_access_h
#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
long long int int64_type
Definition types.h:208
TrilinosWrappers::types::int_type global_index(const Epetra_BlockMap &map, const ::types::global_dof_index i)
TrilinosWrappers::types::int_type n_global_rows(const Epetra_CrsGraph &graph)
TrilinosWrappers::types::int_type global_length(const Epetra_MultiVector &vector)
TrilinosWrappers::types::int_type min_my_gid(const Epetra_BlockMap &map)
TrilinosWrappers::types::int_type * my_global_elements(const Epetra_BlockMap &map)
TrilinosWrappers::types::int64_type n_global_entries(const Epetra_CrsGraph &graph)
TrilinosWrappers::types::int64_type n_global_elements(const Epetra_BlockMap &map)
TrilinosWrappers::types::int_type global_column_index(const Epetra_CrsMatrix &matrix, const ::types::global_dof_index i)
TrilinosWrappers::types::int_type max_my_gid(const Epetra_BlockMap &map)
TrilinosWrappers::types::int_type global_row_index(const Epetra_CrsMatrix &matrix, const ::types::global_dof_index i)
TrilinosWrappers::types::int_type n_global_cols(const Epetra_CrsGraph &graph)