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

Abstract view of a block operator. More...

#include <BlockOperatorView.hpp>

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

Public Types

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

Constructors/destructors
virtual ~BlockOperatorView () override=default
 Destructor.
 
BlockOperatorViewoperator= (BlockOperatorView const &)=delete
 Deleted copy assignment. More...
 
BlockOperatorViewoperator= (BlockOperatorView &&)=delete
 Deleted move assignment. More...
 
LinearOperator interface
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...
 
Getters
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...
 

Protected Member Functions

 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::BlockOperatorView< VECTOR, OPERATOR >

Abstract view 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 class does not deal with constructing or storing sub-blocks, only provides high-level access functions. See derived classes BlockOperator and BlockOperatorWrapper for ways to construct a block operator.

Definition at line 39 of file BlockOperatorView.hpp.

Constructor & Destructor Documentation

◆ BlockOperatorView() [1/3]

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

Create an operator with given number of block rows and columns.

Parameters
nRowsnumber of block rows
nColsnumber of block columns

Definition at line 254 of file BlockOperatorView.hpp.

◆ BlockOperatorView() [2/3]

template<typename VECTOR, typename OPERATOR = LinearOperator< VECTOR >>
geosx::BlockOperatorView< VECTOR, OPERATOR >::BlockOperatorView ( BlockOperatorView< VECTOR, OPERATOR > const &  x)
protecteddefault

Copy constructor.

Parameters
xthe block vector to copy

◆ BlockOperatorView() [3/3]

template<typename VECTOR, typename OPERATOR = LinearOperator< VECTOR >>
geosx::BlockOperatorView< VECTOR, OPERATOR >::BlockOperatorView ( BlockOperatorView< VECTOR, OPERATOR > &&  x)
protecteddefault

Move constructor.

Parameters
xthe block vector to move from

Member Function Documentation

◆ apply()

template<typename VECTOR, typename OPERATOR = LinearOperator< VECTOR >>
virtual void geosx::BlockOperatorView< VECTOR, OPERATOR >::apply ( Vector const &  src,
Vector dst 
) const
inlineoverridevirtual

Apply operator to a vector.

Parameters
srcInput vector (x).
dstOutput vector (b).
Warning
src and dst cannot alias the same vector (some implementations may allow this).

Definition at line 94 of file BlockOperatorView.hpp.

◆ applyTranspose()

template<typename VECTOR, typename OPERATOR = LinearOperator< VECTOR >>
template<typename OP = OPERATOR>
std::enable_if_t< HasMemberFunction_applyTranspose< OP > > geosx::BlockOperatorView< VECTOR, OPERATOR >::applyTranspose ( BlockVectorView< VECTOR > const &  src,
BlockVectorView< VECTOR > &  dst 
) const
inline

Apply the transpose of block operator to a block vector.

Template Parameters
OPdummy template parameter to enable SFINAE, do not provide
Parameters
srcsource vector (rhs)
dsttarget vector (lhs)
Returns
nothing
Note
This method only exists if the underlying operator type has it.

Definition at line 123 of file BlockOperatorView.hpp.

◆ block() [1/2]

template<typename VECTOR, typename OPERATOR = LinearOperator< VECTOR >>
OPERATOR const& geosx::BlockOperatorView< VECTOR, OPERATOR >::block ( localIndex const  blockRowIndex,
localIndex const  blockColIndex 
) const
inline

Get the operator corresponding to a sub-block.

Parameters
blockRowIndexblock row index
blockColIndexblock column index
Returns
a reference to the sub-block

Definition at line 214 of file BlockOperatorView.hpp.

◆ block() [2/2]

template<typename VECTOR, typename OPERATOR = LinearOperator< VECTOR >>
OPERATOR& geosx::BlockOperatorView< VECTOR, OPERATOR >::block ( localIndex const  blockRowIndex,
localIndex const  blockColIndex 
)
inline

Get the operator corresponding to a sub-block.

Parameters
blockRowIndexblock row index
blockColIndexblock column index
Returns
a reference to the sub-block

Definition at line 223 of file BlockOperatorView.hpp.

◆ numBlockCols()

template<typename VECTOR, typename OPERATOR = LinearOperator< VECTOR >>
localIndex geosx::BlockOperatorView< VECTOR, OPERATOR >::numBlockCols ( ) const
inline

Get number of block columns.

Returns
number of block columns

Definition at line 203 of file BlockOperatorView.hpp.

◆ numBlockRows()

template<typename VECTOR, typename OPERATOR = LinearOperator< VECTOR >>
localIndex geosx::BlockOperatorView< VECTOR, OPERATOR >::numBlockRows ( ) const
inline

Get number of block rows.

Returns
number of block rows

Definition at line 194 of file BlockOperatorView.hpp.

◆ numGlobalCols()

template<typename VECTOR, typename OPERATOR = LinearOperator< VECTOR >>
virtual globalIndex geosx::BlockOperatorView< VECTOR, OPERATOR >::numGlobalCols ( ) const
inlineoverridevirtual

Get the number of global columns.

Returns
Number of global columns in the operator.

Implements geosx::LinearOperator< BlockVectorView< VECTOR > >.

Definition at line 154 of file BlockOperatorView.hpp.

◆ numGlobalRows()

template<typename VECTOR, typename OPERATOR = LinearOperator< VECTOR >>
virtual globalIndex geosx::BlockOperatorView< VECTOR, OPERATOR >::numGlobalRows ( ) const
inlineoverridevirtual

Get the number of global rows.

Returns
Number of global rows in the operator.

Implements geosx::LinearOperator< BlockVectorView< VECTOR > >.

Definition at line 145 of file BlockOperatorView.hpp.

◆ numLocalCols()

template<typename VECTOR, typename OPERATOR = LinearOperator< VECTOR >>
template<typename OP = OPERATOR>
std::enable_if_t< HasMemberFunction_numLocalCols< OP >, localIndex > geosx::BlockOperatorView< VECTOR, OPERATOR >::numLocalCols ( ) const
inline

Get the number of local columns.

Returns
Number of local columns in the operator.
Note
Method only exists if the underlying operator type has it.

Definition at line 178 of file BlockOperatorView.hpp.

◆ numLocalRows()

template<typename VECTOR, typename OPERATOR = LinearOperator< VECTOR >>
template<typename OP = OPERATOR>
std::enable_if_t< HasMemberFunction_numLocalRows< OP >, localIndex > geosx::BlockOperatorView< VECTOR, OPERATOR >::numLocalRows ( ) const
inline

Get the number of local rows.

Returns
Number of local rows in the operator.
Note
Method only exists if the underlying operator type has it.

Definition at line 166 of file BlockOperatorView.hpp.

◆ operator()() [1/2]

template<typename VECTOR, typename OPERATOR = LinearOperator< VECTOR >>
OPERATOR const& geosx::BlockOperatorView< VECTOR, OPERATOR >::operator() ( localIndex const  blockRowIndex,
localIndex const  blockColIndex = 0 
) const
inline

Get the operator corresponding to a sub-block.

Parameters
blockRowIndexblock row index
blockColIndexblock column index
Returns
a reference to the sub-block

Definition at line 232 of file BlockOperatorView.hpp.

◆ operator()() [2/2]

template<typename VECTOR, typename OPERATOR = LinearOperator< VECTOR >>
OPERATOR& geosx::BlockOperatorView< VECTOR, OPERATOR >::operator() ( localIndex const  blockRowIndex,
localIndex const  blockColIndex = 0 
)
inline

Get the operator corresponding to a sub-block.

Parameters
blockRowIndexblock row index
blockColIndexblock column index
Returns
a reference to the sub-block

Definition at line 240 of file BlockOperatorView.hpp.

◆ operator=() [1/2]

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

Deleted copy assignment.

Returns
not callable

◆ operator=() [2/2]

template<typename VECTOR, typename OPERATOR = LinearOperator< VECTOR >>
BlockOperatorView& geosx::BlockOperatorView< VECTOR, OPERATOR >::operator= ( BlockOperatorView< VECTOR, OPERATOR > &&  )
delete

Deleted move assignment.

Returns
not callable

◆ setPointer()

template<typename VECTOR, typename OPERATOR = LinearOperator< VECTOR >>
void geosx::BlockOperatorView< VECTOR, OPERATOR >::setPointer ( localIndex const  blockRowIndex,
localIndex const  blockColIndex,
OPERATOR *  op 
)
inlineprotected

Set/replace a pointer to a block.

Parameters
blockRowIndexrow index of the block
blockColIndexcolumn index of the block
opthe new pointer

Definition at line 279 of file BlockOperatorView.hpp.


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