Reference documentation for deal.II version 9.2.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\}}\)
trilinos_index_access.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2017 - 2018 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_trilinos_index_access_h
17 #define dealii_trilinos_index_access_h
18 
19 #include <deal.II/base/config.h>
20 
21 #ifdef DEAL_II_WITH_TRILINOS
22 
23 # include <deal.II/base/types.h>
24 
25 # include <Epetra_BlockMap.h>
26 # include <Epetra_CrsGraph.h>
27 # include <Epetra_CrsMatrix.h>
28 # include <Epetra_MultiVector.h>
29 
31 
32 namespace TrilinosWrappers
33 {
40  n_global_elements(const Epetra_BlockMap &map)
41  {
42 # ifdef DEAL_II_WITH_64BIT_INDICES
43  return map.NumGlobalElements64();
44 # else
45  return map.NumGlobalElements();
46 # endif
47  }
48 
54  min_my_gid(const Epetra_BlockMap &map)
55  {
56 # ifdef DEAL_II_WITH_64BIT_INDICES
57  return map.MinMyGID64();
58 # else
59  return map.MinMyGID();
60 # endif
61  }
62 
68  max_my_gid(const Epetra_BlockMap &map)
69  {
70 # ifdef DEAL_II_WITH_64BIT_INDICES
71  return map.MaxMyGID64();
72 # else
73  return map.MaxMyGID();
74 # endif
75  }
76 
82  global_index(const Epetra_BlockMap & map,
84  {
85 # ifdef DEAL_II_WITH_64BIT_INDICES
86  return map.GID64(i);
87 # else
88  return map.GID(i);
89 # endif
90  }
91 
98  my_global_elements(const Epetra_BlockMap &map)
99  {
100 # ifdef DEAL_II_WITH_64BIT_INDICES
101  return map.MyGlobalElements64();
102 # else
103  return map.MyGlobalElements();
104 # endif
105  }
106 
112  n_global_rows(const Epetra_CrsGraph &graph)
113  {
114 # ifdef DEAL_II_WITH_64BIT_INDICES
115  return graph.NumGlobalRows64();
116 # else
117  return graph.NumGlobalRows();
118 # endif
119  }
120 
126  n_global_cols(const Epetra_CrsGraph &graph)
127  {
128 # ifdef DEAL_II_WITH_64BIT_INDICES
129  return graph.NumGlobalCols64();
130 # else
131  return graph.NumGlobalCols();
132 # endif
133  }
134 
140  n_global_entries(const Epetra_CrsGraph &graph)
141  {
142 # ifdef DEAL_II_WITH_64BIT_INDICES
143  return graph.NumGlobalEntries64();
144 # else
145  return graph.NumGlobalEntries();
146 # endif
147  }
148 
154  global_row_index(const Epetra_CrsMatrix & matrix,
156  {
157 # ifdef DEAL_II_WITH_64BIT_INDICES
158  return matrix.GRID64(i);
159 # else
160  return matrix.GRID(i);
161 # endif
162  }
163 
169  global_column_index(const Epetra_CrsMatrix & matrix,
171  {
172 # ifdef DEAL_II_WITH_64BIT_INDICES
173  return matrix.GCID64(i);
174 # else
175  return matrix.GCID(i);
176 # endif
177  }
178 
184  global_length(const Epetra_MultiVector &vector)
185  {
186 # ifdef DEAL_II_WITH_64BIT_INDICES
187  return vector.GlobalLength64();
188 # else
189  return vector.GlobalLength();
190 # endif
191  }
192 
198  n_global_rows(const Epetra_RowMatrix &matrix)
199  {
200 # ifdef DEAL_II_WITH_64BIT_INDICES
201  return matrix.NumGlobalRows64();
202 # else
203  return matrix.NumGlobalRows();
204 # endif
205  }
206 } // namespace TrilinosWrappers
207 
209 #endif // DEAL_II_WITH_TRILINOS
210 #endif // dealii_trilinos_index_access_h
types.h
TrilinosWrappers::n_global_entries
TrilinosWrappers::types::int_type n_global_entries(const Epetra_CrsGraph &graph)
Definition: trilinos_index_access.h:140
TrilinosWrappers
Definition: types.h:161
TrilinosWrappers::max_my_gid
TrilinosWrappers::types::int_type max_my_gid(const Epetra_BlockMap &map)
Definition: trilinos_index_access.h:68
TrilinosWrappers::n_global_cols
TrilinosWrappers::types::int_type n_global_cols(const Epetra_CrsGraph &graph)
Definition: trilinos_index_access.h:126
TrilinosWrappers::n_global_rows
TrilinosWrappers::types::int_type n_global_rows(const Epetra_CrsGraph &graph)
Definition: trilinos_index_access.h:112
types::global_dof_index
unsigned int global_dof_index
Definition: types.h:76
DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
LAPACKSupport::matrix
@ matrix
Contents is actually a matrix.
Definition: lapack_support.h:60
TrilinosWrappers::global_column_index
TrilinosWrappers::types::int_type global_column_index(const Epetra_CrsMatrix &matrix, const ::types::global_dof_index i)
Definition: trilinos_index_access.h:169
TrilinosWrappers::min_my_gid
TrilinosWrappers::types::int_type min_my_gid(const Epetra_BlockMap &map)
Definition: trilinos_index_access.h:54
TrilinosWrappers::global_length
TrilinosWrappers::types::int_type global_length(const Epetra_MultiVector &vector)
Definition: trilinos_index_access.h:184
config.h
TrilinosWrappers::my_global_elements
TrilinosWrappers::types::int_type * my_global_elements(const Epetra_BlockMap &map)
Definition: trilinos_index_access.h:98
TrilinosWrappers::global_row_index
TrilinosWrappers::types::int_type global_row_index(const Epetra_CrsMatrix &matrix, const ::types::global_dof_index i)
Definition: trilinos_index_access.h:154
DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
TrilinosWrappers::global_index
TrilinosWrappers::types::int_type global_index(const Epetra_BlockMap &map, const ::types::global_dof_index i)
Definition: trilinos_index_access.h:82
TrilinosWrappers::n_global_elements
TrilinosWrappers::types::int_type n_global_elements(const Epetra_BlockMap &map)
Definition: trilinos_index_access.h:40
int