G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
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

static uPtr make()
Definition gsAdditiveOp.h:120
memory::shared_ptr< gsLinearOperator > Ptr
Shared pointer for gsLinearOperator.
Definition gsLinearOperator.h:33

is equivalent to

for (index_t i=0; i<transfers.size(); ++i)
s->addOperator(
makeMatrixOp(transfers[i].transpose()),
ops[i],
makeMatrixOp(transfers[i])
)
);
Class for representing the product of objects of type gsLinearOperator as gsLinearOperator.
Definition gsProductOp.h:34
memory::shared_ptr< gsSumOp > Ptr
Shared pointer for gsSumOp.
Definition gsSumOp.h:30
static uPtr make()
Make command returning a smart pointer.
Definition gsSumOp.h:70
#define index_t
Definition gsConfig.h:32

but much faster.

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

Public Types

typedef memory::shared_ptr< gsAdditiveOpPtr
 Shared pointer.
 
typedef memory::unique_ptr< gsAdditiveOpuPtr
 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
 
index_t cols () const
 Returns the number of columns of the operator.
 
 gsAdditiveOp ()
 Default Constructor.
 
 gsAdditiveOp (TransferContainer transfers, OpContainer ops)
 Constructor.
 
 gsAdditiveOp (TransferPtrContainer transfers, OpContainer ops)
 Constructor.
 
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() [1/2]

template<class T >
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() [2/2]

template<class T >
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

◆ addOperator() [1/2]

template<class T >
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 \)

◆ addOperator() [2/2]

template<class T >
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 \)

◆ apply()

template<typename T >
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 >.

◆ make() [1/3]

template<class T >
static uPtr make ( )
inlinestatic

Make function

This function allows to obtain an empty instance

◆ make() [2/3]

template<class T >
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 \)

◆ make() [3/3]

template<class T >
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 \)