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

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

Inheritance diagram for TrilinosWrappers::BlockSparsityPattern:
[legend]

Public Member Functions

 BlockSparsityPattern ()=default
 
 BlockSparsityPattern (const size_type n_rows, const size_type n_columns)
 
 BlockSparsityPattern (const std::vector< size_type > &row_block_sizes, const std::vector< size_type > &col_block_sizes)
 
 BlockSparsityPattern (const std::vector< Epetra_Map > &parallel_partitioning)
 
 BlockSparsityPattern (const std::vector< IndexSet > &parallel_partitioning, const MPI_Comm &communicator=MPI_COMM_WORLD)
 
 BlockSparsityPattern (const std::vector< IndexSet > &row_parallel_partitioning, const std::vector< IndexSet > &column_parallel_partitioning, const std::vector< IndexSet > &writeable_rows, const MPI_Comm &communicator=MPI_COMM_WORLD)
 
void reinit (const std::vector< size_type > &row_block_sizes, const std::vector< size_type > &col_block_sizes)
 
void reinit (const std::vector< Epetra_Map > &parallel_partitioning)
 
void reinit (const std::vector< IndexSet > &parallel_partitioning, const MPI_Comm &communicator=MPI_COMM_WORLD)
 
void reinit (const std::vector< IndexSet > &row_parallel_partitioning, const std::vector< IndexSet > &column_parallel_partitioning, const MPI_Comm &communicator=MPI_COMM_WORLD)
 
void reinit (const std::vector< IndexSet > &row_parallel_partitioning, const std::vector< IndexSet > &column_parallel_partitioning, const std::vector< IndexSet > &writeable_rows, const MPI_Comm &communicator=MPI_COMM_WORLD)
 
- 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 Trilinos sparsity patterns that can be used to initialize Trilinos block sparse matrices that can be distributed among different processors. It is used in the same way as the BlockSparsityPattern except that it builds upon the TrilinosWrappers::SparsityPattern instead of the SparsityPattern.

This class is has properties of the "dynamic" type of Sparsity patterns (in the sense that it can extend the memory if too little elements were allocated), but otherwise is more like the basic deal.II SparsityPattern (in the sense that the method compress() needs to be called before the pattern can be used).

This class is used in step-32.

Author
Martin Kronbichler, 2008, 2009

Definition at line 626 of file block_sparsity_pattern.h.

Constructor & Destructor Documentation

◆ BlockSparsityPattern() [1/6]

TrilinosWrappers::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/6]

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 509 of file block_sparsity_pattern.cc.

◆ BlockSparsityPattern() [3/6]

BlockSparsityPattern::BlockSparsityPattern ( const std::vector< size_type > &  row_block_sizes,
const std::vector< size_type > &  col_block_sizes 
)

Initialize the pattern with two BlockIndices for the block structures of matrix rows and columns. This function is equivalent to calling the previous constructor with the length of the two index vector and then entering the index values.

Definition at line 516 of file block_sparsity_pattern.cc.

◆ BlockSparsityPattern() [4/6]

BlockSparsityPattern::BlockSparsityPattern ( const std::vector< Epetra_Map > &  parallel_partitioning)

Initialize the pattern with an array Epetra_Map that specifies both rows and columns of the matrix (so the final matrix will be a square matrix), where the Epetra_Map specifies the parallel distribution of the degrees of freedom on the individual block. This function is equivalent to calling the second constructor with the length of the mapping vector and then entering the index values.

Deprecated:
Use the respective method with IndexSet arguments instead.

Definition at line 530 of file block_sparsity_pattern.cc.

◆ BlockSparsityPattern() [5/6]

BlockSparsityPattern::BlockSparsityPattern ( const std::vector< IndexSet > &  parallel_partitioning,
const MPI_Comm &  communicator = MPI_COMM_WORLD 
)

Initialize the pattern with an array of index sets that specifies both rows and columns of the matrix (so the final matrix will be a square matrix), where the size() of the IndexSets specifies the size of the blocks and the values in each IndexSet denotes the rows that are going to be saved in each block.

Definition at line 544 of file block_sparsity_pattern.cc.

◆ BlockSparsityPattern() [6/6]

BlockSparsityPattern::BlockSparsityPattern ( const std::vector< IndexSet > &  row_parallel_partitioning,
const std::vector< IndexSet > &  column_parallel_partitioning,
const std::vector< IndexSet > &  writeable_rows,
const MPI_Comm &  communicator = MPI_COMM_WORLD 
)

Initialize the pattern with two arrays of index sets that specify rows and columns of the matrix, where the size() of the IndexSets specifies the size of the blocks and the values in each IndexSet denotes the rows that are going to be saved in each block. The additional index set writable_rows is used to set all rows that we allow to write locally. This constructor is used to create matrices that allow several threads to write simultaneously into the matrix (to different rows, of course), see the method TrilinosWrappers::SparsityPattern::reinit method with three index set arguments for more details.

Definition at line 560 of file block_sparsity_pattern.cc.

Member Function Documentation

◆ reinit() [1/5]

void BlockSparsityPattern::reinit ( const std::vector< size_type > &  row_block_sizes,
const std::vector< size_type > &  col_block_sizes 
)

Resize the matrix to a tensor product of matrices with dimensions defined by the arguments.

The matrix will have as many block rows and columns as there are entries in the two arguments. The block at position (i,j) will have the dimensions row_block_sizes[i] times col_block_sizes[j].

Definition at line 581 of file block_sparsity_pattern.cc.

◆ reinit() [2/5]

void BlockSparsityPattern::reinit ( const std::vector< Epetra_Map > &  parallel_partitioning)

Resize the matrix to a square tensor product of matrices with parallel distribution according to the specifications in the array of Epetra_Maps.

Deprecated:
Use the respective method with IndexSet arguments instead.

Definition at line 595 of file block_sparsity_pattern.cc.

◆ reinit() [3/5]

void BlockSparsityPattern::reinit ( const std::vector< IndexSet > &  parallel_partitioning,
const MPI_Comm &  communicator = MPI_COMM_WORLD 
)

Resize the matrix to a square tensor product of matrices. See the constructor that takes a vector of IndexSets for details.

Definition at line 610 of file block_sparsity_pattern.cc.

◆ reinit() [4/5]

void BlockSparsityPattern::reinit ( const std::vector< IndexSet > &  row_parallel_partitioning,
const std::vector< IndexSet > &  column_parallel_partitioning,
const MPI_Comm &  communicator = MPI_COMM_WORLD 
)

Resize the matrix to a rectangular block matrices. This method allows rows and columns to be different, both in the outer block structure and within the blocks.

Definition at line 627 of file block_sparsity_pattern.cc.

◆ reinit() [5/5]

void BlockSparsityPattern::reinit ( const std::vector< IndexSet > &  row_parallel_partitioning,
const std::vector< IndexSet > &  column_parallel_partitioning,
const std::vector< IndexSet > &  writeable_rows,
const MPI_Comm &  communicator = MPI_COMM_WORLD 
)

Resize the matrix to a rectangular block matrices that furthermore explicitly specify the writable rows in each of the blocks. This method is used to create matrices that allow several threads to write simultaneously into the matrix (to different rows, of course), see the method TrilinosWrappers::SparsityPattern::reinit method with three index set arguments for more details.

Definition at line 645 of file block_sparsity_pattern.cc.


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