Reference documentation for deal.II version 9.1.0-pre
trilinos_index_access.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2017 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 
30 DEAL_II_NAMESPACE_OPEN
31 
32 namespace TrilinosWrappers
33 {
39  inline TrilinosWrappers::types::int_type
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 
53  inline TrilinosWrappers::types::int_type
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 
67  inline TrilinosWrappers::types::int_type
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 
81  inline TrilinosWrappers::types::int_type
82  global_index(const Epetra_BlockMap & map,
83  const ::types::global_dof_index i)
84  {
85 # ifdef DEAL_II_WITH_64BIT_INDICES
86  return map.GID64(i);
87 # else
88  return map.GID(i);
89 # endif
90  }
91 
97  inline TrilinosWrappers::types::int_type *
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 
111  inline TrilinosWrappers::types::int_type
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 
125  inline TrilinosWrappers::types::int_type
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 
139  inline TrilinosWrappers::types::int_type
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 
153  inline TrilinosWrappers::types::int_type
154  global_row_index(const Epetra_CrsMatrix & matrix,
155  const ::types::global_dof_index i)
156  {
157 # ifdef DEAL_II_WITH_64BIT_INDICES
158  return matrix.GRID64(i);
159 # else
160  return matrix.GRID(i);
161 # endif
162  }
163 
168  inline TrilinosWrappers::types::int_type
169  global_column_index(const Epetra_CrsMatrix & matrix,
170  const ::types::global_dof_index i)
171  {
172 # ifdef DEAL_II_WITH_64BIT_INDICES
173  return matrix.GCID64(i);
174 # else
175  return matrix.GCID(i);
176 # endif
177  }
178 
183  inline TrilinosWrappers::types::int_type
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 
197  inline TrilinosWrappers::types::int_type
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 
208 DEAL_II_NAMESPACE_CLOSE
209 #endif // DEAL_II_WITH_TRILINOS
210 #endif // dealii_trilinos_index_access_h
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 n_global_rows(const Epetra_CrsGraph &graph)
TrilinosWrappers::types::int_type * my_global_elements(const Epetra_BlockMap &map)
TrilinosWrappers::types::int_type n_global_cols(const Epetra_CrsGraph &graph)
TrilinosWrappers::types::int_type global_row_index(const Epetra_CrsMatrix &matrix, const ::types::global_dof_index i)
TrilinosWrappers::types::int_type n_global_entries(const Epetra_CrsGraph &graph)
TrilinosWrappers::types::int_type global_column_index(const Epetra_CrsMatrix &matrix, const ::types::global_dof_index i)
TrilinosWrappers::types::int_type n_global_elements(const Epetra_BlockMap &map)
TrilinosWrappers::types::int_type max_my_gid(const Epetra_BlockMap &map)
TrilinosWrappers::types::int_type global_index(const Epetra_BlockMap &map, const ::types::global_dof_index i)