Reference documentation for deal.II version 9.0.0
trilinos_sparsity_pattern.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2008 - 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 at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_trilinos_sparsity_pattern_h
17 #define dealii_trilinos_sparsity_pattern_h
18 
19 
20 #include <deal.II/base/config.h>
21 
22 #ifdef DEAL_II_WITH_TRILINOS
23 
24 # include <deal.II/base/subscriptor.h>
25 # include <deal.II/base/index_set.h>
26 # include <deal.II/lac/exceptions.h>
27 
28 # include <vector>
29 # include <cmath>
30 # include <memory>
31 
32 
33 # include <Epetra_FECrsGraph.h>
34 # include <Epetra_Map.h>
35 # ifdef DEAL_II_WITH_MPI
36 # include <Epetra_MpiComm.h>
37 # include <mpi.h>
38 # else
39 # include <Epetra_SerialComm.h>
40 # endif
41 
42 
43 DEAL_II_NAMESPACE_OPEN
44 
45 // forward declarations
46 class SparsityPattern;
48 
49 namespace TrilinosWrappers
50 {
51  // forward declarations
52  class SparsityPattern;
53  class SparseMatrix;
54 
55  namespace SparsityPatternIterators
56  {
57  // forward declaration
58  class Iterator;
59 
73  class Accessor
74  {
75  public:
79  typedef ::types::global_dof_index size_type;
80 
85  const size_type row,
86  const size_type index);
87 
91  size_type row() const;
92 
96  size_type index() const;
97 
101  size_type column() const;
102 
107 
113  << "You tried to access row " << arg1
114  << " of a distributed sparsity pattern, "
115  << " but only rows " << arg2 << " through " << arg3
116  << " are stored locally and can be accessed.");
117 
118  private:
123 
128 
133 
146  std::shared_ptr<const std::vector<size_type> > colnum_cache;
147 
153  void visit_present_row ();
154 
158  friend class Iterator;
159  };
160 
166  class Iterator
167  {
168  public:
172  typedef ::types::global_dof_index size_type;
173 
178  Iterator (const SparsityPattern *sparsity_pattern,
179  const size_type row,
180  const size_type index);
181 
185  Iterator (const Iterator &i);
186 
191 
195  Iterator operator++ (int);
196 
200  const Accessor &operator* () const;
201 
205  const Accessor *operator-> () const;
206 
211  bool operator == (const Iterator &) const;
212 
216  bool operator != (const Iterator &) const;
217 
223  bool operator < (const Iterator &) const;
224 
230  << "Attempt to access element " << arg2
231  << " of row " << arg1
232  << " which doesn't have that many elements.");
233 
234  private:
239 
241  };
242 
243  }
244 
245 
265  {
266  public:
267 
271  typedef ::types::global_dof_index size_type;
272 
277 
285  SparsityPattern ();
286 
301  SparsityPattern (const size_type m,
302  const size_type n,
303  const size_type n_entries_per_row = 0);
304 
313  SparsityPattern (const size_type m,
314  const size_type n,
315  const std::vector<size_type> &n_entries_per_row);
316 
321  SparsityPattern (SparsityPattern &&other) noexcept;
322 
327  SparsityPattern (const SparsityPattern &input_sparsity_pattern);
328 
332  virtual ~SparsityPattern () = default;
333 
345  void
346  reinit (const size_type m,
347  const size_type n,
348  const size_type n_entries_per_row = 0);
349 
358  void
359  reinit (const size_type m,
360  const size_type n,
361  const std::vector<size_type> &n_entries_per_row);
362 
367  void
368  copy_from (const SparsityPattern &input_sparsity_pattern);
369 
375  template <typename SparsityPatternType>
376  void
377  copy_from (const SparsityPatternType &nontrilinos_sparsity_pattern);
378 
385  SparsityPattern &operator = (const SparsityPattern &input_sparsity_pattern);
386 
394  void clear ();
395 
405  void compress ();
407 
411 
426  DEAL_II_DEPRECATED
427  SparsityPattern (const Epetra_Map &parallel_partitioning,
428  const size_type n_entries_per_row = 0);
429 
442  DEAL_II_DEPRECATED
443  SparsityPattern (const Epetra_Map &parallel_partitioning,
444  const std::vector<size_type> &n_entries_per_row);
445 
464  DEAL_II_DEPRECATED
465  SparsityPattern (const Epetra_Map &row_parallel_partitioning,
466  const Epetra_Map &col_parallel_partitioning,
467  const size_type n_entries_per_row = 0);
468 
482  DEAL_II_DEPRECATED
483  SparsityPattern (const Epetra_Map &row_parallel_partitioning,
484  const Epetra_Map &col_parallel_partitioning,
485  const std::vector<size_type> &n_entries_per_row);
486 
503  DEAL_II_DEPRECATED
504  void
505  reinit (const Epetra_Map &parallel_partitioning,
506  const size_type n_entries_per_row = 0);
507 
520  DEAL_II_DEPRECATED
521  void
522  reinit (const Epetra_Map &parallel_partitioning,
523  const std::vector<size_type> &n_entries_per_row);
524 
543  DEAL_II_DEPRECATED
544  void
545  reinit (const Epetra_Map &row_parallel_partitioning,
546  const Epetra_Map &col_parallel_partitioning,
547  const size_type n_entries_per_row = 0);
548 
562  DEAL_II_DEPRECATED
563  void
564  reinit (const Epetra_Map &row_parallel_partitioning,
565  const Epetra_Map &col_parallel_partitioning,
566  const std::vector<size_type> &n_entries_per_row);
567 
578  template <typename SparsityPatternType>
579  DEAL_II_DEPRECATED
580  void
581  reinit (const Epetra_Map &row_parallel_partitioning,
582  const Epetra_Map &col_parallel_partitioning,
583  const SparsityPatternType &nontrilinos_sparsity_pattern,
584  const bool exchange_data = false);
585 
596  template <typename SparsityPatternType>
597  DEAL_II_DEPRECATED
598  void
599  reinit (const Epetra_Map &parallel_partitioning,
600  const SparsityPatternType &nontrilinos_sparsity_pattern,
601  const bool exchange_data = false);
603 
607 
619  SparsityPattern (const IndexSet &parallel_partitioning,
620  const MPI_Comm &communicator = MPI_COMM_WORLD,
621  const size_type n_entries_per_row = 0);
622 
633  SparsityPattern (const IndexSet &parallel_partitioning,
634  const MPI_Comm &communicator,
635  const std::vector<size_type> &n_entries_per_row);
636 
651  SparsityPattern (const IndexSet &row_parallel_partitioning,
652  const IndexSet &col_parallel_partitioning,
653  const MPI_Comm &communicator = MPI_COMM_WORLD,
654  const size_type n_entries_per_row = 0);
655 
667  SparsityPattern (const IndexSet &row_parallel_partitioning,
668  const IndexSet &col_parallel_partitioning,
669  const MPI_Comm &communicator,
670  const std::vector<size_type> &n_entries_per_row);
671 
698  SparsityPattern (const IndexSet &row_parallel_partitioning,
699  const IndexSet &col_parallel_partitioning,
700  const IndexSet &writable_rows,
701  const MPI_Comm &communicator = MPI_COMM_WORLD,
702  const size_type n_entries_per_row = 0);
703 
719  void
720  reinit (const IndexSet &parallel_partitioning,
721  const MPI_Comm &communicator = MPI_COMM_WORLD,
722  const size_type n_entries_per_row = 0);
723 
734  void
735  reinit (const IndexSet &parallel_partitioning,
736  const MPI_Comm &communicator,
737  const std::vector<size_type> &n_entries_per_row);
738 
755  void
756  reinit (const IndexSet &row_parallel_partitioning,
757  const IndexSet &col_parallel_partitioning,
758  const MPI_Comm &communicator = MPI_COMM_WORLD,
759  const size_type n_entries_per_row = 0);
760 
786  void
787  reinit (const IndexSet &row_parallel_partitioning,
788  const IndexSet &col_parallel_partitioning,
789  const IndexSet &writeable_rows,
790  const MPI_Comm &communicator = MPI_COMM_WORLD,
791  const size_type n_entries_per_row = 0);
792 
797  void
798  reinit (const IndexSet &row_parallel_partitioning,
799  const IndexSet &col_parallel_partitioning,
800  const MPI_Comm &communicator,
801  const std::vector<size_type> &n_entries_per_row);
802 
812  template <typename SparsityPatternType>
813  void
814  reinit (const IndexSet &row_parallel_partitioning,
815  const IndexSet &col_parallel_partitioning,
816  const SparsityPatternType &nontrilinos_sparsity_pattern,
817  const MPI_Comm &communicator = MPI_COMM_WORLD,
818  const bool exchange_data = false);
819 
828  template <typename SparsityPatternType>
829  void
830  reinit (const IndexSet &parallel_partitioning,
831  const SparsityPatternType &nontrilinos_sparsity_pattern,
832  const MPI_Comm &communicator = MPI_COMM_WORLD,
833  const bool exchange_data = false);
835 
839 
844  bool is_compressed () const;
845 
849  unsigned int max_entries_per_row () const;
850 
854  size_type n_rows () const;
855 
859  size_type n_cols () const;
860 
870  unsigned int local_size () const;
871 
880  std::pair<size_type, size_type>
881  local_range () const;
882 
887  bool in_local_range (const size_type index) const;
888 
892  size_type n_nonzero_elements () const;
893 
897  size_type row_length (const size_type row) const;
898 
905  size_type bandwidth () const;
906 
911  bool empty () const;
912 
917  bool exists (const size_type i,
918  const size_type j) const;
919 
924  std::size_t memory_consumption () const;
925 
927 
934  void add (const size_type i,
935  const size_type j);
936 
937 
941  template <typename ForwardIterator>
942  void add_entries (const size_type row,
943  ForwardIterator begin,
944  ForwardIterator end,
945  const bool indices_are_sorted = false);
947 
951 
956  const Epetra_FECrsGraph &trilinos_sparsity_pattern () const;
957 
966  DEAL_II_DEPRECATED
967  const Epetra_Map &domain_partitioner () const;
968 
977  DEAL_II_DEPRECATED
978  const Epetra_Map &range_partitioner () const;
979 
987  DEAL_II_DEPRECATED
988  const Epetra_Map &row_partitioner () const;
989 
999  DEAL_II_DEPRECATED
1000  const Epetra_Map &col_partitioner () const;
1001 
1007  DEAL_II_DEPRECATED
1008  const Epetra_Comm &trilinos_communicator () const;
1009 
1013  MPI_Comm get_mpi_communicator () const;
1015 
1020 
1027 
1034 
1036 
1041 
1045  const_iterator begin () const;
1046 
1050  const_iterator end () const;
1051 
1060  const_iterator begin (const size_type r) const;
1061 
1070  const_iterator end (const size_type r) const;
1071 
1073 
1077 
1083  void write_ascii ();
1084 
1092  void print (std::ostream &out,
1093  const bool write_extended_trilinos_info = false) const;
1094 
1109  void print_gnuplot (std::ostream &out) const;
1110 
1112 
1120  int,
1121  << "An error with error number " << arg1
1122  << " occurred while calling a Trilinos function");
1123 
1129  << "The entry with index <" << arg1 << ',' << arg2
1130  << "> does not exist.");
1131 
1136  "You are attempting an operation on two sparsity patterns that "
1137  "are the same object, but the operation requires that the "
1138  "two objects are in fact different.");
1139 
1145  << "You tried to access element (" << arg1
1146  << "/" << arg2 << ")"
1147  << " of a distributed matrix, but only rows "
1148  << arg3 << " through " << arg4
1149  << " are stored locally and can be accessed.");
1150 
1156  << "You tried to access element (" << arg1
1157  << "/" << arg2 << ")"
1158  << " of a sparse matrix, but it appears to not"
1159  << " exist in the Trilinos sparsity pattern.");
1161  private:
1162 
1167  std::unique_ptr<Epetra_Map> column_space_map;
1168 
1174  std::unique_ptr<Epetra_FECrsGraph> graph;
1175 
1182  std::unique_ptr<Epetra_CrsGraph> nonlocal_graph;
1183 
1184  friend class TrilinosWrappers::SparseMatrix;
1187  };
1188 
1189 
1190 
1191 // -------------------------- inline and template functions ----------------------
1192 
1193 
1194 #ifndef DOXYGEN
1195 
1196  namespace SparsityPatternIterators
1197  {
1198 
1199  inline
1201  const size_type row,
1202  const size_type index)
1203  :
1204  sparsity_pattern(const_cast<SparsityPattern *>(sp)),
1205  a_row(row),
1206  a_index(index)
1207  {
1208  visit_present_row ();
1209  }
1210 
1211 
1212 
1213  inline
1214  Accessor::size_type
1215  Accessor::row() const
1216  {
1217  Assert (a_row < sparsity_pattern->n_rows(), ExcBeyondEndOfSparsityPattern());
1218  return a_row;
1219  }
1220 
1221 
1222 
1223  inline
1224  Accessor::size_type
1225  Accessor::column() const
1226  {
1227  Assert (a_row < sparsity_pattern->n_rows(), ExcBeyondEndOfSparsityPattern());
1228  return (*colnum_cache)[a_index];
1229  }
1230 
1231 
1232 
1233  inline
1234  Accessor::size_type
1235  Accessor::index() const
1236  {
1237  Assert (a_row < sparsity_pattern->n_rows(), ExcBeyondEndOfSparsityPattern());
1238  return a_index;
1239  }
1240 
1241 
1242 
1243  inline
1244  Iterator::Iterator(const SparsityPattern *sp,
1245  const size_type row,
1246  const size_type index)
1247  :
1248  accessor(sp, row, index)
1249  {}
1250 
1251 
1252  inline
1253  Iterator::Iterator(const Iterator &) = default;
1254 
1255 
1256 
1257  inline
1258  Iterator &
1259  Iterator::operator++ ()
1260  {
1261  Assert (accessor.a_row < accessor.sparsity_pattern->n_rows(),
1262  ExcIteratorPastEnd());
1263 
1264  ++accessor.a_index;
1265 
1266  // If at end of line: do one
1267  // step, then cycle until we
1268  // find a row with a nonzero
1269  // number of entries.
1270  if (accessor.a_index >= accessor.colnum_cache->size())
1271  {
1272  accessor.a_index = 0;
1273  ++accessor.a_row;
1274 
1275  while ((accessor.a_row < accessor.sparsity_pattern->n_rows())
1276  &&
1277  (accessor.sparsity_pattern->row_length(accessor.a_row) == 0))
1278  ++accessor.a_row;
1279 
1280  accessor.visit_present_row();
1281  }
1282  return *this;
1283  }
1284 
1285 
1286 
1287  inline
1288  Iterator
1289  Iterator::operator++ (int)
1290  {
1291  const Iterator old_state = *this;
1292  ++(*this);
1293  return old_state;
1294  }
1295 
1296 
1297 
1298  inline
1299  const Accessor &
1300  Iterator::operator* () const
1301  {
1302  return accessor;
1303  }
1304 
1305 
1306 
1307  inline
1308  const Accessor *
1309  Iterator::operator-> () const
1310  {
1311  return &accessor;
1312  }
1313 
1314 
1315 
1316  inline
1317  bool
1318  Iterator::operator == (const Iterator &other) const
1319  {
1320  return (accessor.a_row == other.accessor.a_row &&
1321  accessor.a_index == other.accessor.a_index);
1322  }
1323 
1324 
1325 
1326  inline
1327  bool
1328  Iterator::operator != (const Iterator &other) const
1329  {
1330  return ! (*this == other);
1331  }
1332 
1333 
1334 
1335  inline
1336  bool
1337  Iterator::operator < (const Iterator &other) const
1338  {
1339  return (accessor.row() < other.accessor.row() ||
1340  (accessor.row() == other.accessor.row() &&
1341  accessor.index() < other.accessor.index()));
1342  }
1343 
1344  }
1345 
1346 
1347 
1348  inline
1350  SparsityPattern::begin() const
1351  {
1352  return const_iterator(this, 0, 0);
1353  }
1354 
1355 
1356 
1357  inline
1359  SparsityPattern::end() const
1360  {
1361  return const_iterator(this, n_rows(), 0);
1362  }
1363 
1364 
1365 
1366  inline
1368  SparsityPattern::begin(const size_type r) const
1369  {
1370  Assert (r < n_rows(), ExcIndexRangeType<size_type>(r, 0, n_rows()));
1371  if (row_length(r) > 0)
1372  return const_iterator(this, r, 0);
1373  else
1374  return end (r);
1375  }
1376 
1377 
1378 
1379  inline
1381  SparsityPattern::end(const size_type r) const
1382  {
1383  Assert (r < n_rows(), ExcIndexRangeType<size_type>(r, 0, n_rows()));
1384 
1385  // place the iterator on the first entry
1386  // past this line, or at the end of the
1387  // matrix
1388  for (size_type i=r+1; i<n_rows(); ++i)
1389  if (row_length(i) > 0)
1390  return const_iterator(this, i, 0);
1391 
1392  // if there is no such line, then take the
1393  // end iterator of the matrix
1394  return end();
1395  }
1396 
1397 
1398 
1399  inline
1400  bool
1401  SparsityPattern::in_local_range (const size_type index) const
1402  {
1403  TrilinosWrappers::types::int_type begin, end;
1404 #ifndef DEAL_II_WITH_64BIT_INDICES
1405  begin = graph->RowMap().MinMyGID();
1406  end = graph->RowMap().MaxMyGID()+1;
1407 #else
1408  begin = graph->RowMap().MinMyGID64();
1409  end = graph->RowMap().MaxMyGID64()+1;
1410 #endif
1411 
1412  return ((index >= static_cast<size_type>(begin)) &&
1413  (index < static_cast<size_type>(end)));
1414  }
1415 
1416 
1417 
1418  inline
1419  bool
1421  {
1422  return graph->Filled();
1423  }
1424 
1425 
1426 
1427  inline
1428  bool
1429  SparsityPattern::empty () const
1430  {
1431  return ((n_rows() == 0) && (n_cols() == 0));
1432  }
1433 
1434 
1435 
1436  inline
1437  void
1438  SparsityPattern::add (const size_type i,
1439  const size_type j)
1440  {
1441  add_entries (i, &j, &j+1);
1442  }
1443 
1444 
1445 
1446  template <typename ForwardIterator>
1447  inline
1448  void
1449  SparsityPattern::add_entries (const size_type row,
1450  ForwardIterator begin,
1451  ForwardIterator end,
1452  const bool /*indices_are_sorted*/)
1453  {
1454  if (begin == end)
1455  return;
1456 
1457  // verify that the size of the data type Trilinos expects matches that the
1458  // iterator points to. we allow for some slippage between signed and
1459  // unsigned and only compare that they are both either 32 or 64 bit. to
1460  // write this test properly, not that we cannot compare the size of
1461  // '*begin' because 'begin' may be an iterator and '*begin' may be an
1462  // accessor class. consequently, we need to somehow get an actual value
1463  // from it which we can by evaluating an expression such as when
1464  // multiplying the value produced by 2
1465  Assert (sizeof(TrilinosWrappers::types::int_type) ==
1466  sizeof((*begin)*2),
1467  ExcNotImplemented());
1468 
1469  TrilinosWrappers::types::int_type *col_index_ptr =
1470  (TrilinosWrappers::types::int_type *)(&*begin);
1471  const int n_cols = static_cast<int>(end - begin);
1472 
1473  int ierr;
1474  if ( graph->RowMap().LID(static_cast<TrilinosWrappers::types::int_type>(row)) != -1)
1475  ierr = graph->InsertGlobalIndices (row, n_cols, col_index_ptr);
1476  else if (nonlocal_graph.get() != nullptr)
1477  {
1478  // this is the case when we have explicitly set the off-processor rows
1479  // and want to create a separate matrix object for them (to retain
1480  // thread-safety)
1481  Assert (nonlocal_graph->RowMap().LID(static_cast<TrilinosWrappers::types::int_type>(row)) != -1,
1482  ExcMessage("Attempted to write into off-processor matrix row "
1483  "that has not be specified as being writable upon "
1484  "initialization"));
1485  ierr = nonlocal_graph->InsertGlobalIndices (row, n_cols, col_index_ptr);
1486  }
1487  else
1488  ierr = graph->InsertGlobalIndices
1489  (1, (TrilinosWrappers::types::int_type *)&row, n_cols, col_index_ptr);
1490 
1491  AssertThrow (ierr >= 0, ExcTrilinosError(ierr));
1492  }
1493 
1494 
1495 
1496  inline
1497  const Epetra_FECrsGraph &
1498  SparsityPattern::trilinos_sparsity_pattern () const
1499  {
1500  return *graph;
1501  }
1502 
1503 
1504 
1505  inline
1506  IndexSet
1507  SparsityPattern::locally_owned_domain_indices () const
1508  {
1509  return IndexSet(static_cast<const Epetra_Map &>(graph->DomainMap()));
1510  }
1511 
1512 
1513 
1514  inline
1515  IndexSet
1516  SparsityPattern::locally_owned_range_indices () const
1517  {
1518  return IndexSet(static_cast<const Epetra_Map &>(graph->RangeMap()));
1519  }
1520 
1521 #endif // DOXYGEN
1522 }
1523 
1524 
1525 DEAL_II_NAMESPACE_CLOSE
1526 
1527 
1528 #endif // DEAL_II_WITH_TRILINOS
1529 
1530 
1531 /*-------------------- trilinos_sparsity_pattern.h --------------------*/
1532 
1533 #endif
1534 /*-------------------- trilinos_sparsity_pattern.h --------------------*/
static ::ExceptionBase & ExcTrilinosError(int arg1)
static ::ExceptionBase & ExcAccessToNonLocalElement(size_type arg1, size_type arg2, size_type arg3, size_type arg4)
const Epetra_Map & domain_partitioner() const
void add_entries(const size_type row, ForwardIterator begin, ForwardIterator end, const bool indices_are_sorted=false)
#define DeclException2(Exception2, type1, type2, outsequence)
Definition: exceptions.h:358
static ::ExceptionBase & ExcBeyondEndOfSparsityPattern()
void print(std::ostream &out, const bool write_extended_trilinos_info=false) const
std::shared_ptr< const std::vector< size_type > > colnum_cache
virtual ~SparsityPattern()=default
static ::ExceptionBase & ExcAccessToNonPresentElement(size_type arg1, size_type arg2)
size_type row_length(const size_type row) const
IndexSet locally_owned_range_indices() const
const Epetra_FECrsGraph & trilinos_sparsity_pattern() const
static ::ExceptionBase & ExcSourceEqualsDestination()
iterator end() const
bool empty() const
#define AssertThrow(cond, exc)
Definition: exceptions.h:1221
void add(const size_type i, const size_type j)
void add_entries(const size_type row, ForwardIterator begin, ForwardIterator end, const bool indices_are_sorted=false)
SymmetricTensor< rank_, dim, Number > operator*(const SymmetricTensor< rank_, dim, Number > &t, const Number &factor)
std::unique_ptr< Epetra_CrsGraph > nonlocal_graph
size_type n_cols() const
bool is_compressed() const
const_iterator begin() const
size_type n_rows() const
bool exists(const size_type i, const size_type j) const
static ::ExceptionBase & ExcTrilinosError(int arg1)
static ::ExceptionBase & ExcMessage(std::string arg1)
static ::ExceptionBase & ExcInvalidIndex(size_type arg1, size_type arg2)
#define DeclException1(Exception1, type1, outsequence)
Definition: exceptions.h:346
void add(const size_type i, const size_type j)
std::unique_ptr< Epetra_Map > column_space_map
#define Assert(cond, exc)
Definition: exceptions.h:1142
#define DeclExceptionMsg(Exception, defaulttext)
Definition: exceptions.h:335
static ::ExceptionBase & ExcInvalidIndexWithinRow(size_type arg1, size_type arg2)
#define DeclException0(Exception0)
Definition: exceptions.h:323
void print_gnuplot(std::ostream &out) const
const_iterator end() const
SparsityPatternIterators::Iterator const_iterator
SparsityPatternIterators::Iterator const_iterator
static ::ExceptionBase & ExcIteratorPastEnd()
SparsityPattern & operator=(const SparsityPattern &input_sparsity_pattern)
types::global_dof_index size_type
void copy_from(const SparsityPattern &input_sparsity_pattern)
Iterator(const SparsityPattern *sparsity_pattern, const size_type row, const size_type index)
static ::ExceptionBase & ExcAccessToNonlocalRow(size_type arg1, size_type arg2, size_type arg3)
#define DeclException4(Exception4, type1, type2, type3, type4, outsequence)
Definition: exceptions.h:382
const Epetra_Comm & trilinos_communicator() const
static ::ExceptionBase & ExcNotImplemented()
#define DeclException3(Exception3, type1, type2, type3, outsequence)
Definition: exceptions.h:370
bool in_local_range(const size_type index) const
iterator begin() const
void reinit(const size_type m, const size_type n, const size_type n_entries_per_row=0)
IndexSet locally_owned_domain_indices() const
const Epetra_Map & range_partitioner() const
std::pair< size_type, size_type > local_range() const
std::unique_ptr< Epetra_FECrsGraph > graph
unsigned int row_length(const size_type row) const
Accessor(const SparsityPattern *sparsity_pattern, const size_type row, const size_type index)