Reference documentation for deal.II version 8.4.1
Public Member Functions | Public Attributes | List of all members
BlockLinearOperator< Range, Domain > Class Template Reference

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

Inheritance diagram for BlockLinearOperator< Range, Domain >:
[legend]

Public Member Functions

 BlockLinearOperator ()
 
 BlockLinearOperator (const BlockLinearOperator< Range, Domain > &)=default
 
template<typename Op >
 BlockLinearOperator (const Op &op)
 
template<size_t m, size_t n>
 BlockLinearOperator (const std::array< std::array< BlockType, n >, m > &ops)
 
template<size_t m>
 BlockLinearOperator (const std::array< BlockType, m > &ops)
 
BlockLinearOperator< Range, Domain > & operator= (const BlockLinearOperator< Range, Domain > &)=default
 
template<typename Op >
BlockLinearOperator< Range, Domain > & operator= (const Op &op)
 
template<size_t m, size_t n>
BlockLinearOperator< Range, Domain > & operator= (const std::array< std::array< BlockType, n >, m > &ops)
 
template<size_t m>
BlockLinearOperator< Range, Domain > & operator= (const std::array< BlockType, m > &ops)
 
- Public Member Functions inherited from LinearOperator< Range, Domain >
 LinearOperator ()
 
 LinearOperator (const LinearOperator< Range, Domain > &)=default
 
template<typename Op , typename = typename std::enable_if<!std::is_base_of<LinearOperator<Range, Domain>, Op>::value>::type>
 LinearOperator (const Op &op)
 
LinearOperator< Range, Domain > & operator= (const LinearOperator< Range, Domain > &)=default
 
template<typename Op , typename = typename std::enable_if<!std::is_base_of<LinearOperator<Range, Domain>, Op>::value>::type>
LinearOperator< Range, Domain > & operator= (const Op &op)
 
LinearOperator< Range, Domain > & operator+= (const LinearOperator< Range, Domain > &second_op)
 
LinearOperator< Range, Domain > & operator-= (const LinearOperator< Range, Domain > &second_op)
 
LinearOperator< Range, Domain > & operator*= (const LinearOperator< Domain, Domain > &second_op)
 
LinearOperator< Range, Domain > operator*= (typename Domain::value_type number)
 

Public Attributes

std::function< unsigned int()> n_block_rows
 
std::function< unsigned int()> n_block_cols
 
std::function< BlockType(unsigned int, unsigned int)> block
 
- Public Attributes inherited from LinearOperator< Range, Domain >
std::function< void(Range &v, const Domain &u)> vmult
 
std::function< void(Range &v, const Domain &u)> vmult_add
 
std::function< void(Domain &v, const Range &u)> Tvmult
 
std::function< void(Domain &v, const Range &u)> Tvmult_add
 
std::function< void(Range &v, bool omit_zeroing_entries)> reinit_range_vector
 
std::function< void(Domain &v, bool omit_zeroing_entries)> reinit_domain_vector
 
bool is_null_operator
 

Related Functions

(Note that these are not member functions.)

Creation of a BlockLinearOperator
template<typename Range , typename Domain , typename BlockMatrixType >
BlockLinearOperator< Range, Domain > block_operator (const BlockMatrixType &block_matrix)
 
template<size_t m, size_t n, typename Range , typename Domain >
BlockLinearOperator< Range, Domain > block_operator (const std::array< std::array< LinearOperator< typename Range::BlockType, typename Domain::BlockType >, n >, m > &ops)
 
template<typename Range , typename Domain , typename BlockMatrixType >
BlockLinearOperator< Range, Domain > block_diagonal_operator (const BlockMatrixType &block_matrix)
 
template<size_t m, typename Range , typename Domain >
BlockLinearOperator< Range, Domain > block_diagonal_operator (const std::array< LinearOperator< typename Range::BlockType, typename Domain::BlockType >, m > &ops)
 
template<size_t m, typename Range , typename Domain >
BlockLinearOperator< Range, Domain > block_diagonal_operator (const LinearOperator< typename Range::BlockType, typename Domain::BlockType > &op)
 
Manipulation of a BlockLinearOperator
template<typename Range , typename Domain >
LinearOperator< Domain, Range > block_forward_substitution (const BlockLinearOperator< Range, Domain > &block_operator, const BlockLinearOperator< Domain, Range > &diagonal_inverse)
 
template<typename Range , typename Domain >
LinearOperator< Domain, Range > block_back_substitution (const BlockLinearOperator< Range, Domain > &block_operator, const BlockLinearOperator< Domain, Range > &diagonal_inverse)
 

Detailed Description

template<typename Range, typename Domain>
class BlockLinearOperator< Range, Domain >

A class to store the concept of a block linear operator.

This class increases the interface of LinearOperator (which encapsulates the Matrix interface) by three additional functions:

std::function<unsigned int()> n_block_rows;
std::function<unsigned int()> n_block_cols;
std::function<BlockType(unsigned int, unsigned int)> block;

that describe the underlying block structure (of an otherwise opaque) linear operator.

Objects of type BlockLinearOperator can be created similarly to LinearOperator with a wrapper function:

const auto block_op_a = block_operator(A);

A BlockLinearOperator can be sliced to a LinearOperator at any time. This removes all information about the underlying block structure (beacuse above std::function objects are no longer available) - the linear operator interface, however, remains intact.

Note
This class makes heavy use of std::function objects and lambda functions. This flexibiliy comes with a run-time penalty. Only use this object to encapsulate object with medium to large individual block sizes, and small block structure (as a rule of thumb, matrix blocks greater than \(1000\times1000\)).
This class is only available if deal.II was configured with C++11 support, i.e., if DEAL_II_WITH_CXX11 is enabled during cmake configure.
Author
Matthias Maier, 2015

Definition at line 34 of file block_linear_operator.h.

Constructor & Destructor Documentation

template<typename Range, typename Domain>
BlockLinearOperator< Range, Domain >::BlockLinearOperator ( )
inline

Create an empty BlockLinearOperator object.

Allstd::function member objects of this class and its base class LinearOperator are initialized with default variants that throw an exception upon invocation.

Definition at line 142 of file block_linear_operator.h.

template<typename Range, typename Domain>
BlockLinearOperator< Range, Domain >::BlockLinearOperator ( const BlockLinearOperator< Range, Domain > &  )
default

Default copy constructor.

template<typename Range, typename Domain>
template<typename Op >
BlockLinearOperator< Range, Domain >::BlockLinearOperator ( const Op &  op)
inline

Templated copy constructor that creates a BlockLinearOperator object from an object op for which the conversion function block_operator is defined.

Definition at line 177 of file block_linear_operator.h.

template<typename Range, typename Domain>
template<size_t m, size_t n>
BlockLinearOperator< Range, Domain >::BlockLinearOperator ( const std::array< std::array< BlockType, n >, m > &  ops)
inline

Create a BlockLinearOperator from a two-dimensional array ops of LinearOperator. This constructor calls the corresponding block_operator() specialization.

Definition at line 188 of file block_linear_operator.h.

template<typename Range, typename Domain>
template<size_t m>
BlockLinearOperator< Range, Domain >::BlockLinearOperator ( const std::array< BlockType, m > &  ops)
inline

Create a block-diagonal BlockLinearOperator from a one-dimensional array ops of LinearOperator. This constructor calls the corresponding block_operator() specialization.

Definition at line 199 of file block_linear_operator.h.

Member Function Documentation

template<typename Range, typename Domain>
BlockLinearOperator<Range, Domain>& BlockLinearOperator< Range, Domain >::operator= ( const BlockLinearOperator< Range, Domain > &  )
default

Default copy assignment operator.

template<typename Range, typename Domain>
template<typename Op >
BlockLinearOperator<Range, Domain>& BlockLinearOperator< Range, Domain >::operator= ( const Op &  op)
inline

Templated copy assignment operator for an object op for which the conversion function block_operator is defined.

Definition at line 215 of file block_linear_operator.h.

template<typename Range, typename Domain>
template<size_t m, size_t n>
BlockLinearOperator<Range, Domain>& BlockLinearOperator< Range, Domain >::operator= ( const std::array< std::array< BlockType, n >, m > &  ops)
inline

Copy assignment from a two-dimensional array ops of LinearOperator. This assignment operator calls the corresponding block_operator() specialization.

Definition at line 228 of file block_linear_operator.h.

template<typename Range, typename Domain>
template<size_t m>
BlockLinearOperator<Range, Domain>& BlockLinearOperator< Range, Domain >::operator= ( const std::array< BlockType, m > &  ops)
inline

Copy assignment from a one-dimensional array ops of LinearOperator that creates a block-diagonal BlockLinearOperator. This assignment operator calls the corresponding block_operator() specialization.

Definition at line 241 of file block_linear_operator.h.

Member Data Documentation

template<typename Range, typename Domain>
std::function<unsigned int()> BlockLinearOperator< Range, Domain >::n_block_rows

Return the number of blocks in a column (i.e, the number of "block rows", or the number \(m\), if interpreted as a \(m\times n\) block system).

Definition at line 251 of file block_linear_operator.h.

template<typename Range, typename Domain>
std::function<unsigned int()> BlockLinearOperator< Range, Domain >::n_block_cols

Return the number of blocks in a row (i.e, the number of "block columns", or the number \(n\), if interpreted as a \(m\times n\) block system).

Definition at line 257 of file block_linear_operator.h.

template<typename Range, typename Domain>
std::function<BlockType(unsigned int, unsigned int)> BlockLinearOperator< Range, Domain >::block

Access the block with the given coordinates. This std::function object returns a LinearOperator representing the \((i,j)\)-th block of the BlockLinearOperator.

Definition at line 264 of file block_linear_operator.h.


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