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

Abstract view of a block operator. More...

#include <BlockOperatorView.hpp>

Inheritance diagram for geos::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 geos::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< traits::VectorBasedTraits< Vector >::template 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...
 
virtual localIndex numLocalRows () const override
 Get the number of local rows. More...
 
virtual localIndex numLocalCols () const override
 Get the number of local columns. More...
 
virtual MPI_Comm comm () const override
 Get the MPI communicator the matrix was created with. More...
 
Getters
localIndex numBlockRows () const
 Get number of block rows. More...
 
localIndex numBlockCols () const
 Get number of block columns. More...
 
const OPERATOR & 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...
 
const OPERATOR & 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 geos::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, dst = this(src). More...
 
virtual void residual (Vector const &x, Vector const &b, Vector &r) const
 Compute residual r = b - this(x). More...
 
virtual globalIndex numGlobalRows () const=0
 Get the number of global rows. More...
 
virtual globalIndex numGlobalCols () const=0
 Get the number of global columns. More...
 
virtual localIndex numLocalRows () const=0
 Get the number of local rows. More...
 
virtual localIndex numLocalCols () const=0
 Get the number of local columns. More...
 
virtual MPI_Comm comm () const=0
 Get the MPI communicator the matrix was created with. 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 geos::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 41 of file BlockOperatorView.hpp.

Constructor & Destructor Documentation

◆ BlockOperatorView() [1/3]

template<typename VECTOR , typename OPERATOR = LinearOperator< VECTOR >>
geos::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 256 of file BlockOperatorView.hpp.

◆ BlockOperatorView() [2/3]

template<typename VECTOR , typename OPERATOR = LinearOperator< VECTOR >>
geos::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 >>
geos::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 geos::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 88 of file BlockOperatorView.hpp.

◆ applyTranspose()

template<typename VECTOR , typename OPERATOR = LinearOperator< VECTOR >>
template<typename OP = OPERATOR>
std::enable_if_t< traits::VectorBasedTraits< Vector >::template HasMemberFunction_applyTranspose< OP > > geos::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 117 of file BlockOperatorView.hpp.

◆ block() [1/2]

template<typename VECTOR , typename OPERATOR = LinearOperator< VECTOR >>
OPERATOR& geos::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 225 of file BlockOperatorView.hpp.

◆ block() [2/2]

template<typename VECTOR , typename OPERATOR = LinearOperator< VECTOR >>
const OPERATOR& geos::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 216 of file BlockOperatorView.hpp.

◆ comm()

template<typename VECTOR , typename OPERATOR = LinearOperator< VECTOR >>
virtual MPI_Comm geos::BlockOperatorView< VECTOR, OPERATOR >::comm ( ) const
inlineoverridevirtual

Get the MPI communicator the matrix was created with.

Returns
MPI communicator passed in create...()
Note
when build without MPI, may return anything (MPI_Comm will be a mock type defined in MpiWrapper)

Definition at line 180 of file BlockOperatorView.hpp.

◆ numBlockCols()

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

Get number of block columns.

Returns
number of block columns

Definition at line 205 of file BlockOperatorView.hpp.

◆ numBlockRows()

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

Get number of block rows.

Returns
number of block rows

Definition at line 196 of file BlockOperatorView.hpp.

◆ numGlobalCols()

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

Get the number of global columns.

Returns
Number of global columns in the operator.

Definition at line 148 of file BlockOperatorView.hpp.

◆ numGlobalRows()

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

Get the number of global rows.

Returns
Number of global rows in the operator.

Definition at line 139 of file BlockOperatorView.hpp.

◆ numLocalCols()

template<typename VECTOR , typename OPERATOR = LinearOperator< VECTOR >>
virtual localIndex geos::BlockOperatorView< VECTOR, OPERATOR >::numLocalCols ( ) const
inlineoverridevirtual

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 168 of file BlockOperatorView.hpp.

◆ numLocalRows()

template<typename VECTOR , typename OPERATOR = LinearOperator< VECTOR >>
virtual localIndex geos::BlockOperatorView< VECTOR, OPERATOR >::numLocalRows ( ) const
inlineoverridevirtual

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 158 of file BlockOperatorView.hpp.

◆ operator()() [1/2]

template<typename VECTOR , typename OPERATOR = LinearOperator< VECTOR >>
OPERATOR& geos::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 242 of file BlockOperatorView.hpp.

◆ operator()() [2/2]

template<typename VECTOR , typename OPERATOR = LinearOperator< VECTOR >>
const OPERATOR& geos::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 234 of file BlockOperatorView.hpp.

◆ operator=() [1/2]

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

Deleted move assignment.

Returns
not callable

◆ operator=() [2/2]

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

Deleted copy assignment.

Returns
not callable

◆ setPointer()

template<typename VECTOR , typename OPERATOR = LinearOperator< VECTOR >>
void geos::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 281 of file BlockOperatorView.hpp.


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