|
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\}}\)
Go to the documentation of this file.
16 #ifndef dealii_trilinos_sparsity_pattern_h
17 # define dealii_trilinos_sparsity_pattern_h
22 # ifdef DEAL_II_WITH_TRILINOS
29 # include <Epetra_FECrsGraph.h>
30 # include <Epetra_Map.h>
35 # ifdef DEAL_II_WITH_MPI
36 # include <Epetra_MpiComm.h>
39 # include <Epetra_SerialComm.h>
124 <<
"You tried to access row " << arg1
125 <<
" of a distributed sparsity pattern, "
126 <<
" but only rows " << arg2 <<
" through " << arg3
127 <<
" are stored locally and can be accessed.");
246 <<
"Attempt to access element " << arg2 <<
" of row "
247 << arg1 <<
" which doesn't have that many elements.");
329 const std::vector<size_type> &n_entries_per_row);
375 const std::vector<size_type> &n_entries_per_row);
389 template <
typename SparsityPatternType>
391 copy_from(
const SparsityPatternType &nontrilinos_sparsity_pattern);
442 const MPI_Comm &communicator = MPI_COMM_WORLD,
457 const std::vector<size_type> &n_entries_per_row);
474 const IndexSet &col_parallel_partitioning,
475 const MPI_Comm &communicator = MPI_COMM_WORLD,
490 const IndexSet & col_parallel_partitioning,
492 const std::vector<size_type> &n_entries_per_row);
521 const IndexSet &col_parallel_partitioning,
523 const MPI_Comm &communicator = MPI_COMM_WORLD,
543 const MPI_Comm &communicator = MPI_COMM_WORLD,
559 const std::vector<size_type> &n_entries_per_row);
579 const IndexSet &col_parallel_partitioning,
580 const MPI_Comm &communicator = MPI_COMM_WORLD,
610 const IndexSet &col_parallel_partitioning,
612 const MPI_Comm &communicator = MPI_COMM_WORLD,
621 const IndexSet & col_parallel_partitioning,
623 const std::vector<size_type> &n_entries_per_row);
634 template <
typename SparsityPatternType>
637 const IndexSet & col_parallel_partitioning,
638 const SparsityPatternType &nontrilinos_sparsity_pattern,
639 const MPI_Comm & communicator = MPI_COMM_WORLD,
640 const bool exchange_data =
false);
650 template <
typename SparsityPatternType>
653 const SparsityPatternType &nontrilinos_sparsity_pattern,
654 const MPI_Comm & communicator = MPI_COMM_WORLD,
655 const bool exchange_data =
false);
707 std::pair<size_type, size_type>
786 template <
typename ForwardIterator>
789 ForwardIterator
begin,
791 const bool indices_are_sorted =
false);
802 const Epetra_FECrsGraph &
914 print(std::ostream &out,
915 const bool write_extended_trilinos_info =
false)
const;
944 <<
"An error with error number " << arg1
945 <<
" occurred while calling a Trilinos function");
953 <<
"The entry with index <" << arg1 <<
',' << arg2
954 <<
"> does not exist.");
961 "You are attempting an operation on two sparsity patterns that "
962 "are the same object, but the operation requires that the "
963 "two objects are in fact different.");
973 <<
"You tried to access element (" << arg1 <<
"/" << arg2
975 <<
" of a distributed matrix, but only rows " << arg3
976 <<
" through " << arg4
977 <<
" are stored locally and can be accessed.");
985 <<
"You tried to access element (" << arg1 <<
"/" << arg2
987 <<
" of a sparse matrix, but it appears to not"
988 <<
" exist in the Trilinos sparsity pattern.");
1002 std::unique_ptr<Epetra_FECrsGraph>
graph;
1033 visit_present_row();
1039 Accessor::row()
const
1041 Assert(a_row < sparsity_pattern->n_rows(),
1042 ExcBeyondEndOfSparsityPattern());
1049 Accessor::column()
const
1051 Assert(a_row < sparsity_pattern->n_rows(),
1052 ExcBeyondEndOfSparsityPattern());
1053 return (*colnum_cache)[a_index];
1059 Accessor::index()
const
1061 Assert(a_row < sparsity_pattern->n_rows(),
1062 ExcBeyondEndOfSparsityPattern());
1071 : accessor(sp, row, index)
1083 Assert(accessor.a_row < accessor.sparsity_pattern->n_rows(),
1090 if (accessor.a_index >= accessor.colnum_cache->size())
1092 accessor.a_index = 0;
1095 while (accessor.a_row < accessor.sparsity_pattern->n_rows())
1097 const auto row_length =
1098 accessor.sparsity_pattern->row_length(accessor.a_row);
1099 if (row_length == 0 ||
1100 !accessor.sparsity_pattern->row_is_stored_locally(
1107 accessor.visit_present_row();
1131 inline const Accessor *Iterator::operator->()
const
1141 return (accessor.a_row == other.accessor.a_row &&
1142 accessor.a_index == other.accessor.a_index);
1150 return !(*
this == other);
1158 return (accessor.row() < other.accessor.row() ||
1159 (accessor.row() == other.accessor.row() &&
1160 accessor.index() < other.accessor.index()));
1170 const size_type first_valid_row = this->local_range().first;
1216 SparsityPattern::in_local_range(
const size_type index)
const
1219 # ifndef DEAL_II_WITH_64BIT_INDICES
1220 begin = graph->RowMap().MinMyGID();
1221 end = graph->RowMap().MaxMyGID() + 1;
1223 begin = graph->RowMap().MinMyGID64();
1224 end = graph->RowMap().MaxMyGID64() + 1;
1236 return graph->Filled();
1257 template <
typename ForwardIterator>
1260 ForwardIterator
begin,
1261 ForwardIterator
end,
1280 const_cast<typename std::decay<decltype(*
begin)
>::type *>(&*
begin));
1287 if (row_is_stored_locally(row))
1289 graph->InsertGlobalIndices(trilinos_row_index,
n_cols, col_index_ptr);
1290 else if (nonlocal_graph.get() !=
nullptr)
1295 Assert(nonlocal_graph->RowMap().LID(
1297 ExcMessage(
"Attempted to write into off-processor matrix row "
1298 "that has not be specified as being writable upon "
1300 ierr = nonlocal_graph->InsertGlobalIndices(trilinos_row_index,
1305 ierr = graph->InsertGlobalIndices(1,
1306 &trilinos_row_index,
1315 inline const Epetra_FECrsGraph &
1316 SparsityPattern::trilinos_sparsity_pattern()
const
1324 SparsityPattern::locally_owned_domain_indices()
const
1326 return IndexSet(graph->DomainMap());
1332 SparsityPattern::locally_owned_range_indices()
const
1334 return IndexSet(graph->RangeMap());
1344 # endif // DEAL_II_WITH_TRILINOS
::types::global_dof_index size_type
bool in_local_range(const size_type index) const
unsigned int row_length(const size_type row) const
#define DeclExceptionMsg(Exception, defaulttext)
bool operator!=(const AlignedVector< T > &lhs, const AlignedVector< T > &rhs)
SynchronousIterators< Iterators > operator++(SynchronousIterators< Iterators > &a)
size_type n_nonzero_elements() const
bool operator<(const SynchronousIterators< Iterators > &a, const SynchronousIterators< Iterators > &b)
const Epetra_Map & range_partitioner() const
Accessor(const SparsityPattern *sparsity_pattern, const size_type row, const size_type index)
size_type row_length(const size_type row) const
static ::ExceptionBase & ExcBeyondEndOfSparsityPattern()
void add(const size_type i, const size_type j)
static ::ExceptionBase & ExcNotImplemented()
bool operator==(const AlignedVector< T > &lhs, const AlignedVector< T > &rhs)
bool row_is_stored_locally(const size_type i) const
MatrixTableIterators::Accessor< TransposeTable< T >, Constness, MatrixTableIterators::Storage::column_major > Accessor
bool operator<(const Iterator &) const
::types::global_dof_index size_type
const Accessor & operator*() const
SparsityPattern * sparsity_pattern
void add(const size_type i, const size_type j)
const Epetra_Map & domain_partitioner() const
unsigned int local_size() const
std::unique_ptr< Epetra_Map > column_space_map
IndexSet locally_owned_range_indices() const
void add_entries(const size_type row, ForwardIterator begin, ForwardIterator end, const bool indices_are_sorted=false)
#define AssertIndexRange(index, range)
bool exists(const size_type i, const size_type j) const
::types::global_dof_index size_type
std::shared_ptr< const std::vector< size_type > > colnum_cache
static ::ExceptionBase & ExcTrilinosError(int arg1)
const Epetra_FECrsGraph & trilinos_sparsity_pattern() const
static ::ExceptionBase & ExcSourceEqualsDestination()
MatrixTableIterators::Iterator< TransposeTable< T >, Constness, MatrixTableIterators::Storage::column_major > Iterator
bool operator==(const Iterator &) const
static ::ExceptionBase & ExcMessage(std::string arg1)
unsigned int global_dof_index
VectorType::value_type * begin(VectorType &V)
bool operator!=(const Iterator &) const
std::size_t memory_consumption() const
#define DEAL_II_NAMESPACE_OPEN
const_iterator begin() const
void print(std::ostream &out, const bool write_extended_trilinos_info=false) const
virtual ~SparsityPattern() override=default
static ::ExceptionBase & ExcAccessToNonLocalElement(size_type arg1, size_type arg2, size_type arg3, size_type arg4)
static ::ExceptionBase & ExcAccessToNonlocalRow(size_type arg1, size_type arg2, size_type arg3)
void print_gnuplot(std::ostream &out) const
#define DeclException3(Exception3, type1, type2, type3, outsequence)
size_type bandwidth() const
VectorType::value_type * end(VectorType &V)
#define DeclException1(Exception1, type1, outsequence)
#define AssertDimension(dim1, dim2)
MPI_Comm get_mpi_communicator() const
#define DeclException4(Exception4, type1, type2, type3, type4, outsequence)
static ::ExceptionBase & ExcInvalidIndexWithinRow(size_type arg1, size_type arg2)
std::unique_ptr< Epetra_FECrsGraph > graph
types::global_dof_index size_type
static ::ExceptionBase & ExcTrilinosError(int arg1)
std::unique_ptr< Epetra_CrsGraph > nonlocal_graph
#define Assert(cond, exc)
Iterator(const SparsityPattern *sparsity_pattern, const size_type row, const size_type index)
unsigned int max_entries_per_row() const
bool is_compressed() const
static ::ExceptionBase & ExcInvalidIndex(size_type arg1, size_type arg2)
#define DeclException0(Exception0)
void copy_from(const SparsityPattern &input_sparsity_pattern)
const_iterator end() const
static ::ExceptionBase & ExcAccessToNonPresentElement(size_type arg1, size_type arg2)
bool is_compressed() const
void add_entries(const size_type row, ForwardIterator begin, ForwardIterator end, const bool indices_are_sorted=false)
SparsityPattern & operator=(const SparsityPattern &input_sparsity_pattern)
const Accessor * operator->() const
void reinit(const size_type m, const size_type n, const size_type n_entries_per_row=0)
#define DEAL_II_NAMESPACE_CLOSE
SparsityPatternBase::const_iterator const_iterator
std::pair< size_type, size_type > local_range() const
#define DeclException2(Exception2, type1, type2, outsequence)
#define AssertThrow(cond, exc)
IndexSet locally_owned_domain_indices() const
SparsityPatternBase::size_type size_type
static ::ExceptionBase & ExcIteratorPastEnd()
std::enable_if< std::is_floating_point< T >::value &&std::is_floating_point< U >::value, typename ProductType< std::complex< T >, std::complex< U > >::type >::type operator*(const std::complex< T > &left, const std::complex< U > &right)