Reference documentation for deal.II version 9.0.0
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 at
12 // the top level of the deal.II distribution.
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
40  TrilinosWrappers::types::int_type
41  n_global_elements(const Epetra_BlockMap &map)
42  {
43 #ifdef DEAL_II_WITH_64BIT_INDICES
44  return map.NumGlobalElements64();
45 #else
46  return map.NumGlobalElements();
47 #endif
48  }
49 
54  inline
55  TrilinosWrappers::types::int_type
56  min_my_gid(const Epetra_BlockMap &map)
57  {
58 #ifdef DEAL_II_WITH_64BIT_INDICES
59  return map.MinMyGID64();
60 #else
61  return map.MinMyGID();
62 #endif
63  }
64 
69  inline
70  TrilinosWrappers::types::int_type
71  max_my_gid(const Epetra_BlockMap &map)
72  {
73 #ifdef DEAL_II_WITH_64BIT_INDICES
74  return map.MaxMyGID64();
75 #else
76  return map.MaxMyGID();
77 #endif
78  }
79 
84  inline
85  TrilinosWrappers::types::int_type
86  global_index(const Epetra_BlockMap &map,
87  const ::types::global_dof_index i)
88  {
89 #ifdef DEAL_II_WITH_64BIT_INDICES
90  return map.GID64(i);
91 #else
92  return map.GID(i);
93 #endif
94  }
95 
101  inline
102  TrilinosWrappers::types::int_type *
103  my_global_elements(const Epetra_BlockMap &map)
104  {
105 #ifdef DEAL_II_WITH_64BIT_INDICES
106  return map.MyGlobalElements64();
107 #else
108  return map.MyGlobalElements();
109 #endif
110  }
111 
116  inline
117  TrilinosWrappers::types::int_type
118  n_global_rows(const Epetra_CrsGraph &graph)
119  {
120 #ifdef DEAL_II_WITH_64BIT_INDICES
121  return graph.NumGlobalRows64();
122 #else
123  return graph.NumGlobalRows();
124 #endif
125  }
126 
131  inline
132  TrilinosWrappers::types::int_type
133  n_global_cols(const Epetra_CrsGraph &graph)
134  {
135 #ifdef DEAL_II_WITH_64BIT_INDICES
136  return graph.NumGlobalCols64();
137 #else
138  return graph.NumGlobalCols();
139 #endif
140  }
141 
146  inline
147  TrilinosWrappers::types::int_type
148  n_global_entries(const Epetra_CrsGraph &graph)
149  {
150 #ifdef DEAL_II_WITH_64BIT_INDICES
151  return graph.NumGlobalEntries64();
152 #else
153  return graph.NumGlobalEntries();
154 #endif
155  }
156 
161  inline
162  TrilinosWrappers::types::int_type
163  global_row_index(const Epetra_CrsMatrix &matrix,
164  const ::types::global_dof_index i)
165  {
166 #ifdef DEAL_II_WITH_64BIT_INDICES
167  return matrix.GRID64(i);
168 #else
169  return matrix.GRID(i);
170 #endif
171  }
172 
177  inline
178  TrilinosWrappers::types::int_type
179  global_column_index(const Epetra_CrsMatrix &matrix,
180  const ::types::global_dof_index i)
181  {
182 #ifdef DEAL_II_WITH_64BIT_INDICES
183  return matrix.GCID64(i);
184 #else
185  return matrix.GCID(i);
186 #endif
187  }
188 
193  inline
194  TrilinosWrappers::types::int_type
195  global_length (const Epetra_MultiVector &vector)
196  {
197 #ifdef DEAL_II_WITH_64BIT_INDICES
198  return vector.GlobalLength64();
199 #else
200  return vector.GlobalLength();
201 #endif
202  }
203 
208  inline
209  TrilinosWrappers::types::int_type
210  n_global_rows(const Epetra_RowMatrix &matrix)
211  {
212 #ifdef DEAL_II_WITH_64BIT_INDICES
213  return matrix.NumGlobalRows64();
214 #else
215  return matrix.NumGlobalRows();
216 #endif
217  }
218 }
219 
220 DEAL_II_NAMESPACE_CLOSE
221 #endif // DEAL_II_WITH_TRILINOS
222 #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)