Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Classes | Public Types | Public Member Functions | List of all members
DynamicSparsityPattern Class Reference

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

Inheritance diagram for DynamicSparsityPattern:
[legend]

Classes

struct  Line
 

Public Types

using size_type = types::global_dof_index
 
using iterator = DynamicSparsityPatternIterators::Iterator
 
using const_iterator = DynamicSparsityPatternIterators::Iterator
 

Public Member Functions

 DynamicSparsityPattern ()
 
 DynamicSparsityPattern (const DynamicSparsityPattern &)
 
 DynamicSparsityPattern (const size_type m, const size_type n, const IndexSet &rowset=IndexSet())
 
 DynamicSparsityPattern (const IndexSet &indexset)
 
 DynamicSparsityPattern (const size_type n)
 
DynamicSparsityPatternoperator= (const DynamicSparsityPattern &)
 
void reinit (const size_type m, const size_type n, const IndexSet &rowset=IndexSet())
 
void compress ()
 
bool empty () const
 
size_type max_entries_per_row () const
 
void add (const size_type i, const size_type j)
 
template<typename ForwardIterator >
void add_entries (const size_type row, ForwardIterator begin, ForwardIterator end, const bool indices_are_unique_and_sorted=false)
 
bool exists (const size_type i, const size_type j) const
 
DynamicSparsityPattern get_view (const IndexSet &rows) const
 
void symmetrize ()
 
template<typename SparsityPatternTypeLeft , typename SparsityPatternTypeRight >
void compute_mmult_pattern (const SparsityPatternTypeLeft &left, const SparsityPatternTypeRight &right)
 
template<typename SparsityPatternTypeLeft , typename SparsityPatternTypeRight >
void compute_Tmmult_pattern (const SparsityPatternTypeLeft &left, const SparsityPatternTypeRight &right)
 
void print (std::ostream &out) const
 
void print_gnuplot (std::ostream &out) const
 
size_type n_rows () const
 
size_type n_cols () const
 
size_type row_length (const size_type row) const
 
void clear_row (const size_type row)
 
size_type column_number (const size_type row, const size_type index) const
 
size_type column_index (const size_type row, const size_type col) 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)
 

Iterators

bool have_entries
 
size_type rows
 
size_type cols
 
IndexSet rowset
 
std::vector< Linelines
 
class DynamicSparsityPatternIterators::Accessor
 
iterator begin () const
 
iterator end () const
 
iterator begin (const size_type r) const
 
iterator end (const size_type r) const
 
size_type bandwidth () const
 
size_type n_nonzero_elements () const
 
const IndexSetrow_index_set () const
 
IndexSet nonempty_cols () const
 
IndexSet nonempty_rows () const
 
size_type memory_consumption () const
 
static bool stores_only_added_elements ()
 

Additional Inherited Members

- 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)
 

Detailed Description

This class acts as an intermediate form of the SparsityPattern class. From the interface it mostly represents a SparsityPattern object that is kept compressed at all times. However, since the final sparsity pattern is not known while constructing it, keeping the pattern compressed at all times can only be achieved at the expense of either increased memory or run time consumption upon use. The main purpose of this class is to avoid some memory bottlenecks, so we chose to implement it memory conservative. The chosen data format is too unsuited to be used for actual matrices, though. It is therefore necessary to first copy the data of this object over to an object of type SparsityPattern before using it in actual matrices.

Another viewpoint is that this class does not need up front allocation of a certain amount of memory, but grows as necessary. An extensive description of sparsity patterns can be found in the documentation of the Sparsity patterns module.

This class is an example of the "dynamic" type of Sparsity patterns. It is used in most tutorial programs in one way or another.

Interface

Since this class is intended as an intermediate replacement of the SparsityPattern class, it has mostly the same interface, with small changes where necessary. In particular, the add() function, and the functions inquiring properties of the sparsity pattern are the same.

Usage

Use this class as follows:

DynamicSparsityPattern dynamic_pattern (dof_handler.n_dofs());
dynamic_pattern);
constraints.condense (dynamic_pattern);
sp.copy_from (dynamic_pattern);
Author
Timo Heister, 2008

Definition at line 323 of file dynamic_sparsity_pattern.h.


The documentation for this class was generated from the following files:
DoFTools::make_sparsity_pattern
void make_sparsity_pattern(const DoFHandlerType &dof_handler, SparsityPatternType &sparsity_pattern, const AffineConstraints< number > &constraints=AffineConstraints< number >(), const bool keep_constrained_dofs=true, const types::subdomain_id subdomain_id=numbers::invalid_subdomain_id)
Definition: dof_tools_sparsity.cc:63
DynamicSparsityPattern
Definition: dynamic_sparsity_pattern.h:323
SparsityPattern
Definition: sparsity_pattern.h:865
SparsityPattern::copy_from
void copy_from(const size_type n_rows, const size_type n_cols, const ForwardIterator begin, const ForwardIterator end)
DoFHandler::n_dofs
types::global_dof_index n_dofs() const