Reference documentation for deal.II version 9.3.3
|
#include <deal.II/lac/dynamic_sparsity_pattern.h>
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) | |
DynamicSparsityPattern & | operator= (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 |
Iterators | |
bool | have_entries |
size_type | rows |
size_type | cols |
IndexSet | rowset |
std::vector< Line > | lines |
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 IndexSet & | row_index_set () const |
IndexSet | nonempty_cols () const |
IndexSet | nonempty_rows () const |
size_type | memory_consumption () const |
static bool | stores_only_added_elements () |
Subscriptor functionality | |
Classes derived from Subscriptor provide a facility to subscribe to this object. This is mostly used by the SmartPointer class. | |
std::atomic< unsigned int > | counter |
std::map< std::string, unsigned int > | counter_map |
std::vector< std::atomic< bool > * > | validity_pointers |
const std::type_info * | object_info |
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) |
static ::ExceptionBase & | ExcInUse (int arg1, std::string arg2, std::string arg3) |
static ::ExceptionBase & | ExcNoSubscriber (std::string arg1, std::string arg2) |
using | map_value_type = decltype(counter_map)::value_type |
using | map_iterator = decltype(counter_map)::iterator |
static std::mutex | mutex |
void | check_no_subscribers () const noexcept |
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 module.
This class is an example of the "dynamic" type of Sparsity. It is used in most tutorial programs in one way or another.
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 of this class is explained in step-2 (without constraints) and step-6 (with AffineConstraints) and typically looks as follows:
Definition at line 318 of file dynamic_sparsity_pattern.h.