16 #ifndef dealii_block_sparsity_pattern_h 17 #define dealii_block_sparsity_pattern_h 36 template <
typename number>
78 template <
typename SparsityPatternType>
161 SparsityPatternType &
169 const SparsityPatternType &
244 template <
typename ForwardIterator>
247 ForwardIterator
begin,
249 const bool indices_are_sorted =
false);
299 print(std::ostream &out)
const;
324 <<
"The blocks [" << arg1 <<
',' << arg2 <<
"] and [" << arg3
325 <<
',' << arg4 <<
"] have differing row numbers.");
334 <<
"The blocks [" << arg1 <<
',' << arg2 <<
"] and [" << arg3
335 <<
',' << arg4 <<
"] have differing column numbers.");
384 template <
typename number>
439 const std::vector<std::vector<unsigned int>> &row_lengths);
447 is_compressed()
const;
547 const std::vector<size_type> &col_block_sizes);
576 reinit(
const std::vector<size_type> &row_block_sizes,
577 const std::vector<size_type> &col_block_sizes);
584 reinit(
const std::vector<IndexSet> &partitioning);
599 column_number(
const size_type row,
const unsigned int index)
const;
610 #ifdef DEAL_II_WITH_TRILINOS 663 const std::vector<size_type> &col_block_sizes);
673 const MPI_Comm &communicator = MPI_COMM_WORLD);
687 const std::vector<IndexSet> &row_parallel_partitioning,
688 const std::vector<IndexSet> &column_parallel_partitioning,
689 const std::vector<IndexSet> &writeable_rows,
690 const MPI_Comm & communicator = MPI_COMM_WORLD);
702 reinit(
const std::vector<size_type> &row_block_sizes,
703 const std::vector<size_type> &col_block_sizes);
710 reinit(
const std::vector<IndexSet> ¶llel_partitioning,
711 const MPI_Comm & communicator = MPI_COMM_WORLD);
719 reinit(
const std::vector<IndexSet> &row_parallel_partitioning,
720 const std::vector<IndexSet> &column_parallel_partitioning,
721 const MPI_Comm & communicator = MPI_COMM_WORLD);
732 reinit(
const std::vector<IndexSet> &row_parallel_partitioning,
733 const std::vector<IndexSet> &column_parallel_partitioning,
734 const std::vector<IndexSet> &writeable_rows,
735 const MPI_Comm & communicator = MPI_COMM_WORLD);
753 template <
typename SparsityPatternType>
754 inline SparsityPatternType &
765 template <
typename SparsityPatternType>
766 inline const SparsityPatternType &
778 template <
typename SparsityPatternType>
787 template <
typename SparsityPatternType>
796 template <
typename SparsityPatternType>
804 const std::pair<size_type, size_type> row_index =
808 sub_objects[row_index.first][col_index.first]->add(row_index.second,
814 template <
typename SparsityPatternType>
815 template <
typename ForwardIterator>
819 ForwardIterator
begin,
821 const bool indices_are_sorted)
860 for (ForwardIterator it = begin; it !=
end; ++it)
864 const std::pair<size_type, size_type> col_index =
886 const std::pair<size_type, size_type> row_index =
892 sub_objects[row_index.first][block_col]->add_entries(
903 template <
typename SparsityPatternType>
911 const std::pair<size_type, size_type> row_index =
915 return sub_objects[row_index.first][col_index.first]->exists(
916 row_index.second, col_index.second);
921 template <
typename SparsityPatternType>
926 const std::pair<size_type, size_type> row_index =
932 c +=
sub_objects[row_index.first][
b]->row_length(row_index.second);
939 template <
typename SparsityPatternType>
948 template <
typename SparsityPatternType>
958 const unsigned int index)
const 961 const std::pair<size_type, size_type> row_index =
970 unsigned int rowlen =
971 sub_objects[row_index.first][
b]->row_length(row_index.second);
972 if (index < c + rowlen)
973 return block_columns +
974 sub_objects[row_index.first][
b]->column_number(row_index.second,
977 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
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()