GEOSX
Public Types | Public Member Functions | List of all members
geosx::BlockOperatorWrapper< VECTOR, OPERATOR > Class Template Reference

"Shallow" representation of a block operator. More...

#include <BlockOperatorWrapper.hpp>

Inheritance diagram for geosx::BlockOperatorWrapper< VECTOR, OPERATOR >:
Inheritance graph
[legend]

Public Types

using Base = BlockOperatorView< VECTOR, OPERATOR >
 Alias for base type.
 
using Vector = typename Base::Vector
 Alias for vector type.
 
- Public Types inherited from geosx::BlockOperatorView< VECTOR, OPERATOR >
using Base = LinearOperator< BlockVectorView< VECTOR > >
 Alias for base type.
 
using Vector = typename Base::Vector
 Alias for vector type.
 
- Public Types inherited from geosx::LinearOperator< BlockVectorView< VECTOR > >
using Vector = BlockVectorView< VECTOR >
 Alias for template parameter.
 

Public Member Functions

 BlockOperatorWrapper (localIndex const nRows, localIndex const nCols)
 Create a vector wrapper of nBlocks blocks. More...
 
 BlockOperatorWrapper (BlockOperatorWrapper const &rhs)=delete
 Deleted copy constructor. More...
 
 BlockOperatorWrapper (BlockOperatorWrapper &&rhs)=delete
 Deleted move constructor. More...
 
virtual ~BlockOperatorWrapper () override=default
 Destructor.
 
void set (localIndex const blockRowIndex, localIndex const blockColIndex, OPERATOR &op)
 Set a single block of the operator. More...
 
- Public Member Functions inherited from geosx::BlockOperatorView< VECTOR, OPERATOR >
virtual ~BlockOperatorView () override=default
 Destructor.
 
BlockOperatorViewoperator= (BlockOperatorView const &)=delete
 Deleted copy assignment. More...
 
BlockOperatorViewoperator= (BlockOperatorView &&)=delete
 Deleted move assignment. More...
 
virtual void apply (Vector const &src, Vector &dst) const override
 Apply operator to a vector. More...
 
template<typename OP = OPERATOR>
std::enable_if_t< HasMemberFunction_applyTranspose< OP > > applyTranspose (BlockVectorView< VECTOR > const &src, BlockVectorView< VECTOR > &dst) const
 Apply the transpose of block operator to a block vector. More...
 
virtual globalIndex numGlobalRows () const override
 Get the number of global rows. More...
 
virtual globalIndex numGlobalCols () const override
 Get the number of global columns. More...
 
template<typename OP = OPERATOR>
std::enable_if_t< HasMemberFunction_numLocalRows< OP >, localIndexnumLocalRows () const
 Get the number of local rows. More...
 
template<typename OP = OPERATOR>
std::enable_if_t< HasMemberFunction_numLocalCols< OP >, localIndexnumLocalCols () const
 Get the number of local columns. More...
 
localIndex numBlockRows () const
 Get number of block rows. More...
 
localIndex numBlockCols () const
 Get number of block columns. More...
 
OPERATOR const & block (localIndex const blockRowIndex, localIndex const blockColIndex) const
 Get the operator corresponding to a sub-block. More...
 
OPERATOR & block (localIndex const blockRowIndex, localIndex const blockColIndex)
 Get the operator corresponding to a sub-block. More...
 
OPERATOR const & operator() (localIndex const blockRowIndex, localIndex const blockColIndex=0) const
 Get the operator corresponding to a sub-block. More...
 
OPERATOR & operator() (localIndex const blockRowIndex, localIndex const blockColIndex=0)
 Get the operator corresponding to a sub-block. More...
 
- Public Member Functions inherited from geosx::LinearOperator< BlockVectorView< VECTOR > >
 LinearOperator ()=default
 Constructor.
 
virtual ~LinearOperator ()=default
 Destructor.
 
virtual void apply (Vector const &src, Vector &dst) const=0
 Apply operator to a vector. More...
 
virtual void residual (Vector const &x, Vector const &b, Vector &r) const
 Compute residual r = Ax - b. More...
 

Additional Inherited Members

- Protected Member Functions inherited from geosx::BlockOperatorView< VECTOR, OPERATOR >
 BlockOperatorView (localIndex const nRows, localIndex const nCols)
 Create an operator with given number of block rows and columns. More...
 
 BlockOperatorView (BlockOperatorView< VECTOR, OPERATOR > const &x)=default
 Copy constructor. More...
 
 BlockOperatorView (BlockOperatorView< VECTOR, OPERATOR > &&x)=default
 Move constructor. More...
 
void setPointer (localIndex const blockRowIndex, localIndex const blockColIndex, OPERATOR *op)
 Set/replace a pointer to a block. More...
 

Detailed Description

template<typename VECTOR, typename OPERATOR = LinearOperator< VECTOR >>
class geosx::BlockOperatorWrapper< VECTOR, OPERATOR >

"Shallow" representation of a block operator.

Template Parameters
VECTORtype of vector that sub-blocks of this view can operate on
OPERATORtype of operator that can operate on VECTOR (can be base class or a more specialized derived class)

This extends BlockOperatorView class by providing a way to assign sub-block pointers. The sub-blocks themselves must be stored elsewhere. Therefore, it's an easy way to assemble a block operator representation from pre-existing blocks.

Definition at line 39 of file BlockOperatorWrapper.hpp.

Constructor & Destructor Documentation

◆ BlockOperatorWrapper() [1/3]

template<typename VECTOR , typename OPERATOR = LinearOperator< VECTOR >>
geosx::BlockOperatorWrapper< VECTOR, OPERATOR >::BlockOperatorWrapper ( localIndex const  nRows,
localIndex const  nCols 
)
inlineexplicit

Create a vector wrapper of nBlocks blocks.

Parameters
nRowsnumber of block rows
nColsnumber of block columns

Definition at line 54 of file BlockOperatorWrapper.hpp.

◆ BlockOperatorWrapper() [2/3]

template<typename VECTOR , typename OPERATOR = LinearOperator< VECTOR >>
geosx::BlockOperatorWrapper< VECTOR, OPERATOR >::BlockOperatorWrapper ( BlockOperatorWrapper< VECTOR, OPERATOR > const &  rhs)
delete

Deleted copy constructor.

Parameters
rhsthe block operator to copy

◆ BlockOperatorWrapper() [3/3]

template<typename VECTOR , typename OPERATOR = LinearOperator< VECTOR >>
geosx::BlockOperatorWrapper< VECTOR, OPERATOR >::BlockOperatorWrapper ( BlockOperatorWrapper< VECTOR, OPERATOR > &&  rhs)
delete

Deleted move constructor.

Parameters
rhsthe block operator to move from

Member Function Documentation

◆ set()

template<typename VECTOR , typename OPERATOR = LinearOperator< VECTOR >>
void geosx::BlockOperatorWrapper< VECTOR, OPERATOR >::set ( localIndex const  blockRowIndex,
localIndex const  blockColIndex,
OPERATOR &  op 
)
inline

Set a single block of the operator.

Parameters
blockRowIndexblock row index
blockColIndexblock column index
opreference to the operator (which must not go out of scope before the block wrapper)

Definition at line 81 of file BlockOperatorWrapper.hpp.


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