From: Sebastian Kinnewig Date: Tue, 9 Jan 2024 18:45:35 +0000 (+0100) Subject: Exchange NodeType with MemorySpace X-Git-Tag: relicensing~186^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b2b5f0764067955bfd08c70906caed144fce3ed;p=dealii.git Exchange NodeType with MemorySpace --- diff --git a/include/deal.II/base/template_constraints.h b/include/deal.II/base/template_constraints.h index ba3f8fb1e8..8f5374df5b 100644 --- a/include/deal.II/base/template_constraints.h +++ b/include/deal.II/base/template_constraints.h @@ -671,7 +671,7 @@ namespace LinearAlgebra template class Vector; - template + template class SparseMatrix; } // namespace TpetraWrappers # endif diff --git a/include/deal.II/lac/trilinos_tpetra_sparse_matrix.h b/include/deal.II/lac/trilinos_tpetra_sparse_matrix.h index ce4acdc172..6af4632bbf 100644 --- a/include/deal.II/lac/trilinos_tpetra_sparse_matrix.h +++ b/include/deal.II/lac/trilinos_tpetra_sparse_matrix.h @@ -40,7 +40,7 @@ namespace LinearAlgebra { namespace TpetraWrappers { - template + template class SparsityPattern; } // namespace TpetraWrappers } // namespace LinearAlgebra @@ -89,9 +89,7 @@ namespace LinearAlgebra * SparseMatrix::resume_fill() first. Once you finish modifying * the matrix, you must call SparseMatrix::compress() again. */ - template + template class SparseMatrix : public Subscriptor { public: @@ -106,22 +104,33 @@ namespace LinearAlgebra */ using value_type = Number; + /** + * Typedef for the NodeType + */ + using NodeType = Tpetra::KokkosCompat::KokkosDeviceWrapperNode< + typename MemorySpace::kokkos_space::execution_space, + typename MemorySpace::kokkos_space>; + /** * Typedef for Tpetra::CrsMatrix */ using MatrixType = - Tpetra::CrsMatrix; + Tpetra::CrsMatrix; /** * Typedef for Tpetra::Map */ - using MapType = Tpetra::Map; + using MapType = + Tpetra::Map; /** * Typedef for Tpetra::CrsGraph */ using GraphType = - Tpetra::CrsGraph; + Tpetra::CrsGraph; /** * @name Constructors and initialization. @@ -135,30 +144,30 @@ namespace LinearAlgebra /** * Generate a matrix from a TpetraWrappers::SparsityPattern object. */ - SparseMatrix(const SparsityPattern &sparsity_pattern); + SparseMatrix(const SparsityPattern &sparsity_pattern); /** * Move constructor. Create a new sparse matrix by stealing the internal * data of the `other` object. */ - SparseMatrix(SparseMatrix &&other) noexcept; + SparseMatrix(SparseMatrix &&other) noexcept; /** * Copy constructor is deleted. */ - SparseMatrix(const SparseMatrix &) = delete; + SparseMatrix(const SparseMatrix &) = delete; /** * operator= is deleted. */ - SparseMatrix & - operator=(const SparseMatrix &) = delete; + SparseMatrix & + operator=(const SparseMatrix &) = delete; /** * Move assignment operator. */ - SparseMatrix & - operator=(SparseMatrix &&other) noexcept; + SparseMatrix & + operator=(SparseMatrix &&other) noexcept; /** * Destructor. Made virtual so that one can use pointers to objects of @@ -195,7 +204,7 @@ namespace LinearAlgebra * processors in order to avoid a dead lock. */ void - reinit(const SparsityPattern &sparsity_pattern); + reinit(const SparsityPattern &sparsity_pattern); /** @} */ /** @@ -401,9 +410,9 @@ namespace LinearAlgebra /** * Add @p value to the element (i,j). - * Just as the respective call in deal.II SparseMatrix - * class. Moreover, if value is not a finite number an exception - * is thrown. + * Just as the respective call in deal.II SparseMatrix class. Moreover, if value is not a finite number + * an exception is thrown. * * @note When add is called on a compressed matrix, the matrix is set * back to an uncompressed state. @@ -414,12 +423,12 @@ namespace LinearAlgebra /** * Add an array of values given by values in the given global * matrix row at columns specified by col_indices in the sparse matrix. - * Just as the respective call in deal.II SparseMatrix - * class. The optional parameter elide_zero_values can be used to - * specify whether zero values should be added anyway or these should be - * filtered away and only non-zero data is added. - * The default value is true, i.e., zero values won't be added - * into the matrix. + * Just as the respective call in deal.II SparseMatrix class. The optional parameter elide_zero_values + * can be used to specify whether zero values should be added anyway or + * these should be filtered away and only non-zero data is added. The + * default value is true, i.e., zero values won't be added into + * the matrix. * * @note When add is called on a compressed matrix, the matrix is set * back to an uncompressed state. @@ -653,29 +662,29 @@ namespace LinearAlgebra /* ------------------------- Inline functions ---------------------- */ - template + template inline void - SparseMatrix::add(const size_type i, - const size_type j, - const TrilinosScalar value) + SparseMatrix::add(const size_type i, + const size_type j, + const TrilinosScalar value) { add(i, 1, &j, &value, false); } - template + template inline dealii::types::signed_global_dof_index - SparseMatrix::m() const + SparseMatrix::m() const { return matrix->getRowMap()->getGlobalNumElements(); } - template + template inline dealii::types::signed_global_dof_index - SparseMatrix::n() const + SparseMatrix::n() const { // If the matrix structure has not been fixed (i.e., we did not have a // sparsity pattern), it does not know about the number of columns, so we @@ -686,48 +695,61 @@ namespace LinearAlgebra - template + template inline bool - SparseMatrix::is_compressed() const + SparseMatrix::is_compressed() const { return compressed; } - template - inline const Tpetra:: - CrsMatrix & - SparseMatrix::trilinos_matrix() const + template + inline const Tpetra::CrsMatrix< + Number, + int, + types::signed_global_dof_index, + typename SparseMatrix::NodeType> & + SparseMatrix::trilinos_matrix() const { return *matrix; } - template - inline Tpetra::CrsMatrix & - SparseMatrix::trilinos_matrix() + template + inline Tpetra::CrsMatrix< + Number, + int, + types::signed_global_dof_index, + typename SparseMatrix::NodeType> & + SparseMatrix::trilinos_matrix() { return *matrix; } - template - inline Teuchos::RCP< - const Tpetra::CrsMatrix> - SparseMatrix::trilinos_rcp() const + template + inline Teuchos::RCP::NodeType>> + SparseMatrix::trilinos_rcp() const { return matrix.getConst(); } - template + template inline Teuchos::RCP< - Tpetra::CrsMatrix> - SparseMatrix::trilinos_rcp() + Tpetra::CrsMatrix::NodeType>> + SparseMatrix::trilinos_rcp() { return matrix; } diff --git a/include/deal.II/lac/trilinos_tpetra_sparse_matrix.templates.h b/include/deal.II/lac/trilinos_tpetra_sparse_matrix.templates.h index ddbde983fc..e3f709d5b1 100644 --- a/include/deal.II/lac/trilinos_tpetra_sparse_matrix.templates.h +++ b/include/deal.II/lac/trilinos_tpetra_sparse_matrix.templates.h @@ -184,8 +184,8 @@ namespace LinearAlgebra // Actually, it does not even matter how many threads there are, but // only if we use an MPI compiler or a standard compiler. So, even one // thread on a configuration with MPI will still get a parallel interface. - template - SparseMatrix::SparseMatrix() + template + SparseMatrix::SparseMatrix() : column_space_map(Utilities::Trilinos::internal::make_rcp( 0, 0, @@ -206,9 +206,9 @@ namespace LinearAlgebra - template - SparseMatrix::SparseMatrix( - const SparsityPattern &sparsity_pattern) + template + SparseMatrix::SparseMatrix( + const SparsityPattern &sparsity_pattern) : matrix(Utilities::Trilinos::internal::make_rcp( sparsity_pattern.trilinos_sparsity_pattern())) { @@ -220,9 +220,9 @@ namespace LinearAlgebra - template - SparseMatrix::SparseMatrix( - SparseMatrix &&other) noexcept + template + SparseMatrix::SparseMatrix( + SparseMatrix &&other) noexcept : column_space_map(std::move(other.column_space_map)) , matrix(std::move(other.matrix)) , compressed(std::move(other.compressed)) @@ -232,10 +232,10 @@ namespace LinearAlgebra - template - SparseMatrix & - SparseMatrix::operator=( - SparseMatrix &&other) noexcept + template + SparseMatrix & + SparseMatrix::operator=( + SparseMatrix &&other) noexcept { column_space_map = std::move(other.column_space_map); matrix = std::move(other.matrix); @@ -246,10 +246,10 @@ namespace LinearAlgebra - template + template template void - SparseMatrix::reinit( + SparseMatrix::reinit( const SparsityPatternType &sparsity_pattern) { reinit_matrix( @@ -267,10 +267,10 @@ namespace LinearAlgebra - template + template void - SparseMatrix::reinit( - const SparsityPattern &sparsity_pattern) + SparseMatrix::reinit( + const SparsityPattern &sparsity_pattern) { column_space_map.reset(); matrix.reset(); @@ -289,8 +289,8 @@ namespace LinearAlgebra // Constructors and initialization using an IndexSet description: - template - SparseMatrix::SparseMatrix( + template + SparseMatrix::SparseMatrix( const IndexSet ¶llel_partitioning, const MPI_Comm communicator, const unsigned int n_max_entries_per_row) @@ -304,8 +304,8 @@ namespace LinearAlgebra - template - SparseMatrix::SparseMatrix( + template + SparseMatrix::SparseMatrix( const IndexSet ¶llel_partitioning, const MPI_Comm communicator, const std::vector &n_entries_per_row) @@ -321,8 +321,8 @@ namespace LinearAlgebra - template - SparseMatrix::SparseMatrix( + template + SparseMatrix::SparseMatrix( const IndexSet &row_parallel_partitioning, const IndexSet &col_parallel_partitioning, const MPI_Comm communicator, @@ -337,8 +337,8 @@ namespace LinearAlgebra - template - SparseMatrix::SparseMatrix( + template + SparseMatrix::SparseMatrix( const IndexSet &row_parallel_partitioning, const IndexSet &col_parallel_partitioning, const MPI_Comm communicator, @@ -356,10 +356,10 @@ namespace LinearAlgebra - template + template template inline void - SparseMatrix::reinit( + SparseMatrix::reinit( const IndexSet ¶llel_partitioning, const SparsityPatternType &sparsity_pattern, const MPI_Comm communicator, @@ -374,10 +374,10 @@ namespace LinearAlgebra - template + template template void - SparseMatrix::reinit( + SparseMatrix::reinit( const IndexSet &row_parallel_partitioning, const IndexSet &col_parallel_partitioning, @@ -402,19 +402,19 @@ namespace LinearAlgebra // Information on the matrix - template + template inline unsigned int - SparseMatrix::local_size() const + SparseMatrix::local_size() const { return matrix->getLocalNumRows(); } - template - inline std::pair::size_type, - typename SparseMatrix::size_type> - SparseMatrix::local_range() const + template + inline std::pair::size_type, + typename SparseMatrix::size_type> + SparseMatrix::local_range() const { size_type begin, end; begin = matrix->getRowMap()->getMinLocalIndex(); @@ -425,18 +425,18 @@ namespace LinearAlgebra - template + template inline size_t - SparseMatrix::n_nonzero_elements() const + SparseMatrix::n_nonzero_elements() const { return matrix->getGlobalNumEntries(); } - template + template MPI_Comm - SparseMatrix::get_mpi_communicator() const + SparseMatrix::get_mpi_communicator() const { return Utilities::Trilinos::teuchos_comm_to_mpi_comm(matrix->getComm()); } @@ -445,9 +445,9 @@ namespace LinearAlgebra // Modifying entries - template - SparseMatrix & - SparseMatrix::operator=(const double d) + template + SparseMatrix & + SparseMatrix::operator=(const double d) { (void)d; Assert(d == 0, ExcScalarAssignmentOnlyForZeroValue()); @@ -469,9 +469,9 @@ namespace LinearAlgebra - template - SparseMatrix & - SparseMatrix::operator*=(const Number a) + template + SparseMatrix & + SparseMatrix::operator*=(const Number a) { matrix->scale(a); return *this; @@ -479,9 +479,9 @@ namespace LinearAlgebra - template - SparseMatrix & - SparseMatrix::operator/=(const Number a) + template + SparseMatrix & + SparseMatrix::operator/=(const Number a) { Assert(a != 0, ExcDivideByZero()); @@ -492,14 +492,15 @@ namespace LinearAlgebra - template + template void - SparseMatrix::add(const size_type row, - const size_type n_cols, - const size_type *col_indices, - const TrilinosScalar *values, - const bool elide_zero_values, - const bool /*col_indices_are_sorted*/) + SparseMatrix::add( + const size_type row, + const size_type n_cols, + const size_type *col_indices, + const TrilinosScalar *values, + const bool elide_zero_values, + const bool /*col_indices_are_sorted*/) { AssertIndexRange(row, this->m()); @@ -558,10 +559,10 @@ namespace LinearAlgebra // Multiplications - template + template void - SparseMatrix::vmult(Vector &dst, - const Vector &src) const + SparseMatrix::vmult(Vector &dst, + const Vector &src) const { Assert(&src != &dst, ExcSourceEqualsDestination()); Assert(matrix->isFillComplete(), ExcMatrixNotCompressed()); @@ -574,10 +575,10 @@ namespace LinearAlgebra - template + template void - SparseMatrix::Tvmult(Vector &dst, - const Vector &src) const + SparseMatrix::Tvmult(Vector &dst, + const Vector &src) const { Assert(&src != &dst, ExcSourceEqualsDestination()); Assert(matrix->isFillComplete(), ExcMatrixNotCompressed()); @@ -590,10 +591,11 @@ namespace LinearAlgebra - template + template void - SparseMatrix::vmult_add(Vector &dst, - const Vector &src) const + SparseMatrix::vmult_add( + Vector &dst, + const Vector &src) const { Assert(&src != &dst, ExcSourceEqualsDestination()); Assert(matrix->isFillComplete(), ExcMatrixNotCompressed()); @@ -610,10 +612,11 @@ namespace LinearAlgebra - template + template void - SparseMatrix::Tvmult_add(Vector &dst, - const Vector &src) const + SparseMatrix::Tvmult_add( + Vector &dst, + const Vector &src) const { Assert(&src != &dst, ExcSourceEqualsDestination()); Assert(matrix->isFillComplete(), ExcMatrixNotCompressed()); @@ -629,9 +632,9 @@ namespace LinearAlgebra } - template + template void - SparseMatrix::print( + SparseMatrix::print( std::ostream &out, const bool print_detailed_trilinos_information) const { @@ -661,9 +664,9 @@ namespace LinearAlgebra - template + template void - SparseMatrix::compress( + SparseMatrix::compress( [[maybe_unused]] VectorOperation::values operation) { if (!compressed) @@ -673,9 +676,9 @@ namespace LinearAlgebra } } - template + template void - SparseMatrix::resume_fill() + SparseMatrix::resume_fill() { if (compressed) { diff --git a/include/deal.II/lac/trilinos_tpetra_sparsity_pattern.h b/include/deal.II/lac/trilinos_tpetra_sparsity_pattern.h index de710eb24f..9271f41ae2 100644 --- a/include/deal.II/lac/trilinos_tpetra_sparsity_pattern.h +++ b/include/deal.II/lac/trilinos_tpetra_sparsity_pattern.h @@ -45,15 +45,15 @@ namespace LinearAlgebra { namespace TpetraWrappers { - template + template class SparsityPattern; - template + template class SparseMatrix; namespace SparsityPatternIterators { - template + template class Iterator; } } // namespace TpetraWrappers @@ -77,8 +77,7 @@ namespace LinearAlgebra * * @ingroup TrilinosWrappers */ - template + template class Accessor { public: @@ -87,12 +86,19 @@ namespace LinearAlgebra */ using size_type = dealii::types::signed_global_dof_index; + /** + * Typedef for the NodeType + */ + using NodeType = Tpetra::KokkosCompat::KokkosDeviceWrapperNode< + typename MemorySpace::kokkos_space::execution_space, + typename MemorySpace::kokkos_space>; + /** * Constructor. */ - Accessor(const SparsityPattern *sparsity_pattern, - const size_type row, - const size_type index); + Accessor(const SparsityPattern *sparsity_pattern, + const size_type row, + const size_type index); /** * Row number of the element represented by this object. @@ -133,7 +139,7 @@ namespace LinearAlgebra /** * The matrix accessed. */ - SparsityPattern *sparsity_pattern; + SparsityPattern *sparsity_pattern; /** * Current row number. @@ -169,7 +175,7 @@ namespace LinearAlgebra visit_present_row(); // Make enclosing class a friend. - friend class Iterator; + friend class Iterator; }; /** @@ -177,8 +183,7 @@ namespace LinearAlgebra * TrilinosWrappers::SparsityPattern. Access to individual elements of the * sparsity pattern is handled by the Accessor class in this namespace. */ - template + template class Iterator { public: @@ -187,23 +192,30 @@ namespace LinearAlgebra */ using size_type = size_t; + /** + * Typedef for the NodeType + */ + using NodeType = Tpetra::KokkosCompat::KokkosDeviceWrapperNode< + typename MemorySpace::kokkos_space::execution_space, + typename MemorySpace::kokkos_space>; + /** * Constructor. Create an iterator into the matrix @p matrix for the * given row and the index within it. */ - Iterator(const SparsityPattern *sparsity_pattern, - const size_type row, - const size_type index); + Iterator(const SparsityPattern *sparsity_pattern, + const size_type row, + const size_type index); /** * Copy constructor. */ - Iterator(const Iterator &i); + Iterator(const Iterator &i); /** * Prefix increment. */ - Iterator & + Iterator & operator++(); /** @@ -215,13 +227,13 @@ namespace LinearAlgebra /** * Dereferencing operator. */ - const Accessor & + const Accessor & operator*() const; /** * Dereferencing operator. */ - const Accessor * + const Accessor * operator->() const; /** @@ -229,13 +241,13 @@ namespace LinearAlgebra * position. */ bool - operator==(const Iterator &) const; + operator==(const Iterator &) const; /** * Inverse of ==. */ bool - operator!=(const Iterator &) const; + operator!=(const Iterator &) const; /** * Comparison operator. Result is true if either the first row number is @@ -243,7 +255,7 @@ namespace LinearAlgebra * smaller. */ bool - operator<(const Iterator &) const; + operator<(const Iterator &) const; /** * Exception @@ -258,9 +270,9 @@ namespace LinearAlgebra /** * Store an object of the accessor class. */ - Accessor accessor; + Accessor accessor; - friend class TpetraWrappers::SparsityPattern; + friend class TpetraWrappers::SparsityPattern; }; } // namespace SparsityPatternIterators @@ -277,14 +289,13 @@ namespace LinearAlgebra * This class has many similarities to the DynamicSparsityPattern, since it * can dynamically add elements to the pattern without any memory being * previously reserved for it. However, it also has a method - * SparsityPattern::compress(), that finalizes the pattern and + * SparsityPattern::compress(), that finalizes the pattern and * enables its use with Trilinos sparse matrices. * * @ingroup TrilinosWrappers * @ingroup Sparsity */ - template + template class SparsityPattern : public SparsityPatternBase { public: @@ -293,10 +304,17 @@ namespace LinearAlgebra */ using size_type = dealii::types::signed_global_dof_index; + /** + * Typedef for the NodeType + */ + using NodeType = Tpetra::KokkosCompat::KokkosDeviceWrapperNode< + typename MemorySpace::kokkos_space::execution_space, + typename MemorySpace::kokkos_space>; + /** * Declare an alias for the iterator class. */ - using const_iterator = SparsityPatternIterators::Iterator; + using const_iterator = SparsityPatternIterators::Iterator; /** * Typedef for Tpetra::Map @@ -310,6 +328,7 @@ namespace LinearAlgebra using GraphType = Tpetra::CrsGraph; + /** * @name Basic constructors and initialization */ @@ -353,13 +372,14 @@ namespace LinearAlgebra * Move constructor. Create a new sparse matrix by stealing the internal * data. */ - SparsityPattern(SparsityPattern &&other) noexcept; + SparsityPattern(SparsityPattern &&other) noexcept; /** * Copy constructor. Sets the calling sparsity pattern to be the same as * the input sparsity pattern. */ - SparsityPattern(const SparsityPattern &input_sparsity_pattern); + SparsityPattern( + const SparsityPattern &input_sparsity_pattern); /** * Destructor. Made virtual so that one can use pointers to this class. @@ -400,7 +420,7 @@ namespace LinearAlgebra * input sparsity pattern. */ void - copy_from(const SparsityPattern &input_sparsity_pattern); + copy_from(const SparsityPattern &input_sparsity_pattern); /** * Copy function from one of the deal.II sparsity patterns. If used in @@ -417,8 +437,8 @@ namespace LinearAlgebra * the compiler. Use copy_from() instead if you know that you really want * to copy a sparsity pattern with non-trivial content. */ - SparsityPattern & - operator=(const SparsityPattern &input_sparsity_pattern); + SparsityPattern & + operator=(const SparsityPattern &input_sparsity_pattern); /** * Release all memory and return to a state just like after having called @@ -468,7 +488,7 @@ namespace LinearAlgebra * each m row. Since we know the number of elements in the sparsity * pattern exactly in this case, we can already allocate the right amount * of memory, which makes the creation process by the respective - * SparsityPattern::reinit call considerably faster. However, + * SparsityPattern::reinit call considerably faster. However, * this is a rather unusual situation, since knowing the number of entries * in each row is usually connected to knowing the indices of nonzero * entries, which the sparsity pattern is designed to describe. @@ -1017,9 +1037,9 @@ namespace LinearAlgebra Teuchos::RCP nonlocal_graph; // TODO: currently only for double - friend class SparseMatrix; - friend class SparsityPatternIterators::Accessor; - friend class SparsityPatternIterators::Iterator; + friend class SparseMatrix; + friend class SparsityPatternIterators::Accessor; + friend class SparsityPatternIterators::Iterator; }; @@ -1031,11 +1051,12 @@ namespace LinearAlgebra namespace SparsityPatternIterators { - template - inline Accessor::Accessor(const SparsityPattern *sp, - const size_type row, - const size_type index) - : sparsity_pattern(const_cast *>(sp)) + template + inline Accessor::Accessor( + const SparsityPattern *sp, + const size_type row, + const size_type index) + : sparsity_pattern(const_cast *>(sp)) , a_row(row) , a_index(index) { @@ -1044,9 +1065,9 @@ namespace LinearAlgebra - template - inline typename Accessor::size_type - Accessor::row() const + template + inline typename Accessor::size_type + Accessor::row() const { Assert(a_row < sparsity_pattern->n_rows(), ExcBeyondEndOfSparsityPattern()); @@ -1055,9 +1076,9 @@ namespace LinearAlgebra - template - inline typename Accessor::size_type - Accessor::column() const + template + inline typename Accessor::size_type + Accessor::column() const { Assert(a_row < sparsity_pattern->n_rows(), ExcBeyondEndOfSparsityPattern()); @@ -1066,9 +1087,9 @@ namespace LinearAlgebra - template - inline typename Accessor::size_type - Accessor::index() const + template + inline typename Accessor::size_type + Accessor::index() const { Assert(a_row < sparsity_pattern->n_rows(), ExcBeyondEndOfSparsityPattern()); @@ -1077,23 +1098,25 @@ namespace LinearAlgebra - template - inline Iterator::Iterator(const SparsityPattern *sp, - const size_type row, - const size_type index) + template + inline Iterator::Iterator( + const SparsityPattern *sp, + const size_type row, + const size_type index) : accessor(sp, row, index) {} - template - inline Iterator::Iterator(const Iterator &) = default; + template + inline Iterator::Iterator(const Iterator &) = + default; - template - inline Iterator & - Iterator::operator++() + template + inline Iterator & + Iterator::operator++() { Assert(accessor.a_row < accessor.sparsity_pattern->n_rows(), ExcIteratorPastEnd()); @@ -1130,38 +1153,39 @@ namespace LinearAlgebra - template - inline Iterator - Iterator::operator++(int) + template + inline Iterator + Iterator::operator++(int) { - const Iterator old_state = *this; + const Iterator old_state = *this; ++(*this); return old_state; } - template - inline const Accessor & - Iterator::operator*() const + template + inline const Accessor & + Iterator::operator*() const { return accessor; } - template - inline const Accessor * - Iterator::operator->() const + template + inline const Accessor * + Iterator::operator->() const { return &accessor; } - template + template inline bool - Iterator::operator==(const Iterator &other) const + Iterator::operator==( + const Iterator &other) const { return (accessor.a_row == other.accessor.a_row && accessor.a_index == other.accessor.a_index); @@ -1169,18 +1193,19 @@ namespace LinearAlgebra - template + template inline bool - Iterator::operator!=(const Iterator &other) const + Iterator::operator!=( + const Iterator &other) const { return !(*this == other); } - template + template inline bool - Iterator::operator<(const Iterator &other) const + Iterator::operator<(const Iterator &other) const { return (accessor.row() < other.accessor.row() || (accessor.row() == other.accessor.row() && @@ -1191,9 +1216,9 @@ namespace LinearAlgebra - template - inline typename SparsityPattern::const_iterator - SparsityPattern::begin() const + template + inline typename SparsityPattern::const_iterator + SparsityPattern::begin() const { const size_type first_valid_row = this->local_range().first; return const_iterator(this, first_valid_row, 0); @@ -1201,18 +1226,18 @@ namespace LinearAlgebra - template - inline typename SparsityPattern::const_iterator - SparsityPattern::end() const + template + inline typename SparsityPattern::const_iterator + SparsityPattern::end() const { return const_iterator(this, n_rows(), 0); } - template - inline typename SparsityPattern::const_iterator - SparsityPattern::begin(const size_type r) const + template + inline typename SparsityPattern::const_iterator + SparsityPattern::begin(const size_type r) const { AssertIndexRange(r, n_rows()); if (row_length(r) > 0) @@ -1223,9 +1248,9 @@ namespace LinearAlgebra - template - inline typename SparsityPattern::const_iterator - SparsityPattern::end(const size_type r) const + template + inline typename SparsityPattern::const_iterator + SparsityPattern::end(const size_type r) const { AssertIndexRange(r, n_rows()); @@ -1245,9 +1270,9 @@ namespace LinearAlgebra - template + template inline bool - SparsityPattern::in_local_range(const size_type index) const + SparsityPattern::in_local_range(const size_type index) const { const TrilinosWrappers::types::int_type begin = graph->getRowMap()->getMinGlobalIndex(); @@ -1260,40 +1285,40 @@ namespace LinearAlgebra - template + template inline bool - SparsityPattern::is_compressed() const + SparsityPattern::is_compressed() const { return graph->isFillComplete(); } - template + template inline bool - SparsityPattern::empty() const + SparsityPattern::empty() const { return ((n_rows() == 0) && (n_cols() == 0)); } - template + template inline void - SparsityPattern::add(const size_type i, const size_type j) + SparsityPattern::add(const size_type i, const size_type j) { add_entries(i, &j, &j + 1); } - template + template template inline void - SparsityPattern::add_entries(const size_type row, - ForwardIterator begin, - ForwardIterator end, - const bool /*indices_are_sorted*/) + SparsityPattern::add_entries(const size_type row, + ForwardIterator begin, + ForwardIterator end, + const bool /*indices_are_sorted*/) { if (begin == end) return; @@ -1322,6 +1347,9 @@ namespace LinearAlgebra AssertDimension(*col_index_ptr_end, *end); TrilinosWrappers::types::int_type trilinos_row_index = row; + // TODO: The following line creates an array by copying the entries. + // Perhaps there is a way to only create a 'view' of these arrays + // and pass that to Tpetra? Teuchos::Array array(col_index_ptr_begin, col_index_ptr_end); if (row_is_stored_locally(row)) @@ -1345,28 +1373,30 @@ namespace LinearAlgebra - template + template inline Teuchos::RCP< - Tpetra::CrsGraph> - SparsityPattern::trilinos_sparsity_pattern() const + Tpetra::CrsGraph::NodeType>> + SparsityPattern::trilinos_sparsity_pattern() const { return graph; } - template + template inline IndexSet - SparsityPattern::locally_owned_domain_indices() const + SparsityPattern::locally_owned_domain_indices() const { return IndexSet(graph->getDomainMap().getConst()); } - template + template inline IndexSet - SparsityPattern::locally_owned_range_indices() const + SparsityPattern::locally_owned_range_indices() const { return IndexSet(graph->getRangeMap().getConst()); } diff --git a/source/lac/trilinos_tpetra_sparsity_pattern.cc b/source/lac/trilinos_tpetra_sparsity_pattern.cc index 31b01f8430..b831cff3b6 100644 --- a/source/lac/trilinos_tpetra_sparsity_pattern.cc +++ b/source/lac/trilinos_tpetra_sparsity_pattern.cc @@ -36,9 +36,9 @@ namespace LinearAlgebra { namespace SparsityPatternIterators { - template + template void - Accessor::visit_present_row() + Accessor::visit_present_row() { // if we are asked to visit the past-the-end line, then simply // release all our caches and go on with life @@ -79,8 +79,8 @@ namespace LinearAlgebra // even matter how many threads there are, but only if we use an MPI // compiler or a standard compiler. So, even one thread on a configuration // with MPI will still get a parallel interface. - template - SparsityPattern::SparsityPattern() + template + SparsityPattern::SparsityPattern() { column_space_map = Utilities::Trilinos::internal::make_rcp( TrilinosWrappers::types::int_type(0), @@ -95,8 +95,8 @@ namespace LinearAlgebra - template - SparsityPattern::SparsityPattern( + template + SparsityPattern::SparsityPattern( const size_type m, const size_type n, const size_type n_entries_per_row) @@ -106,8 +106,8 @@ namespace LinearAlgebra - template - SparsityPattern::SparsityPattern( + template + SparsityPattern::SparsityPattern( const size_type m, const size_type n, const std::vector &n_entries_per_row) @@ -117,9 +117,9 @@ namespace LinearAlgebra - template - SparsityPattern::SparsityPattern( - SparsityPattern &&other) noexcept + template + SparsityPattern::SparsityPattern( + SparsityPattern &&other) noexcept : SparsityPatternBase(std::move(other)) , column_space_map(std::move(other.column_space_map)) , graph(std::move(other.graph)) @@ -129,9 +129,9 @@ namespace LinearAlgebra // Copy function only works if the sparsity pattern is empty. - template - SparsityPattern::SparsityPattern( - const SparsityPattern &input_sparsity) + template + SparsityPattern::SparsityPattern( + const SparsityPattern &input_sparsity) : SparsityPatternBase(input_sparsity) , column_space_map(Utilities::Trilinos::internal::make_rcp( 0, @@ -150,8 +150,8 @@ namespace LinearAlgebra - template - SparsityPattern::SparsityPattern( + template + SparsityPattern::SparsityPattern( const IndexSet ¶llel_partitioning, const MPI_Comm communicator, const size_type n_entries_per_row) @@ -164,8 +164,8 @@ namespace LinearAlgebra - template - SparsityPattern::SparsityPattern( + template + SparsityPattern::SparsityPattern( const IndexSet ¶llel_partitioning, const MPI_Comm communicator, const std::vector &n_entries_per_row) @@ -178,8 +178,8 @@ namespace LinearAlgebra - template - SparsityPattern::SparsityPattern( + template + SparsityPattern::SparsityPattern( const IndexSet &row_parallel_partitioning, const IndexSet &col_parallel_partitioning, const MPI_Comm communicator, @@ -193,8 +193,8 @@ namespace LinearAlgebra - template - SparsityPattern::SparsityPattern( + template + SparsityPattern::SparsityPattern( const IndexSet &row_parallel_partitioning, const IndexSet &col_parallel_partitioning, const MPI_Comm communicator, @@ -208,8 +208,8 @@ namespace LinearAlgebra - template - SparsityPattern::SparsityPattern( + template + SparsityPattern::SparsityPattern( const IndexSet &row_parallel_partitioning, const IndexSet &col_parallel_partitioning, const IndexSet &writable_rows, @@ -225,11 +225,11 @@ namespace LinearAlgebra - template + template void - SparsityPattern::reinit(const size_type m, - const size_type n, - const size_type n_entries_per_row) + SparsityPattern::reinit(const size_type m, + const size_type n, + const size_type n_entries_per_row) { reinit(complete_index_set(m), complete_index_set(n), @@ -239,9 +239,9 @@ namespace LinearAlgebra - template + template void - SparsityPattern::reinit( + SparsityPattern::reinit( const size_type m, const size_type n, const std::vector &n_entries_per_row) @@ -256,25 +256,29 @@ namespace LinearAlgebra namespace { - template - using size_type = typename SparsityPattern::size_type; + template + using size_type = typename SparsityPattern::size_type; - template + template using MapType = - Tpetra::Map; + Tpetra::Map::NodeType>; - template + template using GraphType = - Tpetra::CrsGraph; + Tpetra::CrsGraph::NodeType>; - template + template void - reinit_sp(const Teuchos::RCP> &row_map, - const Teuchos::RCP> &col_map, - const size_type n_entries_per_row, - Teuchos::RCP> &column_space_map, - Teuchos::RCP> &graph, - Teuchos::RCP> &nonlocal_graph) + reinit_sp(const Teuchos::RCP> &row_map, + const Teuchos::RCP> &col_map, + const size_type n_entries_per_row, + Teuchos::RCP> &column_space_map, + Teuchos::RCP> &graph, + Teuchos::RCP> &nonlocal_graph) { Assert(row_map->isOneToOne(), ExcMessage("Row map must be 1-to-1, i.e., no overlap between " @@ -295,20 +299,20 @@ namespace LinearAlgebra // columns as well. If we use a recent Trilinos version, we can also // require building a non-local graph which gives us thread-safe // initialization. - graph = Utilities::Trilinos::internal::make_rcp>( + graph = Utilities::Trilinos::internal::make_rcp>( row_map, row_map, n_entries_per_row); } - template + template void - reinit_sp(const Teuchos::RCP> &row_map, - const Teuchos::RCP> &col_map, - const std::vector> &n_entries_per_row, - Teuchos::RCP> &column_space_map, - Teuchos::RCP> &graph, - Teuchos::RCP> &nonlocal_graph) + reinit_sp(const Teuchos::RCP> &row_map, + const Teuchos::RCP> &col_map, + const std::vector> &n_entries_per_row, + Teuchos::RCP> &column_space_map, + Teuchos::RCP> &graph, + Teuchos::RCP> &nonlocal_graph) { Assert(row_map->isOneToOne(), ExcMessage("Row map must be 1-to-1, i.e., no overlap between " @@ -351,21 +355,21 @@ namespace LinearAlgebra ExcMessage( "You are requesting to store more elements than global ordinal type allows.")); - graph = Utilities::Trilinos::internal::make_rcp>( + graph = Utilities::Trilinos::internal::make_rcp>( row_map, col_map, local_entries_per_row); } - template + template void - reinit_sp(const Teuchos::RCP> &row_map, - const Teuchos::RCP> &col_map, - const SparsityPatternType &sp, - [[maybe_unused]] const bool exchange_data, - Teuchos::RCP> &column_space_map, - Teuchos::RCP> &graph, - Teuchos::RCP> &nonlocal_graph) + reinit_sp(const Teuchos::RCP> &row_map, + const Teuchos::RCP> &col_map, + const SparsityPatternType &sp, + [[maybe_unused]] const bool exchange_data, + Teuchos::RCP> &column_space_map, + Teuchos::RCP> &graph, + Teuchos::RCP> &nonlocal_graph) { nonlocal_graph.reset(); graph.reset(); @@ -374,17 +378,19 @@ namespace LinearAlgebra AssertDimension(sp.n_cols(), col_map->getGlobalNumElements()); column_space_map = - Utilities::Trilinos::internal::make_rcp>(*col_map); + Utilities::Trilinos::internal::make_rcp>( + *col_map); Assert(row_map->isContiguous() == true, ExcMessage( "This function only works if the row map is contiguous.")); - const size_type first_row = row_map->getMinGlobalIndex(), - last_row = row_map->getMaxGlobalIndex() + 1; + const size_type first_row = row_map->getMinGlobalIndex(), + last_row = + row_map->getMaxGlobalIndex() + 1; Teuchos::Array n_entries_per_row(last_row - first_row); - for (size_type row = first_row; row < last_row; ++row) + for (size_type row = first_row; row < last_row; ++row) n_entries_per_row[row - first_row] = sp.row_length(row); AssertThrow( @@ -402,18 +408,20 @@ namespace LinearAlgebra "with 'local ordinate = long long' ")); if (row_map->getComm()->getSize() > 1) - graph = Utilities::Trilinos::internal::make_rcp>( - row_map, n_entries_per_row()); + graph = + Utilities::Trilinos::internal::make_rcp>( + row_map, n_entries_per_row()); else - graph = Utilities::Trilinos::internal::make_rcp>( - row_map, col_map, n_entries_per_row()); + graph = + Utilities::Trilinos::internal::make_rcp>( + row_map, col_map, n_entries_per_row()); AssertDimension(sp.n_rows(), graph->getGlobalNumRows()); AssertDimension(sp.n_cols(), graph->getGlobalNumEntries()); std::vector row_indices; - for (size_type row = first_row; row < last_row; ++row) + for (size_type row = first_row; row < last_row; ++row) { const TrilinosWrappers::types::int_type row_length = sp.row_length(row); @@ -440,25 +448,25 @@ namespace LinearAlgebra } // namespace - template + template void - SparsityPattern::reinit(const IndexSet ¶llel_partitioning, - const MPI_Comm communicator, - const size_type n_entries_per_row) + SparsityPattern::reinit(const IndexSet ¶llel_partitioning, + const MPI_Comm communicator, + const size_type n_entries_per_row) { SparsityPatternBase::resize(parallel_partitioning.size(), parallel_partitioning.size()); Teuchos::RCP map = parallel_partitioning.make_tpetra_map_rcp(communicator, false); - reinit_sp( + reinit_sp( map, map, n_entries_per_row, column_space_map, graph, nonlocal_graph); } - template + template void - SparsityPattern::reinit( + SparsityPattern::reinit( const IndexSet ¶llel_partitioning, const MPI_Comm communicator, const std::vector &n_entries_per_row) @@ -467,18 +475,19 @@ namespace LinearAlgebra parallel_partitioning.size()); Teuchos::RCP map = parallel_partitioning.make_tpetra_map_rcp(communicator, false); - reinit_sp( + reinit_sp( map, map, n_entries_per_row, column_space_map, graph, nonlocal_graph); } - template + template void - SparsityPattern::reinit(const IndexSet &row_parallel_partitioning, - const IndexSet &col_parallel_partitioning, - const MPI_Comm communicator, - const size_type n_entries_per_row) + SparsityPattern::reinit( + const IndexSet &row_parallel_partitioning, + const IndexSet &col_parallel_partitioning, + const MPI_Comm communicator, + const size_type n_entries_per_row) { SparsityPatternBase::resize(row_parallel_partitioning.size(), col_parallel_partitioning.size()); @@ -486,19 +495,19 @@ namespace LinearAlgebra row_parallel_partitioning.make_tpetra_map_rcp(communicator, false); Teuchos::RCP col_map = col_parallel_partitioning.make_tpetra_map_rcp(communicator, false); - reinit_sp(row_map, - col_map, - n_entries_per_row, - column_space_map, - graph, - nonlocal_graph); + reinit_sp(row_map, + col_map, + n_entries_per_row, + column_space_map, + graph, + nonlocal_graph); } - template + template void - SparsityPattern::reinit( + SparsityPattern::reinit( const IndexSet &row_parallel_partitioning, const IndexSet &col_parallel_partitioning, const MPI_Comm communicator, @@ -510,23 +519,24 @@ namespace LinearAlgebra row_parallel_partitioning.make_tpetra_map_rcp(communicator, false); Teuchos::RCP col_map = col_parallel_partitioning.make_tpetra_map_rcp(communicator, false); - reinit_sp(row_map, - col_map, - n_entries_per_row, - column_space_map, - graph, - nonlocal_graph); + reinit_sp(row_map, + col_map, + n_entries_per_row, + column_space_map, + graph, + nonlocal_graph); } - template + template void - SparsityPattern::reinit(const IndexSet &row_parallel_partitioning, - const IndexSet &col_parallel_partitioning, - const IndexSet &writable_rows, - const MPI_Comm communicator, - const size_type n_entries_per_row) + SparsityPattern::reinit( + const IndexSet &row_parallel_partitioning, + const IndexSet &col_parallel_partitioning, + const IndexSet &writable_rows, + const MPI_Comm communicator, + const size_type n_entries_per_row) { SparsityPatternBase::resize(row_parallel_partitioning.size(), col_parallel_partitioning.size()); @@ -534,12 +544,12 @@ namespace LinearAlgebra row_parallel_partitioning.make_tpetra_map_rcp(communicator, false); Teuchos::RCP col_map = col_parallel_partitioning.make_tpetra_map_rcp(communicator, false); - reinit_sp(row_map, - col_map, - n_entries_per_row, - column_space_map, - graph, - nonlocal_graph); + reinit_sp(row_map, + col_map, + n_entries_per_row, + column_space_map, + graph, + nonlocal_graph); IndexSet nonlocal_partitioner = writable_rows; AssertDimension(nonlocal_partitioner.size(), @@ -569,10 +579,10 @@ namespace LinearAlgebra - template + template template void - SparsityPattern::reinit( + SparsityPattern::reinit( const IndexSet &row_parallel_partitioning, const IndexSet &col_parallel_partitioning, const SparsityPatternType &nontrilinos_sparsity_pattern, @@ -585,21 +595,21 @@ namespace LinearAlgebra row_parallel_partitioning.make_tpetra_map_rcp(communicator, false); Teuchos::RCP col_map = col_parallel_partitioning.make_tpetra_map_rcp(communicator, false); - reinit_sp(row_map, - col_map, - nontrilinos_sparsity_pattern, - exchange_data, - column_space_map, - graph, - nonlocal_graph); + reinit_sp(row_map, + col_map, + nontrilinos_sparsity_pattern, + exchange_data, + column_space_map, + graph, + nonlocal_graph); } - template + template template void - SparsityPattern::reinit( + SparsityPattern::reinit( const IndexSet ¶llel_partitioning, const SparsityPatternType &nontrilinos_sparsity_pattern, const MPI_Comm communicator, @@ -613,20 +623,21 @@ namespace LinearAlgebra parallel_partitioning.size()); Teuchos::RCP map = parallel_partitioning.make_tpetra_map_rcp(communicator, false); - reinit_sp(map, - map, - nontrilinos_sparsity_pattern, - exchange_data, - column_space_map, - graph, - nonlocal_graph); + reinit_sp(map, + map, + nontrilinos_sparsity_pattern, + exchange_data, + column_space_map, + graph, + nonlocal_graph); } - template - SparsityPattern & - SparsityPattern::operator=(const SparsityPattern &) + template + SparsityPattern & + SparsityPattern::operator=( + const SparsityPattern &) { Assert(false, ExcNotImplemented()); return *this; @@ -634,9 +645,10 @@ namespace LinearAlgebra - template + template void - SparsityPattern::copy_from(const SparsityPattern &sp) + SparsityPattern::copy_from( + const SparsityPattern &sp) { SparsityPatternBase::resize(sp.n_rows(), sp.n_cols()); column_space_map = @@ -652,10 +664,10 @@ namespace LinearAlgebra - template + template template void - SparsityPattern::copy_from(const SparsityPatternType &sp) + SparsityPattern::copy_from(const SparsityPatternType &sp) { SparsityPatternBase::resize(sp.n_rows(), sp.n_cols()); Teuchos::RCP rows = @@ -669,15 +681,15 @@ namespace LinearAlgebra 0, Utilities::Trilinos::tpetra_comm_self()); - reinit_sp( + reinit_sp( rows, columns, sp, false, column_space_map, graph, nonlocal_graph); } - template + template void - SparsityPattern::clear() + SparsityPattern::clear() { SparsityPatternBase::resize(0, 0); // When we clear the matrix, reset @@ -698,9 +710,9 @@ namespace LinearAlgebra - template + template void - SparsityPattern::compress() + SparsityPattern::compress() { Assert(column_space_map.get(), ExcInternalError()); if (nonlocal_graph.get() != nullptr) @@ -749,9 +761,9 @@ namespace LinearAlgebra - template + template bool - SparsityPattern::row_is_stored_locally(const size_type i) const + SparsityPattern::row_is_stored_locally(const size_type i) const { return graph->getRowMap()->getLocalElement(i) != Teuchos::OrdinalTraits::invalid(); @@ -759,10 +771,10 @@ namespace LinearAlgebra - template + template bool - SparsityPattern::exists(const size_type i, - const size_type j) const + SparsityPattern::exists(const size_type i, + const size_type j) const { if (!row_is_stored_locally(i)) return false; @@ -788,9 +800,9 @@ namespace LinearAlgebra - template - typename SparsityPattern::size_type - SparsityPattern::bandwidth() const + template + typename SparsityPattern::size_type + SparsityPattern::bandwidth() const { size_type local_b = 0; for (int i = 0; i < static_cast(local_size()); ++i) @@ -815,19 +827,19 @@ namespace LinearAlgebra - template + template unsigned int - SparsityPattern::local_size() const + SparsityPattern::local_size() const { return graph->getLocalNumRows(); } - template - std::pair::size_type, - typename SparsityPattern::size_type> - SparsityPattern::local_range() const + template + std::pair::size_type, + typename SparsityPattern::size_type> + SparsityPattern::local_range() const { const size_type begin = graph->getRowMap()->getMinGlobalIndex(); const size_type end = graph->getRowMap()->getMaxGlobalIndex() + 1; @@ -837,27 +849,27 @@ namespace LinearAlgebra - template + template std::uint64_t - SparsityPattern::n_nonzero_elements() const + SparsityPattern::n_nonzero_elements() const { return graph->getGlobalNumEntries(); } - template + template unsigned int - SparsityPattern::max_entries_per_row() const + SparsityPattern::max_entries_per_row() const { return graph->getLocalMaxNumRowEntries(); } - template - typename SparsityPattern::size_type - SparsityPattern::row_length(const size_type row) const + template + typename SparsityPattern::size_type + SparsityPattern::row_length(const size_type row) const { Assert(row < (size_type)n_rows(), ExcInternalError()); @@ -876,9 +888,9 @@ namespace LinearAlgebra - template + template void - SparsityPattern::add_row_entries( + SparsityPattern::add_row_entries( const dealii::types::global_dof_index &row, const ArrayView &columns, const bool indices_are_sorted) @@ -888,27 +900,27 @@ namespace LinearAlgebra - template - Teuchos::RCP> - SparsityPattern::domain_partitioner() const + template + Teuchos::RCP> + SparsityPattern::domain_partitioner() const { return graph->getDomainMap(); } - template - Teuchos::RCP> - SparsityPattern::range_partitioner() const + template + Teuchos::RCP> + SparsityPattern::range_partitioner() const { return graph->getRangeMap(); } - template + template MPI_Comm - SparsityPattern::get_mpi_communicator() const + SparsityPattern::get_mpi_communicator() const { return Utilities::Trilinos::teuchos_comm_to_mpi_comm( graph->getRangeMap()->getComm()); @@ -916,9 +928,9 @@ namespace LinearAlgebra - template + template Teuchos::RCP> - SparsityPattern::get_teuchos_mpi_communicator() const + SparsityPattern::get_teuchos_mpi_communicator() const { return graph->getRangeMap()->getComm(); } @@ -928,9 +940,9 @@ namespace LinearAlgebra // As of now, no particularly neat // output is generated in case of // multiple processors. - template + template void - SparsityPattern::print( + SparsityPattern::print( std::ostream &out, const bool write_extended_trilinos_info) const { @@ -955,9 +967,9 @@ namespace LinearAlgebra - template + template void - SparsityPattern::print_gnuplot(std::ostream &out) const + SparsityPattern::print_gnuplot(std::ostream &out) const { Assert(graph->isFillComplete() == true, ExcInternalError()); for (dealii::types::signed_global_dof_index row = 0; row < local_size(); @@ -989,9 +1001,9 @@ namespace LinearAlgebra } // TODO: Implement! - template + template std::size_t - SparsityPattern::memory_consumption() const + SparsityPattern::memory_consumption() const { Assert(false, ExcNotImplemented()); return 0; @@ -1000,44 +1012,43 @@ namespace LinearAlgebra # ifndef DOXYGEN // explicit instantiations - template class SparsityPattern< - Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>; + template class SparsityPattern; template void - SparsityPattern:: - copy_from(const dealii::SparsityPattern &); + SparsityPattern::copy_from( + const dealii::SparsityPattern &); template void - SparsityPattern:: - copy_from(const dealii::DynamicSparsityPattern &); + SparsityPattern::copy_from( + const dealii::DynamicSparsityPattern &); template void - SparsityPattern:: - reinit(const IndexSet &, - const dealii::SparsityPattern &, - const MPI_Comm, - bool); + SparsityPattern::reinit( + const IndexSet &, + const dealii::SparsityPattern &, + const MPI_Comm, + bool); template void - SparsityPattern:: - reinit(const IndexSet &, - const dealii::DynamicSparsityPattern &, - const MPI_Comm, - bool); + SparsityPattern::reinit( + const IndexSet &, + const dealii::DynamicSparsityPattern &, + const MPI_Comm, + bool); template void - SparsityPattern:: - reinit(const IndexSet &, - const IndexSet &, - const dealii::SparsityPattern &, - const MPI_Comm, - bool); + SparsityPattern::reinit( + const IndexSet &, + const IndexSet &, + const dealii::SparsityPattern &, + const MPI_Comm, + bool); template void - SparsityPattern:: - reinit(const IndexSet &, - const IndexSet &, - const dealii::DynamicSparsityPattern &, - const MPI_Comm, - bool); + SparsityPattern::reinit( + const IndexSet &, + const IndexSet &, + const dealii::DynamicSparsityPattern &, + const MPI_Comm, + bool); # endif } // namespace TpetraWrappers