Reference documentation for deal.II version 9.1.1
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
Public Member Functions | List of all members
BlockSparsityPattern Class Reference

#include <deal.II/lac/block_sparsity_pattern.h>

Inheritance diagram for BlockSparsityPattern:
[legend]

Public Member Functions

 BlockSparsityPattern ()=default
 
 BlockSparsityPattern (const size_type n_rows, const size_type n_columns)
 
void reinit (const size_type n_block_rows, const size_type n_block_columns)
 
void reinit (const BlockIndices &row_indices, const BlockIndices &col_indices, const std::vector< std::vector< unsigned int >> &row_lengths)
 
bool is_compressed () const
 
std::size_t memory_consumption () const
 
void copy_from (const BlockDynamicSparsityPattern &dsp)
 
- Public Member Functions inherited from BlockSparsityPatternBase< SparsityPattern >
 BlockSparsityPatternBase ()
 
 BlockSparsityPatternBase (const size_type n_block_rows, const size_type n_block_columns)
 
 BlockSparsityPatternBase (const BlockSparsityPatternBase &bsp)
 
 ~BlockSparsityPatternBase () override
 
void reinit (const size_type n_block_rows, const size_type n_block_columns)
 
BlockSparsityPatternBaseoperator= (const BlockSparsityPatternBase &)
 
void collect_sizes ()
 
SparsityPatternblock (const size_type row, const size_type column)
 
const SparsityPatternblock (const size_type row, const size_type column) const
 
const BlockIndicesget_row_indices () const
 
const BlockIndicesget_column_indices () const
 
void compress ()
 
size_type n_block_rows () const
 
size_type n_block_cols () const
 
bool empty () const
 
size_type max_entries_per_row () const
 
void add (const size_type i, const size_type j)
 
void add_entries (const size_type row, ForwardIterator begin, ForwardIterator end, const bool indices_are_sorted=false)
 
size_type n_rows () const
 
size_type n_cols () const
 
bool exists (const size_type i, const size_type j) const
 
unsigned int row_length (const size_type row) const
 
size_type n_nonzero_elements () const
 
void print (std::ostream &out) const
 
void print_gnuplot (std::ostream &out) const
 
- Public Member Functions inherited from Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
 Subscriptor (Subscriptor &&) noexcept
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
Subscriptoroperator= (Subscriptor &&) noexcept
 
void subscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
void unsubscribe (std::atomic< bool > *const validity, const std::string &identifier="") const
 
unsigned int n_subscriptions () const
 
template<typename StreamType >
void list_subscribers (StreamType &stream) const
 
void list_subscribers () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Additional Inherited Members

- Public Types inherited from BlockSparsityPatternBase< SparsityPattern >
using size_type = types::global_dof_index
 
- Static Public Member Functions inherited from BlockSparsityPatternBase< SparsityPattern >
static ::ExceptionBaseExcIncompatibleRowNumbers (int arg1, int arg2, int arg3, int arg4)
 
static ::ExceptionBaseExcIncompatibleColNumbers (int arg1, int arg2, int arg3, int arg4)
 
- Static Public Member Functions inherited from Subscriptor
static ::ExceptionBaseExcInUse (int arg1, std::string arg2, std::string arg3)
 
static ::ExceptionBaseExcNoSubscriber (std::string arg1, std::string arg2)
 
- Static Public Attributes inherited from BlockSparsityPatternBase< SparsityPattern >
static const size_type invalid_entry
 
- Protected Attributes inherited from BlockSparsityPatternBase< SparsityPattern >
size_type rows
 
size_type columns
 
Table< 2, SmartPointer< SparsityPattern, BlockSparsityPatternBase< SparsityPattern > > > sub_objects
 
BlockIndices row_indices
 
BlockIndices column_indices
 

Detailed Description

This class extends the base class to implement an array of sparsity patterns that can be used by block sparse matrix objects. It only adds a few additional member functions, but the main interface stems from the base class, see there for more information.

This class is an example of the "static" type of Sparsity patterns.

Author
Wolfgang Bangerth, 2000, 2001

Definition at line 401 of file block_sparsity_pattern.h.

Constructor & Destructor Documentation

◆ BlockSparsityPattern() [1/2]

BlockSparsityPattern::BlockSparsityPattern ( )
default

Initialize the matrix empty, that is with no memory allocated. This is useful if you want such objects as member variables in other classes. You can make the structure usable by calling the reinit() function.

◆ BlockSparsityPattern() [2/2]

BlockSparsityPattern::BlockSparsityPattern ( const size_type  n_rows,
const size_type  n_columns 
)

Initialize the matrix with the given number of block rows and columns. The blocks themselves are still empty, and you have to call collect_sizes() after you assign them sizes.

Definition at line 331 of file block_sparsity_pattern.cc.

Member Function Documentation

◆ reinit() [1/2]

void BlockSparsityPattern::reinit ( const size_type  n_block_rows,
const size_type  n_block_columns 
)
inline

Forwarding to BlockSparsityPatternBase::reinit().

Definition at line 998 of file block_sparsity_pattern.h.

◆ reinit() [2/2]

void BlockSparsityPattern::reinit ( const BlockIndices row_indices,
const BlockIndices col_indices,
const std::vector< std::vector< unsigned int >> &  row_lengths 
)

Initialize the pattern with two BlockIndices for the block structures of matrix rows and columns as well as a row length vector.

The row length vector should be in the format produced by DoFTools. Alternatively, there is a simplified version, where each of the inner vectors has length one. Then, the corresponding entry is used as the maximal row length.

For the diagonal blocks, the inner SparsityPattern is initialized with optimized diagonals, while this is not done for the off-diagonal blocks.

Definition at line 338 of file block_sparsity_pattern.cc.

◆ is_compressed()

bool BlockSparsityPattern::is_compressed ( ) const

Return whether the structure is compressed or not, i.e. whether all sub- matrices are compressed.

Definition at line 376 of file block_sparsity_pattern.cc.

◆ memory_consumption()

std::size_t BlockSparsityPattern::memory_consumption ( ) const

Determine an estimate for the memory consumption (in bytes) of this object.

Definition at line 387 of file block_sparsity_pattern.cc.

◆ copy_from()

void BlockSparsityPattern::copy_from ( const BlockDynamicSparsityPattern dsp)

Copy data from an object of type BlockDynamicSparsityPattern, i.e. resize this object to the size of the given argument, and copy over the contents of each of the subobjects. Previous content of this object is lost.

Definition at line 405 of file block_sparsity_pattern.cc.


The documentation for this class was generated from the following files: