Opm::Linear::TpsaBlockRef< Scalar > Class Template Reference

Handle on one block of the TPSA matrix. More...

#include <TpsaMatrix.hpp>

Public Types

using MatrixBlock = Opm::MatrixBlock< Scalar, numTpsaEq, numTpsaEq >
 

Public Member Functions

 TpsaBlockRef ()=default
 Construct a handle that does not refer to any block. More...
 
 TpsaBlockRef (const TpsaMatrix< Scalar > &matrix, std::size_t flatIdx)
 Construct a handle on one block of a TPSA matrix. More...
 
TpsaBlockRefoperator* ()
 Dereference the handle, so that it can be used where a pointer to a block is expected. More...
 
TpsaBlockRefoperator+= (const MatrixBlock &b)
 Scatter a dense 7x7 contribution into the sub-matrices. More...
 
TpsaBlockRefoperator= (const MatrixBlock &b)
 Overwrite the stored entries with a dense 7x7 block. More...
 
TpsaBlockRefoperator= (Scalar value)
 Set every stored entry of this block to a scalar. More...
 
void gather (MatrixBlock &b) const
 Gather the stored entries into a dense 7x7 block. More...
 

Detailed Description

template<class Scalar>
class Opm::Linear::TpsaBlockRef< Scalar >

Handle on one block of the TPSA matrix.

Wrapper around MatrixBlock to handle the distribution of incoming 7x7 dense block to the TPSA sub-matrix fields.

Template Parameters
ScalarField type of the matrix entries.

Member Typedef Documentation

◆ MatrixBlock

template<class Scalar >
using Opm::Linear::TpsaBlockRef< Scalar >::MatrixBlock = Opm::MatrixBlock<Scalar, numTpsaEq, numTpsaEq>

Constructor & Destructor Documentation

◆ TpsaBlockRef() [1/2]

template<class Scalar >
Opm::Linear::TpsaBlockRef< Scalar >::TpsaBlockRef ( )
default

Construct a handle that does not refer to any block.

◆ TpsaBlockRef() [2/2]

template<class Scalar >
Opm::Linear::TpsaBlockRef< Scalar >::TpsaBlockRef ( const TpsaMatrix< Scalar > &  matrix,
std::size_t  flatIdx 
)
inline

Construct a handle on one block of a TPSA matrix.

Parameters
[in]matrixMatrix owning the block
[in]flatIdxFlat index of the block within the shared sparsity pattern, as returned by TpsaMatrix::flatIndex_().

Member Function Documentation

◆ gather()

template<class Scalar >
void Opm::Linear::TpsaBlockRef< Scalar >::gather ( MatrixBlock b) const

Gather the stored entries into a dense 7x7 block.

Parameters
[out]bDense block the stored entries are written to. Fully overwritten.

Referenced by Opm::Linear::TpsaMatrix< Scalar >::block().

◆ operator*()

template<class Scalar >
TpsaBlockRef & Opm::Linear::TpsaBlockRef< Scalar >::operator* ( )
inline

Dereference the handle, so that it can be used where a pointer to a block is expected.

Returns
Reference to this handle itself.

◆ operator+=()

template<class Scalar >
TpsaBlockRef & Opm::Linear::TpsaBlockRef< Scalar >::operator+= ( const MatrixBlock b)

Scatter a dense 7x7 contribution into the sub-matrices.

Parameters
[in]bDense block whose entries are added to the stored entries.
Returns
Reference to this handle.

◆ operator=() [1/2]

template<class Scalar >
TpsaBlockRef & Opm::Linear::TpsaBlockRef< Scalar >::operator= ( const MatrixBlock b)

Overwrite the stored entries with a dense 7x7 block.

Parameters
[in]bDense block the stored entries are copied from.
Returns
Reference to this handle.

◆ operator=() [2/2]

template<class Scalar >
TpsaBlockRef & Opm::Linear::TpsaBlockRef< Scalar >::operator= ( Scalar  value)

Set every stored entry of this block to a scalar.

Parameters
[in]valueValue assigned to all stored entries of the block.
Returns
Reference to this handle.

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