16 #ifndef dealii_trilinos_sparse_matrix_h
17 # define dealii_trilinos_sparse_matrix_h
22 # ifdef DEAL_II_WITH_TRILINOS
37 # include <Epetra_Comm.h>
38 # include <Epetra_CrsGraph.h>
39 # include <Epetra_Export.h>
40 # include <Epetra_FECrsMatrix.h>
41 # include <Epetra_Map.h>
42 # include <Epetra_MpiComm.h>
43 # include <Epetra_MultiVector.h>
44 # include <Epetra_Operator.h>
49 # include <type_traits>
56 template <
typename MatrixType>
59 template <
typename number>
71 template <
bool Constness>
96 <<
"You tried to access row " << arg1
97 <<
" of a distributed sparsity pattern, "
98 <<
" but only rows " << arg2 <<
" through " << arg3
99 <<
" are stored locally and can be accessed.");
197 template <
bool Constess>
238 template <
bool Other>
335 friend class Reference;
351 template <
bool Constness>
387 template <
bool Other>
447 <<
"Attempt to access element " << arg2 <<
" of row "
448 << arg1 <<
" which doesn't have that many elements.");
456 template <
bool Other>
467 template <
bool Constness>
468 struct iterator_traits<
473 typename ::TrilinosWrappers::SparseMatrixIterators::Iterator<
476 typename ::TrilinosWrappers::SparseMatrixIterators::Iterator<
559 <<
"You tried to access row " << arg1
560 <<
" of a non-contiguous locally owned row set."
561 <<
" The row " << arg1
562 <<
" is not stored locally and can't be accessed.");
613 const unsigned int n_max_entries_per_row);
624 const std::vector<unsigned int> &n_entries_per_row);
668 template <
typename SparsityPatternType>
670 reinit(
const SparsityPatternType &sparsity_pattern);
718 template <
typename number>
720 reinit(const ::SparseMatrix<number> &dealii_sparse_matrix,
721 const double drop_tolerance = 1
e-13,
722 const bool copy_values =
true,
723 const ::SparsityPattern * use_this_sparsity =
nullptr);
731 reinit(
const Epetra_CrsMatrix &input_matrix,
const bool copy_values =
true);
751 const MPI_Comm & communicator = MPI_COMM_WORLD,
752 const unsigned int n_max_entries_per_row = 0);
762 const MPI_Comm & communicator,
763 const std::vector<unsigned int> &n_entries_per_row);
780 const IndexSet &col_parallel_partitioning,
781 const MPI_Comm &communicator = MPI_COMM_WORLD,
782 const size_type n_max_entries_per_row = 0);
799 const IndexSet & col_parallel_partitioning,
800 const MPI_Comm & communicator,
801 const std::vector<unsigned int> &n_entries_per_row);
823 template <
typename SparsityPatternType>
826 const SparsityPatternType &sparsity_pattern,
827 const MPI_Comm & communicator = MPI_COMM_WORLD,
828 const bool exchange_data =
false);
842 template <
typename SparsityPatternType>
844 !std::is_same<SparsityPatternType, ::SparseMatrix<double>>::value>
846 const IndexSet & col_parallel_partitioning,
847 const SparsityPatternType &sparsity_pattern,
848 const MPI_Comm & communicator = MPI_COMM_WORLD,
849 const bool exchange_data =
false);
867 template <
typename number>
870 const ::SparseMatrix<number> &dealii_sparse_matrix,
871 const MPI_Comm & communicator = MPI_COMM_WORLD,
872 const double drop_tolerance = 1
e-13,
873 const bool copy_values =
true,
874 const ::SparsityPattern * use_this_sparsity =
nullptr);
889 template <
typename number>
892 const IndexSet & col_parallel_partitioning,
893 const ::SparseMatrix<number> &dealii_sparse_matrix,
894 const MPI_Comm & communicator = MPI_COMM_WORLD,
895 const double drop_tolerance = 1
e-13,
896 const bool copy_values =
true,
897 const ::SparsityPattern * use_this_sparsity =
nullptr);
935 std::pair<size_type, size_type>
1096 set(
const std::vector<size_type> & indices,
1098 const bool elide_zero_values =
false);
1106 set(
const std::vector<size_type> & row_indices,
1107 const std::vector<size_type> & col_indices,
1109 const bool elide_zero_values =
false);
1140 const std::vector<size_type> & col_indices,
1141 const std::vector<TrilinosScalar> &
values,
1142 const bool elide_zero_values =
false);
1171 template <
typename Number>
1177 const bool elide_zero_values =
false);
1210 add(
const std::vector<size_type> & indices,
1212 const bool elide_zero_values =
true);
1220 add(
const std::vector<size_type> & row_indices,
1221 const std::vector<size_type> & col_indices,
1223 const bool elide_zero_values =
true);
1240 const std::vector<size_type> & col_indices,
1241 const std::vector<TrilinosScalar> &
values,
1242 const bool elide_zero_values =
true);
1262 const bool elide_zero_values =
true,
1263 const bool col_indices_are_sorted =
false);
1343 clear_rows(
const std::vector<size_type> &rows,
1439 template <
typename VectorType>
1441 std::is_same<typename VectorType::value_type, TrilinosScalar>::value>
1442 vmult(VectorType &dst,
const VectorType &src)
const;
1450 template <
typename VectorType>
1452 !std::is_same<typename VectorType::value_type, TrilinosScalar>::value>
1453 vmult(VectorType &dst,
const VectorType &src)
const;
1469 template <
typename VectorType>
1471 std::is_same<typename VectorType::value_type, TrilinosScalar>::value>
1472 Tvmult(VectorType &dst,
const VectorType &src)
const;
1480 template <
typename VectorType>
1482 !std::is_same<typename VectorType::value_type, TrilinosScalar>::value>
1483 Tvmult(VectorType &dst,
const VectorType &src)
const;
1494 template <
typename VectorType>
1496 vmult_add(VectorType &dst,
const VectorType &src)
const;
1508 template <
typename VectorType>
1510 Tvmult_add(VectorType &dst,
const VectorType &src)
const;
1664 const Epetra_CrsMatrix &
1671 const Epetra_CrsGraph &
1820 print(std::ostream &out,
1821 const bool write_extended_trilinos_info =
false)
const;
1834 <<
"An error with error number " << arg1
1835 <<
" occurred while calling a Trilinos function. "
1837 "For historical reasons, many Trilinos functions express "
1838 "errors by returning specific integer values to indicate "
1839 "certain errors. Unfortunately, different Trilinos functions "
1840 "often use the same integer values for different kinds of "
1841 "errors, and in most cases it is also not documented what "
1842 "each error code actually means. As a consequence, it is often "
1843 "difficult to say what a particular error (in this case, "
1844 "the error with integer code '"
1846 <<
"') represents and how one should fix a code to avoid it. "
1847 "The best one can often do is to look up the call stack to "
1848 "see which deal.II function generated the error, and which "
1849 "Trilinos function the error code had originated from; "
1850 "then look up the Trilinos source code of that function (for "
1851 "example on github) to see what code path set that error "
1852 "code. Short of going through all of that, the only other "
1853 "option is to guess the cause of the error from "
1854 "the context in which the error appeared.");
1863 <<
"The entry with index <" << arg1 <<
',' << arg2
1864 <<
"> does not exist.");
1870 "You are attempting an operation on two vectors that "
1871 "are the same object, but the operation requires that the "
1872 "two objects are in fact different.");
1887 <<
"You tried to access element (" << arg1 <<
'/' << arg2
1889 <<
" of a distributed matrix, but only rows in range ["
1890 << arg3 <<
',' << arg4
1891 <<
"] are stored locally and can be accessed.");
1899 <<
"You tried to access element (" << arg1 <<
'/' << arg2
1900 <<
')' <<
" of a sparse matrix, but it appears to not"
1901 <<
" exist in the Trilinos sparsity pattern.");
1989 const Epetra_MultiVector &src,
1990 const Epetra_MultiVector &dst,
1995 Assert(src.Map().SameAs(mtrx.DomainMap()) ==
true,
1997 "Column map of matrix does not fit with vector map!"));
1998 Assert(dst.Map().SameAs(mtrx.RangeMap()) ==
true,
1999 ExcMessage(
"Row map of matrix does not fit with vector map!"));
2003 Assert(src.Map().SameAs(mtrx.RangeMap()) ==
true,
2005 "Column map of matrix does not fit with vector map!"));
2006 Assert(dst.Map().SameAs(mtrx.DomainMap()) ==
true,
2007 ExcMessage(
"Row map of matrix does not fit with vector map!"));
2016 const Epetra_MultiVector &src,
2017 const Epetra_MultiVector &dst,
2022 Assert(src.Map().SameAs(op.OperatorDomainMap()) ==
true,
2024 "Column map of operator does not fit with vector map!"));
2025 Assert(dst.Map().SameAs(op.OperatorRangeMap()) ==
true,
2027 "Row map of operator does not fit with vector map!"));
2031 Assert(src.Map().SameAs(op.OperatorRangeMap()) ==
true,
2033 "Column map of operator does not fit with vector map!"));
2034 Assert(dst.Map().SameAs(op.OperatorDomainMap()) ==
true,
2036 "Row map of operator does not fit with vector map!"));
2043 namespace LinearOperatorImplementation
2183 template <
typename Solver,
typename Preconditioner>
2185 std::is_base_of<TrilinosWrappers::SolverBase, Solver>::value &&
2187 Preconditioner>::value,
2208 template <
typename Solver,
typename Preconditioner>
2210 !(std::is_base_of<TrilinosWrappers::SolverBase, Solver>::value &&
2212 Preconditioner>::value),
2373 virtual const char *
2374 Label()
const override;
2383 virtual const Epetra_Comm &
2384 Comm()
const override;
2393 virtual const Epetra_Map &
2404 virtual const Epetra_Map &
2418 template <
typename EpetraOpType>
2420 const bool supports_inverse_operations,
2422 const MPI_Comm &mpi_communicator,
2506 visit_present_row();
2511 AccessorBase::row()
const
2519 AccessorBase::column()
const
2522 return (*colnum_cache)[a_index];
2527 AccessorBase::index()
const
2534 inline Accessor<true>::Accessor(MatrixType *
matrix,
2541 template <
bool Other>
2542 inline Accessor<true>::Accessor(
const Accessor<Other> &other)
2543 : AccessorBase(other)
2548 Accessor<true>::value()
const
2551 return (*value_cache)[a_index];
2555 inline Accessor<false>::Reference::Reference(
const Accessor<false> &acc)
2556 : accessor(const_cast<Accessor<false> &>(acc))
2560 inline Accessor<false>::Reference::operator
TrilinosScalar()
const
2562 return (*accessor.value_cache)[accessor.a_index];
2565 inline const Accessor<false>::Reference &
2566 Accessor<false>::Reference::operator=(
const TrilinosScalar n)
const
2568 (*accessor.value_cache)[accessor.a_index] = n;
2569 accessor.matrix->set(accessor.row(),
2576 inline const Accessor<false>::Reference &
2577 Accessor<false>::Reference::operator+=(
const TrilinosScalar n)
const
2579 (*accessor.value_cache)[accessor.a_index] += n;
2580 accessor.matrix->set(accessor.row(),
2587 inline const Accessor<false>::Reference &
2588 Accessor<false>::Reference::operator-=(
const TrilinosScalar n)
const
2590 (*accessor.value_cache)[accessor.a_index] -= n;
2591 accessor.matrix->set(accessor.row(),
2598 inline const Accessor<false>::Reference &
2599 Accessor<false>::Reference::operator*=(
const TrilinosScalar n)
const
2601 (*accessor.value_cache)[accessor.a_index] *= n;
2602 accessor.matrix->set(accessor.row(),
2609 inline const Accessor<false>::Reference &
2610 Accessor<false>::Reference::operator/=(
const TrilinosScalar n)
const
2612 (*accessor.value_cache)[accessor.a_index] /= n;
2613 accessor.matrix->set(accessor.row(),
2620 inline Accessor<false>::Accessor(MatrixType *
matrix,
2627 inline Accessor<false>::Reference
2628 Accessor<false>::value()
const
2636 template <
bool Constness>
2637 inline Iterator<Constness>::Iterator(MatrixType *
matrix,
2644 template <
bool Constness>
2645 template <
bool Other>
2646 inline Iterator<Constness>::Iterator(
const Iterator<Other> &other)
2647 : accessor(other.accessor)
2651 template <
bool Constness>
2652 inline Iterator<Constness> &
2663 if (accessor.a_index >= accessor.colnum_cache->size())
2665 accessor.a_index = 0;
2668 while ((accessor.a_row < accessor.matrix->m()) &&
2669 ((accessor.matrix->in_local_range(accessor.a_row) ==
false) ||
2670 (accessor.matrix->row_length(accessor.a_row) == 0)))
2673 accessor.visit_present_row();
2679 template <
bool Constness>
2680 inline Iterator<Constness>
2683 const Iterator<Constness> old_state = *
this;
2690 template <
bool Constness>
2691 inline const Accessor<Constness> &
2699 template <
bool Constness>
2700 inline const Accessor<Constness> *
2701 Iterator<Constness>::operator->()
const
2708 template <
bool Constness>
2712 return (accessor.a_row == other.accessor.a_row &&
2713 accessor.a_index == other.accessor.a_index);
2718 template <
bool Constness>
2722 return !(*
this == other);
2727 template <
bool Constness>
2731 return (accessor.row() < other.accessor.row() ||
2732 (accessor.row() == other.accessor.row() &&
2733 accessor.index() < other.accessor.index()));
2737 template <
bool Constness>
2741 return (other < *
this);
2759 return const_iterator(
this, m(), 0);
2768 if (in_local_range(r) && (row_length(r) > 0))
2769 return const_iterator(
this, r, 0);
2785 if (in_local_range(i) && (row_length(i) > 0))
2786 return const_iterator(
this, i, 0);
2806 return iterator(
this, m(), 0);
2815 if (in_local_range(r) && (row_length(r) > 0))
2816 return iterator(
this, r, 0);
2832 if (in_local_range(i) && (row_length(i) > 0))
2833 return iterator(
this, i, 0);
2846 # ifndef DEAL_II_WITH_64BIT_INDICES
2851 end =
matrix->RowMap().MaxMyGID64() + 1;
2873 SparseMatrix::set<TrilinosScalar>(
const size_type row,
2877 const bool elide_zero_values);
2881 template <
typename Number>
2887 const bool elide_zero_values)
2889 std::vector<TrilinosScalar> trilinos_values(n_cols);
2892 row, n_cols, col_indices, trilinos_values.data(), elide_zero_values);
2904 set(i, 1, &j, &value,
false);
2912 const bool elide_zero_values)
2918 for (
size_type i = 0; i < indices.size(); ++i)
2943 if (last_action == Insert)
2945 const int ierr =
matrix->GlobalAssemble(*column_space_map,
2957 add(i, 1, &j, &value,
false);
2967 # ifndef DEAL_II_WITH_64BIT_INDICES
2968 return matrix->NumGlobalRows();
2970 return matrix->NumGlobalRows64();
2991 return matrix->NumMyRows();
2996 inline std::pair<SparseMatrix::size_type, SparseMatrix::size_type>
3000 # ifndef DEAL_II_WITH_64BIT_INDICES
3005 end =
matrix->RowMap().MaxMyGID64() + 1;
3013 inline std::uint64_t
3020 return static_cast<std::uint64_t
>(
matrix->NumGlobalNonzeros64());
3025 template <
typename SparsityPatternType>
3028 const SparsityPatternType &sparsity_pattern,
3029 const MPI_Comm & communicator,
3030 const bool exchange_data)
3032 reinit(parallel_partitioning,
3033 parallel_partitioning,
3041 template <
typename number>
3044 const ::SparseMatrix<number> &sparse_matrix,
3045 const MPI_Comm & communicator,
3046 const double drop_tolerance,
3047 const bool copy_values,
3048 const ::SparsityPattern * use_this_sparsity)
3052 reinit(parallel_partitioning,
3053 parallel_partitioning,
3062 inline const Epetra_CrsMatrix &
3065 return static_cast<const Epetra_CrsMatrix &
>(*matrix);
3070 inline const Epetra_CrsGraph &
3111 namespace LinearOperatorImplementation
3113 template <
typename EpetraOpType>
3114 TrilinosPayload::TrilinosPayload(
3116 const bool supports_inverse_operations,
3117 const bool use_transpose,
3118 const MPI_Comm &mpi_communicator,
3119 const IndexSet &locally_owned_domain_indices,
3120 const IndexSet &locally_owned_range_indices)
3121 : use_transpose(use_transpose)
3122 , communicator(mpi_communicator)
3124 locally_owned_domain_indices.make_trilinos_map(communicator.Comm()))
3126 locally_owned_range_indices.make_trilinos_map(communicator.Comm()))
3131 Assert(&tril_src != &tril_dst,
3138 const int ierr = op.Apply(tril_src, tril_dst);
3145 Assert(&tril_src != &tril_dst,
3150 !op.UseTranspose());
3152 op.SetUseTranspose(!op.UseTranspose());
3153 const int ierr = op.Apply(tril_src, tril_dst);
3155 op.SetUseTranspose(!op.UseTranspose());
3158 if (supports_inverse_operations)
3164 &tril_src != &tril_dst,
3169 !op.UseTranspose());
3171 const int ierr = op.ApplyInverse(tril_src, tril_dst);
3179 &tril_src != &tril_dst,
3186 op.SetUseTranspose(!op.UseTranspose());
3187 const int ierr = op.ApplyInverse(tril_src, tril_dst);
3189 op.SetUseTranspose(!op.UseTranspose());
3197 "Uninitialized TrilinosPayload::inv_vmult called. "
3198 "The operator does not support inverse operations."));
3204 "Uninitialized TrilinosPayload::inv_Tvmult called. "
3205 "The operator does not support inverse operations."));
3211 template <
typename Solver,
typename Preconditioner>
3213 std::is_base_of<TrilinosWrappers::SolverBase, Solver>::value &&
3215 Preconditioner>::value,
3219 const Preconditioner &preconditioner)
const
3221 const auto &payload = *
this;
3227 return_op.inv_vmult = [payload, &solver, &preconditioner](
3232 Assert(&tril_src != &tril_dst,
3237 !payload.UseTranspose());
3238 solver.solve(payload, tril_dst, tril_src, preconditioner);
3241 return_op.inv_Tvmult = [payload, &solver, &preconditioner](
3246 Assert(&tril_src != &tril_dst,
3251 payload.UseTranspose());
3254 solver.solve(payload, tril_dst, tril_src, preconditioner);
3260 if (return_op.UseTranspose() ==
true)
3261 std::swap(return_op.inv_vmult, return_op.inv_Tvmult);
3266 template <
typename Solver,
typename Preconditioner>
3268 !(std::is_base_of<TrilinosWrappers::SolverBase, Solver>::value &&
3270 Preconditioner>::value),
3274 TrilinosPayload return_op(*
this);
3279 ExcMessage(
"Payload inv_vmult disabled because of "
3280 "incompatible solver/preconditioner choice."));
3286 ExcMessage(
"Payload inv_vmult disabled because of "
3287 "incompatible solver/preconditioner choice."));
3297 SparseMatrix::set<TrilinosScalar>(
const size_type row,
3301 const bool elide_zero_values);
bool operator!=(const AlignedVector< T > &lhs, const AlignedVector< T > &rhs)
bool operator==(const AlignedVector< T > &lhs, const AlignedVector< T > &rhs)
Epetra_Map make_trilinos_map(const MPI_Comm &communicator=MPI_COMM_WORLD, const bool overlapping=false) const
types::global_dof_index size_type
AccessorBase(SparseMatrix *matrix, const size_type row, const size_type index)
::types::global_dof_index size_type
std::shared_ptr< std::vector< TrilinosScalar > > value_cache
std::shared_ptr< std::vector< size_type > > colnum_cache
const Reference & operator/=(const TrilinosScalar n) const
Reference(const Accessor< false > &accessor)
const Reference & operator=(const TrilinosScalar n) const
const Reference & operator*=(const TrilinosScalar n) const
const Reference & operator-=(const TrilinosScalar n) const
const Reference & operator+=(const TrilinosScalar n) const
Accessor(MatrixType *matrix, const size_type row, const size_type index)
Accessor(const Accessor< Other > &a)
Accessor(MatrixType *matrix, const size_type row, const size_type index)
TrilinosScalar value() const
TrilinosScalar value() const
Iterator< Constness > & operator++()
::types::global_dof_index difference_type
bool operator>(const Iterator< Constness > &) const
typename Accessor< Constness >::MatrixType MatrixType
Iterator(const Iterator< Other > &other)
::types::global_dof_index size_type
bool operator==(const Iterator< Constness > &) const
bool operator!=(const Iterator< Constness > &) const
Iterator(MatrixType *matrix, const size_type row, const size_type index)
const Accessor< Constness > * operator->() const
Accessor< Constness > accessor
bool operator<(const Iterator< Constness > &) const
const Accessor< Constness > & operator*() const
Iterator< Constness > operator++(int)
void set(const size_type i, const size_type j, const TrilinosScalar value)
std::unique_ptr< Epetra_Map > column_space_map
MPI_Comm get_mpi_communicator() const
SparseMatrix & operator*=(const TrilinosScalar factor)
void mmult(SparseMatrix &C, const SparseMatrix &B, const MPI::Vector &V=MPI::Vector()) const
std::unique_ptr< Epetra_Export > nonlocal_matrix_exporter
TrilinosScalar l1_norm() const
void compress(VectorOperation::values operation)
std::unique_ptr< Epetra_FECrsMatrix > matrix
const Epetra_CrsMatrix & trilinos_matrix() const
::types::global_dof_index size_type
TrilinosScalar linfty_norm() const
size_type memory_consumption() const
TrilinosScalar matrix_norm_square(const MPI::Vector &v) const
Epetra_CombineMode last_action
void reinit(const IndexSet ¶llel_partitioning, const ::SparseMatrix< number > &dealii_sparse_matrix, const MPI_Comm &communicator=MPI_COMM_WORLD, const double drop_tolerance=1e-13, const bool copy_values=true, const ::SparsityPattern *use_this_sparsity=nullptr)
IndexSet locally_owned_range_indices() const
void print(std::ostream &out, const bool write_extended_trilinos_info=false) const
void Tmmult(SparseMatrix &C, const SparseMatrix &B, const MPI::Vector &V=MPI::Vector()) const
std::enable_if_t< !std::is_same< SparsityPatternType, ::SparseMatrix< double > >::value > reinit(const IndexSet &row_parallel_partitioning, const IndexSet &col_parallel_partitioning, const SparsityPatternType &sparsity_pattern, const MPI_Comm &communicator=MPI_COMM_WORLD, const bool exchange_data=false)
void clear_row(const size_type row, const TrilinosScalar new_diag_value=0)
const_iterator begin() const
std::pair< size_type, size_type > local_range() const
const Epetra_CrsGraph & trilinos_sparsity_pattern() const
void reinit(const SparsityPatternType &sparsity_pattern)
std::enable_if_t< std::is_same< typename VectorType::value_type, TrilinosScalar >::value > Tvmult(VectorType &dst, const VectorType &src) const
void vmult_add(VectorType &dst, const VectorType &src) const
const_iterator end(const size_type r) const
SparseMatrix & operator/=(const TrilinosScalar factor)
void Tvmult_add(VectorType &dst, const VectorType &src) const
void clear_rows(const std::vector< size_type > &rows, const TrilinosScalar new_diag_value=0)
bool is_compressed() const
TrilinosScalar el(const size_type i, const size_type j) const
IndexSet locally_owned_domain_indices() const
TrilinosScalar residual(MPI::Vector &dst, const MPI::Vector &x, const MPI::Vector &b) const
bool in_local_range(const size_type index) const
void copy_from(const SparseMatrix &source)
unsigned int row_length(const size_type row) const
TrilinosScalar frobenius_norm() const
std::uint64_t n_nonzero_elements() const
const_iterator begin(const size_type r) const
SparseMatrix(const SparseMatrix &)=delete
iterator end(const size_type r)
void reinit(const IndexSet ¶llel_partitioning, const SparsityPatternType &sparsity_pattern, const MPI_Comm &communicator=MPI_COMM_WORLD, const bool exchange_data=false)
TrilinosScalar diag_element(const size_type i) const
void add(const size_type i, const size_type j, const TrilinosScalar value)
unsigned int local_size() const
iterator begin(const size_type r)
TrilinosScalar operator()(const size_type i, const size_type j) const
virtual ~SparseMatrix() override=default
void set(const size_type row, const size_type n_cols, const size_type *col_indices, const Number *values, const bool elide_zero_values=false)
TrilinosScalar matrix_scalar_product(const MPI::Vector &u, const MPI::Vector &v) const
const_iterator end() const
void set(const std::vector< size_type > &indices, const FullMatrix< TrilinosScalar > &full_matrix, const bool elide_zero_values=false)
std::enable_if_t< std::is_same< typename VectorType::value_type, TrilinosScalar >::value > vmult(VectorType &dst, const VectorType &src) const
SparseMatrix & operator=(const SparseMatrix &)=delete
std::unique_ptr< Epetra_CrsMatrix > nonlocal_matrix
Epetra_MpiComm communicator
std::function< void(VectorType &, const VectorType &)> inv_Tvmult
virtual int SetUseTranspose(bool UseTranspose) override
virtual bool UseTranspose() const override
virtual const Epetra_Map & OperatorDomainMap() const override
IndexSet locally_owned_range_indices() const
TrilinosPayload transpose_payload() const
Epetra_MultiVector VectorType
MPI_Comm get_mpi_communicator() const
TrilinosPayload(EpetraOpType &op, const bool supports_inverse_operations, const bool use_transpose, const MPI_Comm &mpi_communicator, const IndexSet &locally_owned_domain_indices, const IndexSet &locally_owned_range_indices)
virtual ~TrilinosPayload() override=default
virtual int ApplyInverse(const VectorType &Y, VectorType &X) const override
std::function< void(VectorType &, const VectorType &)> Tvmult
virtual int Apply(const VectorType &X, VectorType &Y) const override
std::enable_if_t< !(std::is_base_of< TrilinosWrappers::SolverBase, Solver >::value &&std::is_base_of< TrilinosWrappers::PreconditionBase, Preconditioner >::value), TrilinosPayload > inverse_payload(Solver &, const Preconditioner &) const
std::function< void(VectorType &, const VectorType &)> vmult
virtual const Epetra_Map & OperatorRangeMap() const override
std::function< void(VectorType &, const VectorType &)> inv_vmult
virtual const char * Label() const override
IndexSet locally_owned_domain_indices() const
virtual const Epetra_Comm & Comm() const override
virtual bool HasNormInf() const override
TrilinosPayload identity_payload() const
virtual double NormInf() const override
TrilinosPayload null_payload() const
std::enable_if_t< std::is_base_of< TrilinosWrappers::SolverBase, Solver >::value &&std::is_base_of< TrilinosWrappers::PreconditionBase, Preconditioner >::value, TrilinosPayload > inverse_payload(Solver &, const Preconditioner &) const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
__global__ void set(Number *val, const Number s, const size_type N)
#define DeclException0(Exception0)
static ::ExceptionBase & ExcInvalidIndexWithinRow(size_type arg1, size_type arg2)
static ::ExceptionBase & ExcTrilinosError(int arg1)
static ::ExceptionBase & ExcAccessToNonlocalRow(std::size_t arg1)
static ::ExceptionBase & ExcInternalError()
#define DeclException4(Exception4, type1, type2, type3, type4, outsequence)
static ::ExceptionBase & ExcInvalidIndex(size_type arg1, size_type arg2)
static ::ExceptionBase & ExcSourceEqualsDestination()
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
static ::ExceptionBase & ExcIteratorPastEnd()
static ::ExceptionBase & ExcAccessToNonlocalRow(std::size_t arg1, std::size_t arg2, std::size_t arg3)
static ::ExceptionBase & ExcBeyondEndOfMatrix()
#define Assert(cond, exc)
#define AssertIsFinite(number)
static ::ExceptionBase & ExcTrilinosError(int arg1)
#define DeclException2(Exception2, type1, type2, outsequence)
static ::ExceptionBase & ExcAccessToNonLocalElement(size_type arg1, size_type arg2, size_type arg3, size_type arg4)
#define AssertIndexRange(index, range)
#define DeclExceptionMsg(Exception, defaulttext)
#define DeclException3(Exception3, type1, type2, type3, outsequence)
static ::ExceptionBase & ExcMatrixNotCompressed()
#define DeclException1(Exception1, type1, outsequence)
static ::ExceptionBase & ExcAccessToNonPresentElement(size_type arg1, size_type arg2)
static ::ExceptionBase & ExcMessage(std::string arg1)
static ::ExceptionBase & ExcNotQuadratic()
#define AssertThrow(cond, exc)
Expression operator>(const Expression &lhs, const Expression &rhs)
@ matrix
Contents is actually a matrix.
SparseMatrix< double > SparseMatrix
types::global_dof_index size_type
void swap(MemorySpaceData< T, MemorySpace > &u, MemorySpaceData< T, MemorySpace > &v)
SymmetricTensor< 2, dim, Number > C(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
TrilinosPayload operator+(const TrilinosPayload &first_op, const TrilinosPayload &second_op)
TrilinosPayload operator*(const TrilinosPayload &first_op, const TrilinosPayload &second_op)
void check_vector_map_equality(const Epetra_CrsMatrix &mtrx, const Epetra_MultiVector &src, const Epetra_MultiVector &dst, const bool transpose)
VectorType::value_type * begin(VectorType &V)
VectorType::value_type * end(VectorType &V)
TrilinosWrappers::types::int64_type n_global_elements(const Epetra_BlockMap &map)
void copy(const T *begin, const T *end, U *dest)
void reinit(MatrixBlock< MatrixType > &v, const BlockSparsityPattern &p)
unsigned int global_dof_index
static const bool zero_addition_can_be_elided
typename ::TrilinosWrappers::SparseMatrixIterators::Iterator< Constness >::value_type value_type
forward_iterator_tag iterator_category
typename ::TrilinosWrappers::SparseMatrixIterators::Iterator< Constness >::difference_type difference_type
SynchronousIterators< Iterators > operator++(SynchronousIterators< Iterators > &a)
bool operator<(const SynchronousIterators< Iterators > &a, const SynchronousIterators< Iterators > &b)