G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsBlockOp< T > Class Template Reference

Detailed Description

template<class T>
class gismo::gsBlockOp< T >

Simple class create a block operator structure.

This class represents a linear operator \(C\) having block structure:

\[ C = \left( \begin{array}{cccc} C_{00} & C_{01} & \ldots & C_{0m} \\ C_{10} & C_{11} & \ldots & C_{1m} \\ \vdots & \vdots & \ddots & \vdots \\ C_{n0} & C_{n1} & \ldots & C_{nm} \end{array} \right), \]

where \(C_{ij}\) are themselves gsLinearOperators.

The number of blocks (m and n) are specified in the constructor. The blocks \(C_{ij}\) are defined using addOperator(i,j,...). Unspecified blocks are considered to be 0.

+ Inheritance diagram for gsBlockOp< T >:
+ Collaboration diagram for gsBlockOp< T >:

Public Types

typedef memory::shared_ptr
< gsLinearOperator< T > > 
BasePtr
 Base class.
 
typedef memory::shared_ptr
< gsBlockOp< T > > 
Ptr
 Shared pointer for gsBlockOp.
 
typedef memory::unique_ptr
< gsBlockOp< T > > 
uPtr
 Unique pointer for gsBlockOp.
 

Public Member Functions

void addOperator (index_t row, index_t col, const BasePtr &op)
 Add a preconditioner \(C_{ij}\) to the block structure. More...
 
void apply (const gsMatrix< T > &input, gsMatrix< T > &result) const
 Apply the correct segment of the input vector on the preconditioners in the block structure and store the result. More...
 
index_t colBlocks () const
 Number of col blocks.
 
index_t cols () const
 Returns the number of columns of the operator.
 
const BasePtrgetOperator (index_t row, index_t col) const
 Returns the pointer to a linear operator of a specific block (if existent) More...
 
 gsBlockOp (index_t nRows, index_t nCols)
 Constructor. Takes the number of blocks (nRows, nCols). Provide the contents of the blocks with addOperator.
 
index_t rowBlocks () const
 Number of row blocks.
 
index_t rows () const
 Returns the number of rows of the operator.
 
virtual void setOptions (const gsOptionList &)
 Set options based on a gsOptionList object.
 

Static Public Member Functions

static gsOptionList defaultOptions ()
 Get the default options as gsOptionList object.
 
static gsIdentityOp< T > Identity (const index_t dim)
 Identity operator.
 
static uPtr make (index_t nRows, index_t nCols)
 Make function returning a smart pointer.
 

Member Function Documentation

void addOperator ( index_t  row,
index_t  col,
const BasePtr op 
)

Add a preconditioner \(C_{ij}\) to the block structure.

Parameters
rowrow position in the block operator
colcolumn position in the block operator
opshared pointer to the operator
void apply ( const gsMatrix< T > &  input,
gsMatrix< T > &  result 
) const
virtual

Apply the correct segment of the input vector on the preconditioners in the block structure and store the result.

Parameters
inputInput vector
resultResult vector

Implements gsLinearOperator< T >.

const BasePtr& getOperator ( index_t  row,
index_t  col 
) const
inline

Returns the pointer to a linear operator of a specific block (if existent)

Parameters
rowrow position in the block operator
colcolumn position in the block operator
Note
The result can be a null-pointer