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

Detailed Description

template<class T>
class gismo::gsAdditiveOp< T >

Generic preconditioner which applies an arbitrary linear operator to the residual.

This preconditioner realizes \( \sum_{i=1}^n T_i A_i T_i^T \), where the \( T_i \) are the transfer matrices and the \( A_i \) are linear operators

gsLinearOperator<>::Ptr pc = gsAdditiveOp<>::make( transfers, ops );

is equivalent to

gsSumOp<>::Ptr pc = gsSumOp<>::make();
for (index_t i=0; i<transfers.size(); ++i)
s->addOperator(
gsProductOp<>::make(
makeMatrixOp(transfers[i].transpose()),
ops[i],
makeMatrixOp(transfers[i])
)
);

but much faster.

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

Public Types

typedef memory::shared_ptr
< gsAdditiveOp
Ptr
 Shared pointer.
 
typedef memory::unique_ptr
< gsAdditiveOp
uPtr
 Unique pointer.
 

Public Member Functions

void addOperator (Transfer transfer, OpPtr op)
 
void addOperator (TransferPtr transfer, OpPtr op)
 
void apply (const gsMatrix< T > &input, gsMatrix< T > &x) const
 apply the operator on the input vector and store the result in x More...
 
index_t cols () const
 Returns the number of columns of the operator.
 
 gsAdditiveOp ()
 Default Constructor.
 
 gsAdditiveOp (TransferContainer transfers, OpContainer ops)
 Constructor. More...
 
 gsAdditiveOp (TransferPtrContainer transfers, OpContainer ops)
 Constructor. More...
 
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 ()
 
static uPtr make (TransferContainer transfers, OpContainer ops)
 
static uPtr make (TransferPtrContainer transfers, OpContainer ops)
 

Protected Attributes

OpContainer m_ops
 Operators to be applied in the subspaces.
 
TransferPtrContainer m_transfers
 Transfer matrices.
 

Constructor & Destructor Documentation

gsAdditiveOp ( TransferContainer  transfers,
OpContainer  ops 
)
inline

Constructor.

The operator realizes \( \sum_{i=1}^n T_i A_i T_i^T \)

Parameters
transferstransfer matrices \( T_i \)
opslocal operators \( A_i \)
gsAdditiveOp ( TransferPtrContainer  transfers,
OpContainer  ops 
)
inline

Constructor.

The operator realizes \( \sum_{i=1}^n T_i A_i T_i^T \)

Parameters
transferstransfer matrices \( T_i \)
opslocal operators \( A_i \)

Member Function Documentation

void addOperator ( Transfer  transfer,
OpPtr  op 
)
inline

Add another entry to the sum

Parameters
transferthe additional transfer matrix \( T_i \)
opthe additional operator \( A_i \)
void addOperator ( TransferPtr  transfer,
OpPtr  op 
)
inline

Add another entry to the sum

Parameters
transferthe additional transfer matrix \( T_i \)
opthe additional operator \( A_i \)
void apply ( const gsMatrix< T > &  input,
gsMatrix< T > &  x 
) const
virtual

apply the operator on the input vector and store the result in x

Parameters
inputInput vector
xresult vector

Implements gsLinearOperator< T >.

static uPtr make ( )
inlinestatic

Make function

This function allows to obtain an empty instance

static uPtr make ( TransferContainer  transfers,
OpContainer  ops 
)
inlinestatic

Make function

The operator realizes \( \sum_{i=1}^n T_i A_i T_i^T \)

Parameters
transferstransfer matrices \( T_i \)
opslocal operators \( A_i \)
static uPtr make ( TransferPtrContainer  transfers,
OpContainer  ops 
)
inlinestatic

Make function

The operator realizes \( \sum_{i=1}^n T_i A_i T_i^T \)

Parameters
transferstransfer matrices \( T_i \)
opslocal operators \( A_i \)