16 #ifndef dealii__trilinos_sparse_matrix_h 17 #define dealii__trilinos_sparse_matrix_h 20 #include <deal.II/base/config.h> 22 #ifdef DEAL_II_WITH_TRILINOS 24 # include <deal.II/base/std_cxx11/shared_ptr.h> 25 # include <deal.II/base/subscriptor.h> 26 # include <deal.II/base/index_set.h> 27 # include <deal.II/lac/full_matrix.h> 28 # include <deal.II/lac/exceptions.h> 29 # include <deal.II/lac/trilinos_vector.h> 30 # include <deal.II/lac/vector_view.h> 32 #ifdef DEAL_II_WITH_CXX11 33 #include <deal.II/lac/vector_memory.h> 34 #include <type_traits> 35 #endif // DEAL_II_WITH_CXX11 41 DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
42 # include <Epetra_FECrsMatrix.h> 43 # include <Epetra_Map.h> 44 # include <Epetra_CrsGraph.h> 45 # include <Epetra_MultiVector.h> 46 # include <Epetra_Operator.h> 47 # include <Epetra_Comm.h> 48 # ifdef DEAL_II_WITH_MPI 49 # include <Epetra_MpiComm.h> 52 # include <Epetra_SerialComm.h> 54 DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
58 DEAL_II_NAMESPACE_OPEN
92 std::size_t, std::size_t, std::size_t,
93 <<
"You tried to access row " << arg1
94 <<
" of a distributed sparsity pattern, " 95 <<
" but only rows " << arg2 <<
" through " << arg3
96 <<
" are stored locally and can be accessed.");
193 template <
bool Constess>
199 TrilinosScalar
value()
const;
204 TrilinosScalar &
value();
232 template <
bool Other>
238 TrilinosScalar
value()
const;
264 operator TrilinosScalar ()
const;
269 const Reference &operator = (
const TrilinosScalar n)
const;
274 const Reference &operator += (
const TrilinosScalar n)
const;
279 const Reference &operator -= (
const TrilinosScalar n)
const;
284 const Reference &operator *= (
const TrilinosScalar n)
const;
289 const Reference &operator /= (
const TrilinosScalar n)
const;
317 Reference
value()
const;
327 friend class Reference;
344 template <
bool Constness>
370 template <
bool Other>
409 bool operator < (const Iterator<Constness> &)
const;
421 <<
"Attempt to access element " << arg2
422 <<
" of row " << arg1
423 <<
" which doesn't have that many elements.");
431 template <
bool Other>
friend class Iterator;
555 const unsigned int n_max_entries_per_row);
566 const std::vector<unsigned int> &n_entries_per_row);
593 template<
typename SparsityPatternType>
594 void reinit (
const SparsityPatternType &sparsity_pattern);
640 template <
typename number>
641 void reinit (const ::SparseMatrix<number> &dealii_sparse_matrix,
642 const double drop_tolerance=1e-13,
643 const bool copy_values=
true,
644 const ::SparsityPattern *use_this_sparsity=0);
651 void reinit (
const Epetra_CrsMatrix &input_matrix,
652 const bool copy_values =
true);
673 const size_type n_max_entries_per_row = 0) DEAL_II_DEPRECATED;
685 const
std::vector<
unsigned int> &n_entries_per_row) DEAL_II_DEPRECATED;
705 SparseMatrix (const Epetra_Map &row_parallel_partitioning,
706 const Epetra_Map &col_parallel_partitioning,
707 const
size_type n_max_entries_per_row = 0) DEAL_II_DEPRECATED;
725 SparseMatrix (const Epetra_Map &row_parallel_partitioning,
726 const Epetra_Map &col_parallel_partitioning,
727 const
std::vector<
unsigned int> &n_entries_per_row) DEAL_II_DEPRECATED;
755 template<typename SparsityPatternType>
756 void reinit (const Epetra_Map ¶llel_partitioning,
757 const SparsityPatternType &sparsity_pattern,
758 const
bool exchange_data = false) DEAL_II_DEPRECATED;
774 template<typename SparsityPatternType>
775 void reinit (const Epetra_Map &row_parallel_partitioning,
776 const Epetra_Map &col_parallel_partitioning,
777 const SparsityPatternType &sparsity_pattern,
778 const
bool exchange_data = false) DEAL_II_DEPRECATED;
798 template <typename number>
799 void reinit (const Epetra_Map ¶llel_partitioning,
801 const
double drop_tolerance=1e-13,
802 const
bool copy_values=true,
820 template <typename number>
821 void reinit (const Epetra_Map &row_parallel_partitioning,
822 const Epetra_Map &col_parallel_partitioning,
824 const
double drop_tolerance=1e-13,
825 const
bool copy_values=true,
845 const MPI_Comm &communicator = MPI_COMM_WORLD,
846 const
unsigned int n_max_entries_per_row = 0);
856 const MPI_Comm &communicator,
857 const
std::vector<
unsigned int> &n_entries_per_row);
874 const
IndexSet &col_parallel_partitioning,
875 const MPI_Comm &communicator = MPI_COMM_WORLD,
876 const
size_type n_max_entries_per_row = 0);
893 const
IndexSet &col_parallel_partitioning,
894 const MPI_Comm &communicator,
895 const
std::vector<
unsigned int> &n_entries_per_row);
917 template<typename SparsityPatternType>
919 const SparsityPatternType &sparsity_pattern,
920 const MPI_Comm &communicator = MPI_COMM_WORLD,
921 const
bool exchange_data = false);
935 template<typename SparsityPatternType>
937 const
IndexSet &col_parallel_partitioning,
938 const SparsityPatternType &sparsity_pattern,
939 const MPI_Comm &communicator = MPI_COMM_WORLD,
940 const
bool exchange_data = false);
958 template <typename number>
961 const MPI_Comm &communicator = MPI_COMM_WORLD,
962 const
double drop_tolerance=1e-13,
963 const
bool copy_values=true,
979 template <typename number>
981 const
IndexSet &col_parallel_partitioning,
983 const MPI_Comm &communicator = MPI_COMM_WORLD,
984 const
double drop_tolerance=1e-13,
985 const
bool copy_values=true,
1077 operator = (const
double d);
1140 const TrilinosScalar value);
1175 const
FullMatrix<TrilinosScalar> &full_matrix,
1176 const
bool elide_zero_values = false);
1185 const
FullMatrix<TrilinosScalar> &full_matrix,
1186 const
bool elide_zero_values = false);
1217 const
std::vector<TrilinosScalar> &values,
1218 const
bool elide_zero_values = false);
1250 const TrilinosScalar *values,
1251 const
bool elide_zero_values = false);
1264 const TrilinosScalar value);
1285 const
FullMatrix<TrilinosScalar> &full_matrix,
1286 const
bool elide_zero_values = true);
1295 const
FullMatrix<TrilinosScalar> &full_matrix,
1296 const
bool elide_zero_values = true);
1313 const
std::vector<TrilinosScalar> &values,
1314 const
bool elide_zero_values = true);
1332 const TrilinosScalar *values,
1333 const
bool elide_zero_values = true,
1334 const
bool col_indices_are_sorted = false);
1339 SparseMatrix &operator *= (const TrilinosScalar factor);
1344 SparseMatrix &operator /= (const TrilinosScalar factor);
1358 void add (const TrilinosScalar factor,
1388 const TrilinosScalar new_diag_value = 0);
1411 const TrilinosScalar new_diag_value = 0);
1438 TrilinosScalar operator () (const
size_type i,
1495 template<typename VectorType>
1496 void vmult (VectorType &dst,
1497 const VectorType &src) const;
1521 template <typename VectorType>
1522 void Tvmult (VectorType &dst,
1523 const VectorType &src) const;
1548 template<typename VectorType>
1550 const VectorType &src) const;
1575 template <typename VectorType>
1577 const VectorType &src) const;
1699 TrilinosScalar
l1_norm () const;
1908 const
bool write_extended_trilinos_info = false) const;
1921 << "An error with error number " << arg1
1922 << " occurred while calling a Trilinos function");
1929 << "The entry with index <" << arg1 << ',' << arg2
1930 << "> does not exist.");
1947 << "You tried to access element (" << arg1
1948 << "/" << arg2 << ")"
1949 << " of a distributed
matrix, but only rows "
1950 << arg3 << " through " << arg4
1951 << " are stored locally and can be accessed.");
1958 << "You tried to access element (" << arg1
1959 << "/" << arg2 << ")"
1960 << " of a sparse
matrix, but it appears to not"
1961 << " exist in the Trilinos sparsity pattern.");
2050 #ifdef DEAL_II_WITH_CXX11 2061 void check_vector_map_equality(
const Epetra_CrsMatrix &mtrx,
2062 const Epetra_MultiVector &src,
2063 const Epetra_MultiVector &dst,
2068 Assert (src.Map().SameAs(mtrx.DomainMap()) ==
true,
2069 ExcMessage (
"Column map of matrix does not fit with vector map!"));
2070 Assert (dst.Map().SameAs(mtrx.RangeMap()) ==
true,
2071 ExcMessage (
"Row map of matrix does not fit with vector map!"));
2075 Assert (src.Map().SameAs(mtrx.RangeMap()) ==
true,
2076 ExcMessage (
"Column map of matrix does not fit with vector map!"));
2077 Assert (dst.Map().SameAs(mtrx.DomainMap()) ==
true,
2078 ExcMessage (
"Row map of matrix does not fit with vector map!"));
2086 void check_vector_map_equality(
const Epetra_Operator &op,
2087 const Epetra_MultiVector &src,
2088 const Epetra_MultiVector &dst,
2093 Assert (src.Map().SameAs(op.OperatorDomainMap()) ==
true,
2094 ExcMessage (
"Column map of operator does not fit with vector map!"));
2095 Assert (dst.Map().SameAs(op.OperatorRangeMap()) ==
true,
2096 ExcMessage (
"Row map of operator does not fit with vector map!"));
2100 Assert (src.Map().SameAs(op.OperatorRangeMap()) ==
true,
2101 ExcMessage (
"Column map of operator does not fit with vector map!"));
2102 Assert (dst.Map().SameAs(op.OperatorDomainMap()) ==
true,
2103 ExcMessage (
"Row map of operator does not fit with vector map!"));
2134 :
public Epetra_Operator
2236 template <
typename Solver,
typename Preconditioner>
2237 typename std::enable_if<
2238 std::is_base_of<TrilinosWrappers::SolverBase,Solver>::value &&
2239 std::is_base_of<TrilinosWrappers::PreconditionBase,Preconditioner>::value,
2241 inverse_payload (
Solver &,
const Preconditioner &)
const;
2259 template <
typename Solver,
typename Preconditioner>
2260 typename std::enable_if<
2261 !(std::is_base_of<TrilinosWrappers::SolverBase,Solver>::value &&
2262 std::is_base_of<TrilinosWrappers::PreconditionBase,Preconditioner>::value),
2264 inverse_payload (
Solver &,
const Preconditioner &)
const;
2311 std::function<void(VectorType &, const VectorType &)>
vmult;
2320 std::function<void(VectorType &, const VectorType &)>
Tvmult;
2329 std::function<void(VectorType &, const VectorType &)>
inv_vmult;
2338 std::function<void(VectorType &, const VectorType &)>
inv_Tvmult;
2354 UseTranspose ()
const;
2372 SetUseTranspose (
bool UseTranspose);
2422 virtual const char *
2432 virtual const Epetra_Comm &
2442 virtual const Epetra_Map &
2443 OperatorDomainMap ()
const;
2453 virtual const Epetra_Map &
2454 OperatorRangeMap ()
const;
2469 #ifdef DEAL_II_WITH_MPI 2472 Epetra_SerialComm communicator;
2496 HasNormInf ()
const;
2526 #endif // DEAL_II_WITH_CXX11 2542 visit_present_row ();
2547 AccessorBase::size_type
2548 AccessorBase::row()
const 2556 AccessorBase::size_type
2557 AccessorBase::column()
const 2560 return (*colnum_cache)[a_index];
2565 AccessorBase::size_type
2566 AccessorBase::index()
const 2574 Accessor<true>::Accessor (MatrixType *matrix,
2575 const size_type row,
2576 const size_type index)
2578 AccessorBase(const_cast<
SparseMatrix *>(matrix), row, index)
2582 template <
bool Other>
2584 Accessor<true>::Accessor(
const Accessor<Other> &other)
2592 Accessor<true>::value()
const 2595 return (*value_cache)[a_index];
2600 Accessor<false>::Reference::Reference (
2601 const Accessor<false> &acc)
2603 accessor(const_cast<Accessor<false>&>(acc))
2608 Accessor<false>::Reference::operator TrilinosScalar ()
const 2610 return (*accessor.value_cache)[accessor.a_index];
2614 const Accessor<false>::Reference &
2615 Accessor<false>::Reference::operator = (
const TrilinosScalar n)
const 2617 (*accessor.value_cache)[accessor.a_index] = n;
2618 accessor.matrix->set(accessor.row(), accessor.column(),
2619 static_cast<TrilinosScalar
>(*this));
2625 const Accessor<false>::Reference &
2626 Accessor<false>::Reference::operator += (
const TrilinosScalar n)
const 2628 (*accessor.value_cache)[accessor.a_index] += n;
2629 accessor.matrix->set(accessor.row(), accessor.column(),
2630 static_cast<TrilinosScalar
>(*this));
2636 const Accessor<false>::Reference &
2637 Accessor<false>::Reference::operator -= (
const TrilinosScalar n)
const 2639 (*accessor.value_cache)[accessor.a_index] -= n;
2640 accessor.matrix->set(accessor.row(), accessor.column(),
2641 static_cast<TrilinosScalar
>(*this));
2647 const Accessor<false>::Reference &
2648 Accessor<false>::Reference::operator *= (
const TrilinosScalar n)
const 2650 (*accessor.value_cache)[accessor.a_index] *= n;
2651 accessor.matrix->set(accessor.row(), accessor.column(),
2652 static_cast<TrilinosScalar
>(*this));
2658 const Accessor<false>::Reference &
2659 Accessor<false>::Reference::operator /= (
const TrilinosScalar n)
const 2661 (*accessor.value_cache)[accessor.a_index] /= n;
2662 accessor.matrix->set(accessor.row(), accessor.column(),
2663 static_cast<TrilinosScalar
>(*this));
2669 Accessor<false>::Accessor (MatrixType *matrix,
2670 const size_type row,
2671 const size_type index)
2673 AccessorBase(matrix, row, index)
2678 Accessor<false>::Reference
2679 Accessor<false>::value()
const 2682 return Reference(*
this);
2687 template <
bool Constness>
2689 Iterator<Constness>::Iterator(MatrixType *matrix,
2690 const size_type row,
2691 const size_type index)
2693 accessor(matrix, row, index)
2697 template <
bool Constness>
2698 template <
bool Other>
2700 Iterator<Constness>::Iterator(
const Iterator<Other> &other)
2702 accessor(other.accessor)
2706 template <
bool Constness>
2708 Iterator<Constness> &
2709 Iterator<Constness>::operator++ ()
2719 if (accessor.a_index >= accessor.colnum_cache->size())
2721 accessor.a_index = 0;
2724 while ((accessor.a_row < accessor.matrix->m())
2726 ((accessor.matrix->in_local_range (accessor.a_row) ==
false)
2728 (accessor.matrix->row_length(accessor.a_row) == 0)))
2731 accessor.visit_present_row();
2737 template <
bool Constness>
2740 Iterator<Constness>::operator++ (
int)
2742 const Iterator<Constness> old_state = *
this;
2749 template <
bool Constness>
2751 const Accessor<Constness> &
2752 Iterator<Constness>::operator* ()
const 2759 template <
bool Constness>
2761 const Accessor<Constness> *
2762 Iterator<Constness>::operator-> ()
const 2769 template <
bool Constness>
2772 Iterator<Constness>::operator == (
const Iterator<Constness> &other)
const 2774 return (accessor.a_row == other.accessor.a_row &&
2775 accessor.a_index == other.accessor.a_index);
2780 template <
bool Constness>
2783 Iterator<Constness>::operator != (
const Iterator<Constness> &other)
const 2785 return ! (*
this == other);
2790 template <
bool Constness>
2793 Iterator<Constness>::operator < (
const Iterator<Constness> &other)
const 2795 return (accessor.row() < other.accessor.row() ||
2796 (accessor.row() == other.accessor.row() &&
2797 accessor.index() < other.accessor.index()));
2801 template <
bool Constness>
2804 Iterator<Constness>::operator > (
const Iterator<Constness> &other)
const 2806 return (other < *
this);
2826 return const_iterator(
this, m(), 0);
2836 if (in_local_range (r)
2838 (row_length(r) > 0))
2839 return const_iterator(
this, r, 0);
2855 for (size_type i=r+1; i<m(); ++i)
2856 if (in_local_range (i)
2858 (row_length(i) > 0))
2859 return const_iterator(
this, i, 0);
2881 return iterator(
this, m(), 0);
2891 if (in_local_range (r)
2893 (row_length(r) > 0))
2894 return iterator(
this, r, 0);
2910 for (size_type i=r+1; i<m(); ++i)
2911 if (in_local_range (i)
2913 (row_length(i) > 0))
2914 return iterator(
this, i, 0);
2927 TrilinosWrappers::types::int_type begin, end;
2928 #ifndef DEAL_II_WITH_64BIT_INDICES 2929 begin = matrix->RowMap().MinMyGID();
2930 end = matrix->RowMap().MaxMyGID()+1;
2932 begin = matrix->RowMap().MinMyGID64();
2933 end = matrix->RowMap().MaxMyGID64()+1;
2936 return ((index >= static_cast<size_type>(begin)) &&
2937 (index < static_cast<size_type>(end)));
2958 const TrilinosScalar value)
2963 set (i, 1, &j, &value,
false);
2972 const bool elide_zero_values)
2974 Assert (indices.size() == values.
m(),
2978 for (size_type i=0; i<indices.size(); ++i)
2979 set (indices[i], indices.size(), &indices[0], &values(i,0),
2989 const TrilinosScalar value)
3002 if (last_action == Insert)
3005 ierr = matrix->GlobalAssemble(*column_space_map,
3006 matrix->RowMap(),
false);
3017 add (i, 1, &j, &value,
false);
3028 #ifndef DEAL_II_WITH_64BIT_INDICES 3029 return matrix->NumGlobalRows();
3031 return matrix->NumGlobalRows64();
3045 #ifndef DEAL_II_WITH_64BIT_INDICES 3046 return column_space_map->NumGlobalElements();
3048 return column_space_map->NumGlobalElements64();
3058 return matrix -> NumMyRows();
3064 std::pair<SparseMatrix::size_type, SparseMatrix::size_type>
3068 #ifndef DEAL_II_WITH_64BIT_INDICES 3069 begin = matrix->RowMap().MinMyGID();
3070 end = matrix->RowMap().MaxMyGID()+1;
3072 begin = matrix->RowMap().MinMyGID64();
3073 end = matrix->RowMap().MaxMyGID64()+1;
3076 return std::make_pair (begin, end);
3085 #ifndef DEAL_II_WITH_64BIT_INDICES 3086 return matrix->NumGlobalNonzeros();
3088 return matrix->NumGlobalNonzeros64();
3094 template <
typename SparsityPatternType>
3097 const SparsityPatternType &sparsity_pattern,
3098 const MPI_Comm &communicator,
3099 const bool exchange_data)
3101 reinit (parallel_partitioning, parallel_partitioning,
3102 sparsity_pattern, communicator, exchange_data);
3107 template <
typename number>
3110 const ::SparseMatrix<number> &sparse_matrix,
3111 const MPI_Comm &communicator,
3112 const double drop_tolerance,
3113 const bool copy_values,
3114 const ::SparsityPattern *use_this_sparsity)
3117 reinit (parallel_partitioning, parallel_partitioning, sparse_matrix,
3118 drop_tolerance, copy_values, use_this_sparsity);
3124 const Epetra_CrsMatrix &
3127 return static_cast<const Epetra_CrsMatrix &
>(*matrix);
3133 const Epetra_CrsGraph &
3136 return matrix->Graph();
3145 return IndexSet(matrix->DomainMap());
3154 return IndexSet(matrix->RangeMap());
3176 #ifdef DEAL_II_WITH_CXX11 3181 template <
typename Solver,
typename Preconditioner>
3182 typename std::enable_if<
3183 std::is_base_of<TrilinosWrappers::SolverBase,Solver>::value &&
3184 std::is_base_of<TrilinosWrappers::PreconditionBase,Preconditioner>::value,
3185 TrilinosPayload>::type
3186 TrilinosPayload::inverse_payload (
3188 const Preconditioner &preconditioner)
const 3190 const auto &payload = *
this;
3192 TrilinosPayload return_op(payload);
3196 return_op.inv_vmult = [payload,&solver,&preconditioner](
3197 TrilinosPayload::Domain &tril_dst,
const TrilinosPayload::Range &tril_src
3203 internal::check_vector_map_equality(payload,
3205 !payload.UseTranspose());
3206 solver.solve(payload, tril_dst, tril_src, preconditioner);
3209 return_op.inv_Tvmult = [payload,&solver,&preconditioner](
3210 TrilinosPayload::Range &tril_dst,
const TrilinosPayload::Domain &tril_src
3216 internal::check_vector_map_equality(payload,
3218 payload.UseTranspose());
3220 const_cast<TrilinosPayload &
>(payload).transpose();
3221 solver.solve(payload, tril_dst, tril_src, preconditioner);
3222 const_cast<TrilinosPayload &
>(payload).transpose();
3227 if (return_op.UseTranspose() ==
true)
3228 std::swap(return_op.inv_vmult,
3229 return_op.inv_Tvmult);
3234 template <
typename Solver,
typename Preconditioner>
3235 typename std::enable_if<
3236 !(std::is_base_of<TrilinosWrappers::SolverBase,Solver>::value &&
3237 std::is_base_of<TrilinosWrappers::PreconditionBase,Preconditioner>::value),
3238 TrilinosPayload>::type
3239 TrilinosPayload::inverse_payload (
3241 const Preconditioner &)
const 3243 TrilinosPayload return_op(*
this);
3245 return_op.inv_vmult = [](TrilinosPayload::Domain &,
3246 const TrilinosPayload::Range &)
3249 ExcMessage(
"Payload inv_vmult disabled because of " 3250 "incompatible solver/preconditioner choice."));
3253 return_op.inv_Tvmult = [](TrilinosPayload::Range &,
3254 const TrilinosPayload::Domain &)
3257 ExcMessage(
"Payload inv_vmult disabled because of " 3258 "incompatible solver/preconditioner choice."));
3265 #endif // DEAL_II_WITH_CXX11 3272 DEAL_II_NAMESPACE_CLOSE
3275 #endif // DEAL_II_WITH_TRILINOS std_cxx11::shared_ptr< std::vector< TrilinosScalar > > value_cache
static const bool zero_addition_can_be_elided
TrilinosScalar diag_element(const size_type i) const
static ::ExceptionBase & ExcTrilinosError(int arg1)
TrilinosScalar el(const size_type i, const size_type j) const
types::global_dof_index size_type
const_iterator end() const
bool operator>(const Iterator< Constness > &) const
TrilinosScalar frobenius_norm() const
std_cxx11::shared_ptr< std::vector< size_type > > colnum_cache
#define DeclException2(Exception2, type1, type2, outsequence)
SparseMatrixIterators::Iterator< false > iterator
::types::global_dof_index size_type
static ::ExceptionBase & ExcSourceEqualsDestination()
static ::ExceptionBase & ExcBeyondEndOfMatrix()
bool operator==(const Iterator< Constness > &) const
void clear_row(const size_type row, const TrilinosScalar new_diag_value=0)
void vmult_add(VectorType &dst, const VectorType &src) const
Epetra_CombineMode last_action
bool is_compressed() const
::types::global_dof_index size_type
TrilinosScalar residual(VectorBase &dst, const VectorBase &x, const VectorBase &b) const
static ::ExceptionBase & ExcInvalidIndex(size_type arg1, size_type arg2)
static ::ExceptionBase & ExcAccessToNonlocalRow(std::size_t arg1, std::size_t arg2, std::size_t arg3)
#define AssertThrow(cond, exc)
static ::ExceptionBase & ExcAccessToNonPresentElement(size_type arg1, size_type arg2)
static ::ExceptionBase & ExcIndexRange(int arg1, int arg2, int arg3)
static ::ExceptionBase & ExcTrilinosError(int arg1)
const Epetra_Map & col_partitioner() const 1
Epetra_MultiVector VectorType
void clear_rows(const std::vector< size_type > &rows, const TrilinosScalar new_diag_value=0)
void Tvmult(VectorType &dst, const VectorType &src) const
std_cxx11::shared_ptr< Epetra_FECrsMatrix > matrix
Epetra_Map make_trilinos_map(const MPI_Comm &communicator=MPI_COMM_WORLD, const bool overlapping=false) const
bool in_local_range(const size_type index) const
static ::ExceptionBase & ExcMessage(std::string arg1)
const Accessor< Constness > & operator*() const
std_cxx11::shared_ptr< Epetra_CrsMatrix > nonlocal_matrix
#define DeclException1(Exception1, type1, outsequence)
void add(const size_type i, const size_type j, const TrilinosScalar value)
std::function< void(VectorType &, const VectorType &)> Tvmult
#define Assert(cond, exc)
std_cxx11::shared_ptr< Epetra_Map > column_space_map
static ::ExceptionBase & ExcDimensionMismatch(std::size_t arg1, std::size_t arg2)
void Tmmult(SparseMatrix &C, const SparseMatrix &B, const VectorBase &V=VectorBase()) const
size_type memory_consumption() const
void print(std::ostream &out, const bool write_extended_trilinos_info=false) const
bool operator!=(const Iterator< Constness > &) const
#define DeclException0(Exception0)
void mmult(SparseMatrix &C, const SparseMatrix &B, const VectorBase &V=VectorBase()) const
const Accessor< Constness > * operator->() const
const Epetra_CrsMatrix & trilinos_matrix() const
AccessorBase(SparseMatrix *matrix, const size_type row, const size_type index)
static ::ExceptionBase & ExcInvalidIndexWithinRow(size_type arg1, size_type arg2)
const Epetra_Map & range_partitioner() const 1
void vmult(VectorType &dst, const VectorType &src) const
const SparseMatrix MatrixType
IndexSet locally_owned_range_indices() const
std::function< void(VectorType &, const VectorType &)> inv_vmult
size_type n_nonzero_elements() const
MPI_Comm get_mpi_communicator() const
static ::ExceptionBase & ExcIteratorPastEnd()
const_iterator begin() const
static ::ExceptionBase & ExcNotQuadratic()
unsigned int row_length(const size_type row) const
Accessor< Constness > accessor
void Tvmult_add(VectorType &dst, const VectorType &src) const
const Epetra_Map & domain_partitioner() const 1
SparseMatrixIterators::Iterator< true > const_iterator
types::global_dof_index size_type
void reinit(const SparsityPatternType &sparsity_pattern)
TrilinosScalar matrix_norm_square(const VectorBase &v) const
TrilinosScalar linfty_norm() const
Iterator< Constness > & operator++()
std::function< void(VectorType &, const VectorType &)> vmult
void copy_from(const SparseMatrix &source)
::types::global_dof_index size_type
#define DeclException4(Exception4, type1, type2, type3, type4, outsequence)
Accessor< Constness >::MatrixType MatrixType
std::pair< size_type, size_type > local_range() const
TrilinosScalar matrix_scalar_product(const VectorBase &u, const VectorBase &v) const
static ::ExceptionBase & ExcMatrixNotCompressed()
IndexSet locally_owned_domain_indices() const
const Epetra_CrsGraph & trilinos_sparsity_pattern() const
#define DeclException3(Exception3, type1, type2, type3, outsequence)
TrilinosScalar value() const
void compress(::VectorOperation::values operation)
static ::ExceptionBase & ExcAccessToNonLocalElement(size_type arg1, size_type arg2, size_type arg3, size_type arg4)
TrilinosScalar value_type
void set(const size_type i, const size_type j, const TrilinosScalar value)
#define AssertIsFinite(number)
unsigned int local_size() const
TrilinosScalar l1_norm() const
std::function< void(VectorType &, const VectorType &)> inv_Tvmult
static ::ExceptionBase & ExcInternalError()
const Epetra_Map & row_partitioner() const 1
Epetra_MpiComm communicator
std_cxx11::shared_ptr< Epetra_Export > nonlocal_matrix_exporter