Reference documentation for deal.II version Git e8a02dd 2017-08-23 11:09:52 +0200
Public Member Functions | Public Attributes | List of all members
BlockLinearOperator< Range, Domain, BlockPayload > Class Template Reference

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

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

Public Member Functions

 BlockLinearOperator (const BlockPayload &payload)
 
 BlockLinearOperator (const BlockLinearOperator< Range, Domain, BlockPayload > &)=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, BlockPayload > & operator= (const BlockLinearOperator< Range, Domain, BlockPayload > &)=default
 
template<typename Op >
BlockLinearOperator< Range, Domain, BlockPayload > & operator= (const Op &op)
 
template<size_t m, size_t n>
BlockLinearOperator< Range, Domain, BlockPayload > & operator= (const std::array< std::array< BlockType, n >, m > &ops)
 
template<size_t m>
BlockLinearOperator< Range, Domain, BlockPayload > & operator= (const std::array< BlockType, m > &ops)
 
- Public Member Functions inherited from LinearOperator< Range, Domain, BlockPayload::BlockType >
 LinearOperator (const BlockPayload::BlockType &payload=BlockPayload::BlockType())
 
 LinearOperator (const LinearOperator< Range, Domain, BlockPayload::BlockType > &)=default
 
 LinearOperator (const Op &op)
 
LinearOperator< Range, Domain, BlockPayload::BlockType > & operator= (const LinearOperator< Range, Domain, BlockPayload::BlockType > &)=default
 
LinearOperator< Range, Domain, BlockPayload::BlockType > & operator= (const Op &op)
 
LinearOperator< Range, Domain, BlockPayload::BlockType > & operator+= (const LinearOperator< Range, Domain, BlockPayload::BlockType > &second_op)
 
LinearOperator< Range, Domain, BlockPayload::BlockType > & operator-= (const LinearOperator< Range, Domain, BlockPayload::BlockType > &second_op)
 
LinearOperator< Range, Domain, BlockPayload::BlockType > & operator*= (const LinearOperator< Domain, Domain, BlockPayload::BlockType > &second_op)
 
LinearOperator< Range, Domain, BlockPayload::BlockType > 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, BlockPayload::BlockType >
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 BlockPayload , typename BlockMatrixType >
BlockLinearOperator< Range, Domain, BlockPayload > block_operator (const BlockMatrixType &block_matrix)
 
template<size_t m, size_t n, typename Range , typename Domain , typename BlockPayload >
BlockLinearOperator< Range, Domain, BlockPayload > block_operator (const std::array< std::array< LinearOperator< typename Range::BlockType, typename Domain::BlockType, typename BlockPayload::BlockType >, n >, m > &ops)
 
template<typename Range , typename Domain , typename BlockPayload , typename BlockMatrixType >
BlockLinearOperator< Range, Domain, BlockPayload > block_diagonal_operator (const BlockMatrixType &block_matrix)
 
template<size_t m, typename Range , typename Domain , typename BlockPayload >
BlockLinearOperator< Range, Domain, BlockPayload > block_diagonal_operator (const std::array< LinearOperator< typename Range::BlockType, typename Domain::BlockType, typename BlockPayload::BlockType >, m > &ops)
 
template<size_t m, typename Range , typename Domain , typename BlockPayload >
BlockLinearOperator< Range, Domain, BlockPayload > block_diagonal_operator (const LinearOperator< typename Range::BlockType, typename Domain::BlockType, typename BlockPayload::BlockType > &op)
 
Manipulation of a BlockLinearOperator
template<typename Range , typename Domain , typename BlockPayload >
LinearOperator< Domain, Range, typename BlockPayload::BlockType > block_forward_substitution (const BlockLinearOperator< Range, Domain, BlockPayload > &block_operator, const BlockLinearOperator< Domain, Range, BlockPayload > &diagonal_inverse)
 
template<typename Range , typename Domain , typename BlockPayload >
LinearOperator< Domain, Range, typename BlockPayload::BlockType > block_back_substitution (const BlockLinearOperator< Range, Domain, BlockPayload > &block_operator, const BlockLinearOperator< Domain, Range, BlockPayload > &diagonal_inverse)
 
Creation of a BlockLinearOperator
template<typename Range , typename Domain = Range>
BlockLinearOperator< Range, Domain, TrilinosWrappers::internal::BlockLinearOperator::TrilinosBlockPayload< TrilinosWrappers::internal::LinearOperator::TrilinosPayload > > block_operator (const TrilinosWrappers::BlockSparseMatrix &block_matrix)
 
template<size_t m, size_t n, typename Range , typename Domain = Range>
BlockLinearOperator< Range, Domain, TrilinosWrappers::internal::BlockLinearOperator::TrilinosBlockPayload< TrilinosWrappers::internal::LinearOperator::TrilinosPayload > > block_operator (const std::array< std::array< LinearOperator< typename Range::BlockType, typename Domain::BlockType, TrilinosWrappers::internal::LinearOperator::TrilinosPayload >, n >, m > &ops)
 
template<typename Range , typename Domain = Range>
BlockLinearOperator< Range, Domain, TrilinosWrappers::internal::BlockLinearOperator::TrilinosBlockPayload< TrilinosWrappers::internal::LinearOperator::TrilinosPayload > > block_diagonal_operator (const TrilinosWrappers::BlockSparseMatrix &block_matrix)
 
template<size_t m, typename Range , typename Domain = Range>
BlockLinearOperator< Range, Domain, TrilinosWrappers::internal::BlockLinearOperator::TrilinosBlockPayload< TrilinosWrappers::internal::LinearOperator::TrilinosPayload > > block_diagonal_operator (const std::array< LinearOperator< typename Range::BlockType, typename Domain::BlockType, TrilinosWrappers::internal::LinearOperator::TrilinosPayload >, m > &ops)
 

Detailed Description

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

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\)).
Author
Matthias Maier, 2015

Definition at line 43 of file block_linear_operator.h.

Constructor & Destructor Documentation

template<typename Range, typename Domain, typename BlockPayload>
BlockLinearOperator< Range, Domain, BlockPayload >::BlockLinearOperator ( const BlockPayload &  payload)
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 154 of file block_linear_operator.h.

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

Default copy constructor.

template<typename Range, typename Domain, typename BlockPayload>
template<typename Op >
BlockLinearOperator< Range, Domain, BlockPayload >::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 188 of file block_linear_operator.h.

template<typename Range, typename Domain, typename BlockPayload>
template<size_t m, size_t n>
BlockLinearOperator< Range, Domain, BlockPayload >::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 199 of file block_linear_operator.h.

template<typename Range, typename Domain, typename BlockPayload>
template<size_t m>
BlockLinearOperator< Range, Domain, BlockPayload >::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 210 of file block_linear_operator.h.

Member Function Documentation

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

Default copy assignment operator.

template<typename Range, typename Domain, typename BlockPayload>
template<typename Op >
BlockLinearOperator<Range, Domain, BlockPayload>& BlockLinearOperator< Range, Domain, BlockPayload >::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 226 of file block_linear_operator.h.

template<typename Range, typename Domain, typename BlockPayload>
template<size_t m, size_t n>
BlockLinearOperator<Range, Domain, BlockPayload>& BlockLinearOperator< Range, Domain, BlockPayload >::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 239 of file block_linear_operator.h.

template<typename Range, typename Domain, typename BlockPayload>
template<size_t m>
BlockLinearOperator<Range, Domain, BlockPayload>& BlockLinearOperator< Range, Domain, BlockPayload >::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 252 of file block_linear_operator.h.

Member Data Documentation

template<typename Range, typename Domain, typename BlockPayload>
std::function<unsigned int()> BlockLinearOperator< Range, Domain, BlockPayload >::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 262 of file block_linear_operator.h.

template<typename Range, typename Domain, typename BlockPayload>
std::function<unsigned int()> BlockLinearOperator< Range, Domain, BlockPayload >::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 268 of file block_linear_operator.h.

template<typename Range, typename Domain, typename BlockPayload>
std::function<BlockType(unsigned int, unsigned int)> BlockLinearOperator< Range, Domain, BlockPayload >::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 275 of file block_linear_operator.h.


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