16 #ifndef dealii_block_sparsity_pattern_h 17 #define dealii_block_sparsity_pattern_h 36 template <
typename number>
77 template <
typename SparsityPatternType>
160 SparsityPatternType &
168 const SparsityPatternType &
243 template <
typename ForwardIterator>
246 ForwardIterator
begin,
248 const bool indices_are_sorted =
false);
298 print(std::ostream &out)
const;
331 <<
"The blocks [" << arg1 <<
',' << arg2 <<
"] and [" << arg3
332 <<
',' << arg4 <<
"] have differing row numbers.");
341 <<
"The blocks [" << arg1 <<
',' << arg2 <<
"] and [" << arg3
342 <<
',' << arg4 <<
"] have differing column numbers.");
391 template <
typename number>
444 const std::vector<std::vector<unsigned int>> &row_lengths);
452 is_compressed()
const;
550 const std::vector<size_type> &col_block_sizes);
579 reinit(
const std::vector<size_type> &row_block_sizes,
580 const std::vector<size_type> &col_block_sizes);
587 reinit(
const std::vector<IndexSet> &partitioning);
602 column_number(
const size_type row,
const unsigned int index)
const;
613 #ifdef DEAL_II_WITH_TRILINOS 664 const std::vector<size_type> &col_block_sizes);
674 const MPI_Comm &communicator = MPI_COMM_WORLD);
688 const std::vector<IndexSet> &row_parallel_partitioning,
689 const std::vector<IndexSet> &column_parallel_partitioning,
690 const std::vector<IndexSet> &writeable_rows,
691 const MPI_Comm & communicator = MPI_COMM_WORLD);
703 reinit(
const std::vector<size_type> &row_block_sizes,
704 const std::vector<size_type> &col_block_sizes);
711 reinit(
const std::vector<IndexSet> ¶llel_partitioning,
712 const MPI_Comm & communicator = MPI_COMM_WORLD);
720 reinit(
const std::vector<IndexSet> &row_parallel_partitioning,
721 const std::vector<IndexSet> &column_parallel_partitioning,
722 const MPI_Comm & communicator = MPI_COMM_WORLD);
733 reinit(
const std::vector<IndexSet> &row_parallel_partitioning,
734 const std::vector<IndexSet> &column_parallel_partitioning,
735 const std::vector<IndexSet> &writeable_rows,
736 const MPI_Comm & communicator = MPI_COMM_WORLD);
754 template <
typename SparsityPatternType>
755 inline SparsityPatternType &
766 template <
typename SparsityPatternType>
767 inline const SparsityPatternType &
779 template <
typename SparsityPatternType>
788 template <
typename SparsityPatternType>
797 template <
typename SparsityPatternType>
805 const std::pair<size_type, size_type> row_index =
809 sub_objects[row_index.first][col_index.first]->add(row_index.second,
815 template <
typename SparsityPatternType>
816 template <
typename ForwardIterator>
820 ForwardIterator
begin,
822 const bool indices_are_sorted)
861 for (ForwardIterator it = begin; it !=
end; ++it)
865 const std::pair<size_type, size_type> col_index =
887 const std::pair<size_type, size_type> row_index =
893 sub_objects[row_index.first][block_col]->add_entries(
904 template <
typename SparsityPatternType>
912 const std::pair<size_type, size_type> row_index =
916 return sub_objects[row_index.first][col_index.first]->exists(
917 row_index.second, col_index.second);
922 template <
typename SparsityPatternType>
927 const std::pair<size_type, size_type> row_index =
933 c +=
sub_objects[row_index.first][
b]->row_length(row_index.second);
940 template <
typename SparsityPatternType>
949 template <
typename SparsityPatternType>
959 const unsigned int index)
const 962 const std::pair<size_type, size_type> row_index =
971 unsigned int rowlen =
972 sub_objects[row_index.first][
b]->row_length(row_index.second);
973 if (index < c + rowlen)
974 return block_columns +
975 sub_objects[row_index.first][
b]->column_number(row_index.second,
978 block_columns +=
sub_objects[row_index.first][
b]->n_cols();
static ::ExceptionBase & ExcIncompatibleRowNumbers(int arg1, int arg2, int arg3, int arg4)
BlockIndices column_indices
size_type column_number(const size_type row, const unsigned int index) const
std::vector< std::vector< size_type > > block_column_indices
std::vector< size_type > counter_within_block
BlockSparsityPatternBase()
size_type n_block_cols() const
size_type n_block_rows() const
#define AssertIndexRange(index, range)
SparsityPatternType & block(const size_type row, const size_type column)
bool exists(const size_type i, const size_type j) const
void reinit(const size_type n_block_rows, const size_type n_block_columns)
void reinit(const size_type n_block_rows, const size_type n_block_columns)
static const size_type invalid_entry
void add(const size_type i, const size_type j)
void print(std::ostream &out) const
size_type max_entries_per_row() const
#define Assert(cond, exc)
void add_entries(const size_type row, ForwardIterator begin, ForwardIterator end, const bool indices_are_sorted=false)
const BlockIndices & get_row_indices() const
#define DEAL_II_NAMESPACE_CLOSE
VectorType::value_type * end(VectorType &V)
BlockSparsityPatternBase & operator=(const BlockSparsityPatternBase &)
static ::ExceptionBase & ExcIncompatibleColNumbers(int arg1, int arg2, int arg3, int arg4)
size_type n_nonzero_elements() const
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
~BlockSparsityPatternBase() override
void print_svg(std::ostream &out) const
unsigned int global_dof_index
Table< 2, SmartPointer< SparsityPatternType, BlockSparsityPatternBase< SparsityPatternType > > > sub_objects
#define DEAL_II_NAMESPACE_OPEN
VectorType::value_type * begin(VectorType &V)
#define DeclException4(Exception4, type1, type2, type3, type4, outsequence)
unsigned int row_length(const size_type row) const
void print_gnuplot(std::ostream &out) const
static const size_type invalid_entry
types::global_dof_index size_type
std::pair< unsigned int, size_type > global_to_local(const size_type i) const
const BlockIndices & get_column_indices() const
std::enable_if< std::is_fundamental< T >::value, std::size_t >::type memory_consumption(const T &t)
static ::ExceptionBase & ExcInternalError()