deal.II version GIT relicensing-2206-gaa53ff9447 2024-12-02 09:10:00+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_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 - 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_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# include <Epetra_BlockMap.h>
25# include <Epetra_CrsGraph.h>
26# include <Epetra_CrsMatrix.h>
27# include <Epetra_MultiVector.h>
28
30
31namespace TrilinosWrappers
32{
39 n_global_elements(const Epetra_BlockMap &map)
40 {
41 return map.NumGlobalElements64();
42 }
43
49 min_my_gid(const Epetra_BlockMap &map)
50 {
51# ifdef DEAL_II_WITH_64BIT_INDICES
52 return map.MinMyGID64();
53# else
54 return map.MinMyGID();
55# endif
56 }
57
63 max_my_gid(const Epetra_BlockMap &map)
64 {
65# ifdef DEAL_II_WITH_64BIT_INDICES
66 return map.MaxMyGID64();
67# else
68 return map.MaxMyGID();
69# endif
70 }
71
77 global_index(const Epetra_BlockMap &map,
78 const ::types::global_dof_index i)
79 {
80# ifdef DEAL_II_WITH_64BIT_INDICES
81 return map.GID64(i);
82# else
83 return map.GID(i);
84# endif
85 }
86
93 my_global_elements(const Epetra_BlockMap &map)
94 {
95# ifdef DEAL_II_WITH_64BIT_INDICES
96 return map.MyGlobalElements64();
97# else
98 return map.MyGlobalElements();
99# endif
100 }
101
107 n_global_rows(const Epetra_CrsGraph &graph)
108 {
109# ifdef DEAL_II_WITH_64BIT_INDICES
110 return graph.NumGlobalRows64();
111# else
112 return graph.NumGlobalRows();
113# endif
114 }
115
121 n_global_cols(const Epetra_CrsGraph &graph)
122 {
123# ifdef DEAL_II_WITH_64BIT_INDICES
124 return graph.NumGlobalCols64();
125# else
126 return graph.NumGlobalCols();
127# endif
128 }
129
135 n_global_entries(const Epetra_CrsGraph &graph)
136 {
137 return graph.NumGlobalEntries64();
138 }
139
145 global_row_index(const Epetra_CrsMatrix &matrix,
146 const ::types::global_dof_index i)
147 {
148# ifdef DEAL_II_WITH_64BIT_INDICES
149 return matrix.GRID64(i);
150# else
151 return matrix.GRID(i);
152# endif
153 }
154
160 global_column_index(const Epetra_CrsMatrix &matrix,
161 const ::types::global_dof_index i)
162 {
163# ifdef DEAL_II_WITH_64BIT_INDICES
164 return matrix.GCID64(i);
165# else
166 return matrix.GCID(i);
167# endif
168 }
169
175 global_length(const Epetra_MultiVector &vector)
176 {
177# ifdef DEAL_II_WITH_64BIT_INDICES
178 return vector.GlobalLength64();
179# else
180 return vector.GlobalLength();
181# endif
182 }
183
189 n_global_rows(const Epetra_RowMatrix &matrix)
190 {
191# ifdef DEAL_II_WITH_64BIT_INDICES
192 return matrix.NumGlobalRows64();
193# else
194 return matrix.NumGlobalRows();
195# endif
196 }
197} // namespace TrilinosWrappers
198
200#endif // DEAL_II_WITH_TRILINOS
201#endif // dealii_trilinos_index_access_h
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:498
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:499
long long int int64_type
Definition types.h:188
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)