paso::SystemMatrix< T > Class Template Reference

this class holds a (distributed) stiffness matrix More...

`#include <SystemMatrix.h>`

Inheritance diagram for paso::SystemMatrix< T >:

## Public Member Functions

| SystemMatrix ()
| default constructor - throws exception. More...
| SystemMatrix (SystemMatrixType type, SystemMatrixPattern_ptr pattern, dim_t rowBlockSize, dim_t columnBlockSize, bool patternIsUnrolled, const escript::FunctionSpace &rowFS, const escript::FunctionSpace &colFS)
| ~SystemMatrix ()
virtual void | nullifyRowsAndCols (escript::Data &mask_row, escript::Data &mask_col, double main_diagonal_value)
virtual void | saveMM (const std::string &filename) const
| writes the matrix to a file using the Matrix Market file format More...
virtual void | saveHB (const std::string &filename) const
| writes the matrix to a file using the Harwell-Boeing file format More...
virtual void | resetValues (bool preserveSolverData=false)
| resets the matrix entries More...
void | nullifyRows (double *mask_row, double main_diagonal_value)
void | add (dim_t, index_t *, dim_t, dim_t, index_t *, dim_t, double *)
void | makeZeroRowSums (double *left_over)
void | copyColCoupleBlock ()
void | copyRemoteCoupleBlock (bool recreatePattern)
void | fillWithGlobalCoordinates (double f1)
void | print () const
SparseMatrix_ptr< T > | mergeSystemMatrix () const
void | mergeMainAndCouple (index_t **p_ptr, index_t **p_idx, double **p_val) const
void | mergeMainAndCouple_CSR_OFFSET0 (index_t **p_ptr, index_t **p_idx, double **p_val) const
void | mergeMainAndCouple_CSR_OFFSET0_Block (index_t **p_ptr, index_t **p_idx, double **p_val) const
void | mergeMainAndCouple_CSC_OFFSET1 (index_t **p_ptr, index_t **p_idx, double **p_val) const
void | copyMain_CSC_OFFSET1 (index_t **p_ptr, index_t **p_idx, double **p_val)
void | extendedRowsForST (dim_t *degree_ST, index_t *offset_ST, index_t *ST)
void | applyBalanceInPlace (double *x, bool RHS) const
void | applyBalance (double *x_out, const double *x, bool RHS) const
void | balance ()
double | getGlobalSize () const
void | setPreconditioner (Options *options)
void | solvePreconditioner (double *x, double *b)
void | freePreconditioner ()
index_t * | borrowMainDiagonalPointer () const
void | startCollect (const double *in) const
double * | finishCollect () const
void | startColCollect (const double *in) const
double * | finishColCollect () const
void | startRowCollect (const double *in)
double * | finishRowCollect ()
dim_t | getNumRows () const
dim_t | getNumCols () const
dim_t | getTotalNumRows () const
dim_t | getTotalNumCols () const
dim_t | getRowOverlap () const
dim_t | getColOverlap () const
dim_t | getGlobalNumRows () const
dim_t | getGlobalNumCols () const
dim_t | getGlobalTotalNumRows () const
dim_t | getGlobalTotalNumCols () const
double | getSparsity () const
dim_t | getNumOutput () const
void | copyBlockFromMainDiagonal (double *out) const
void | copyBlockToMainDiagonal (const double *in)
void | copyFromMainDiagonal (double *out) const
void | copyToMainDiagonal (const double *in)
void | setValues (double value)
void | rowSum (double *row_sum) const
void | MatrixVector (double alpha, const T *in, double beta, T *out) const
void | MatrixVector_CSR_OFFSET0 (double alpha, const double *in, double beta, double *out) const
void | setPreconditioner (Options *options)
void | solvePreconditioner (double *x, double *b)
void | freePreconditioner ()
double | getGlobalSize () const
index_t * | borrowMainDiagonalPointer () const
void | makeZeroRowSums (double *left_over)
void | nullifyRows (double *mask_row, double main_diagonal_value)
void | copyColCoupleBlock ()
void | applyBalanceInPlace (double *x, const bool RHS) const
void | applyBalance (double *x_out, const double *x, bool RHS) const
void | balance ()
SparseMatrix_ptr< double > | mergeSystemMatrix () const
SparseMatrix_ptr< cplx_t > | mergeSystemMatrix () const
SparseMatrix_ptr< double > | mergeSystemMatrix () const
SparseMatrix_ptr< cplx_t > | mergeSystemMatrix () const
void | MatrixVector (double alpha, const double *in, double beta, double *out) const
void | MatrixVector (double alpha, const cplx_t *in, double beta, cplx_t *out) const
void | copyRemoteCoupleBlock (bool recreatePattern)
void | fillWithGlobalCoordinates (double f1)
void | print () const
void | extendedRowsForST (dim_t *degree_ST, index_t *offset_ST, index_t *ST)
SystemMatrix_ptr< double > | loadMM_toCSR (const char *filename)
SystemMatrix_ptr< double > | loadMM_toCSC (const char *filename)
void | MatrixVector_CSR_OFFSET0 (double alpha, const double *in, double beta, double *out) const
void | MatrixVector (double alpha, const double *in, double beta, double *out) const
void | MatrixVector (double alpha, const cplx_t *in, double beta, cplx_t *out) const
void | mergeMainAndCouple_CSR_OFFSET0_Block (index_t **p_ptr, index_t **p_idx, double **p_val) const
void | mergeMainAndCouple_CSR_OFFSET0 (index_t **p_ptr, index_t **p_idx, double **p_val) const
void | mergeMainAndCouple_CSC_OFFSET1 (index_t **p_ptr, index_t **p_idx, double **p_val) const
void | mergeMainAndCouple (index_t **p_ptr, index_t **p_idx, double **p_val) const
Public Member Functions inherited from escript::AbstractSystemMatrix
| AbstractSystemMatrix ()
| Default constructor for AbstractSystemMatrix. More...
| AbstractSystemMatrix (int row_blocksize, const FunctionSpace &row_functionspace, int column_blocksize, const FunctionSpace &column_functionspace)
virtual | ~AbstractSystemMatrix ()
| Destructor. More...
ASM_ptr | getPtr ()
| Returns smart pointer which is managing this object. If one does not exist yet it creates one. More...
const_ASM_ptr | getPtr () const
| Returns smart pointer which is managing this object. If one does not exist yet it creates one. More...
Data | vectorMultiply (const Data &right) const
| returns the matrix-vector product this*right More...
bool | isEmpty () const
| returns true if the matrix is empty More...
FunctionSpace | getColumnFunctionSpace () const
| returns the column function space More...
FunctionSpace | getRowFunctionSpace () const
| returns the row function space More...
int | getRowBlockSize () const
| returns the row block size More...
int | getColumnBlockSize () const
| returns the column block size More...
Data | solve (const Data &in, boost::python::object &options) const
| returns the solution u of the linear system this*u=in More...

## Static Public Member Functions

static SystemMatrix_ptr< double > | loadMM_toCSR (const char *filename)
static SystemMatrix_ptr< double > | loadMM_toCSC (const char *filename)
static int | getSystemMatrixTypeId (int solver, int preconditioner, int package, bool is_complex, bool symmetry, const escript::JMPI &mpi_info)

## Public Attributes

SystemMatrixType | type
SystemMatrixPattern_ptr | pattern
dim_t | logical_row_block_size
dim_t | logical_col_block_size
dim_t | row_block_size
dim_t | col_block_size
dim_t | block_size
escript::Distribution_ptr | row_distribution
escript::Distribution_ptr | col_distribution
escript::JMPI | mpi_info
Coupler_ptr< real_t > | col_coupler
Coupler_ptr< real_t > | row_coupler
SparseMatrix_ptr< T > | mainBlock
| main block More...
SparseMatrix_ptr< T > | col_coupleBlock
| coupling to neighbouring processors (row - col) More...
SparseMatrix_ptr< T > | row_coupleBlock
| coupling to neighbouring processors (col - row) More...
SparseMatrix_ptr< T > | remote_coupleBlock
| coupling of rows-cols on neighbouring processors (may not be valid) More...
bool | is_balanced
double * | balance_vector
index_t * | global_id
| stores the global ids for all cols in col_coupleBlock More...
index_t | solver_package
| package code controlling the solver pointer More...
void * | solver_p
| pointer to data needed by a solver More...

## Private Member Functions

virtual void | setToSolution (escript::Data &out, escript::Data &in, boost::python::object &options) const
| solves the linear system this*out=in More...
virtual void | ypAx (escript::Data &y, escript::Data &x) const
| performs y+=this*x More...
void | solve (T *out, T *in, Options *options) const
void | solve (double *out, double *in, Options *options) const
void | solve (cplx_t *out, cplx_t *in, Options *options) const
void | solve (double *out, double *in, Options *options) const
void | solve (cplx_t *out, cplx_t *in, Options *options) const

## Detailed Description

### template<class T>
class paso::SystemMatrix< T >

this class holds a (distributed) stiffness matrix

## Constructor & Destructor Documentation

## SystemMatrix() [1/2]

template<class T >

paso::SystemMatrix< T >::SystemMatrix

default constructor - throws exception.

## SystemMatrix() [2/2]

template<class T >

paso::SystemMatrix< T >::SystemMatrix | ( | SystemMatrixType | ntype,
|  | SystemMatrixPattern_ptr | npattern,
|  | dim_t | rowBlockSize,
|  | dim_t | colBlockSize,
|  | bool | patternIsUnrolled,
|  | const escript::FunctionSpace & | rowFS,
|  | const escript::FunctionSpace & | colFS
| ) |  |

Allocates a SystemMatrix of given type using the given matrix pattern. Values are initialized with zero. If patternIsUnrolled and type & MATRIX_FORMAT_BLK1, it is assumed that the pattern is already unrolled to match the requested block size and offsets. Otherwise unrolling and offset adjustment will be performed.

References paso::SystemMatrix< T >::balance_vector, paso::SystemMatrix< T >::block_size, paso::SystemMatrix< T >::col_block_size, paso::SystemMatrix< T >::col_coupleBlock, paso::SystemMatrix< T >::col_coupler, paso::SystemMatrix< T >::col_distribution, paso::SystemMatrix< T >::mainBlock, MATRIX_FORMAT_BLK1, MATRIX_FORMAT_CSC, MATRIX_FORMAT_DEFAULT, MATRIX_FORMAT_DIAGONAL_BLOCK, MATRIX_FORMAT_OFFSET1, paso::SystemMatrix< T >::mpi_info, paso::SystemMatrix< T >::pattern, paso::SystemMatrix< T >::row_block_size, paso::SystemMatrix< T >::row_coupleBlock, paso::SystemMatrix< T >::row_coupler, paso::SystemMatrix< T >::row_distribution, and paso::SystemMatrix< T >::type.

## ~SystemMatrix()

template<class T >

paso::SystemMatrix< T >::~SystemMatrix

References paso::solve_free().

## Member Function Documentation

## add()

template<class T >

void paso::SystemMatrix< T >::add | ( | dim_t | ,
|  | index_t * | ,
|  | dim_t | ,
|  | dim_t | ,
|  | index_t * | ,
|  | dim_t | ,
|  | double * |
| ) |  |

## applyBalance() [1/2]

void paso::SystemMatrix< double >::applyBalance | ( | double * | x_out,
|  | const double * | x,
|  | bool | RHS
| ) |  | const

## applyBalance() [2/2]

template<class T >

void paso::SystemMatrix< T >::applyBalance | ( | double * | x_out,
|  | const double * | x,
|  | bool | RHS
| ) |  | const

## applyBalanceInPlace() [1/2]

template<class T >

void paso::SystemMatrix< T >::applyBalanceInPlace | ( | double * | x,
|  | bool | RHS
| ) |  | const

## applyBalanceInPlace() [2/2]

void paso::SystemMatrix< double >::applyBalanceInPlace | ( | double * | x,
|  | const bool | RHS
| ) |  | const

## balance() [1/2]

void paso::SystemMatrix< double >::balance | ( |  | ) |

References MATRIX_FORMAT_CSC, and MATRIX_FORMAT_OFFSET1.

## balance() [2/2]

template<class T >

void paso::SystemMatrix< T >::balance | ( |  | ) |

## borrowMainDiagonalPointer() [1/2]

index_t * paso::SystemMatrix< double >::borrowMainDiagonalPointer | ( |  | ) | const

References MPI_INT, and MPI_MAX.

## borrowMainDiagonalPointer() [2/2]

template<class T >

index_t* paso::SystemMatrix< T >::borrowMainDiagonalPointer | ( |  | ) | const

## copyBlockFromMainDiagonal()

template<class T >

void paso::SystemMatrix< T >::copyBlockFromMainDiagonal | ( | double * | out | ) | const

inline

References paso::SystemMatrix< T >::mainBlock.

## copyBlockToMainDiagonal()

template<class T >

void paso::SystemMatrix< T >::copyBlockToMainDiagonal | ( | const double * | in | ) |

inline

References paso::SystemMatrix< T >::mainBlock.

## copyColCoupleBlock() [1/2]

void paso::SystemMatrix< double >::copyColCoupleBlock | ( |  | ) |

References MPI_DOUBLE.

## copyColCoupleBlock() [2/2]

template<class T >

void paso::SystemMatrix< T >::copyColCoupleBlock | ( |  | ) |

copies the col_coupleBlock into row_coupleBlock. WARNING: this method uses mpi_requests of the coupler attached to the matrix. No reordering on the received columns is performed. In practice this means that components in row_coupleBlock->pattern->index and row_coupler->connector->recv->shared are ordered by increasing value. Note that send and receive row_coupler->connectors are swapping roles.

## copyFromMainDiagonal()

template<class T >

void paso::SystemMatrix< T >::copyFromMainDiagonal | ( | double * | out | ) | const

inline

References paso::SystemMatrix< T >::mainBlock.

## copyMain_CSC_OFFSET1()

template<class T >

void paso::SystemMatrix< T >::copyMain_CSC_OFFSET1 | ( | index_t ** | p_ptr,
|  | index_t ** | p_idx,
|  | double ** | p_val
| ) |  |

## copyRemoteCoupleBlock() [1/2]

template<class T >

void paso::SystemMatrix< T >::copyRemoteCoupleBlock | ( | bool | recreatePattern | ) |

## copyRemoteCoupleBlock() [2/2]

void paso::SystemMatrix< double >::copyRemoteCoupleBlock | ( | bool | recreatePattern | ) |

References MPI_DOUBLE, and MPI_INT.

## copyToMainDiagonal()

template<class T >

void paso::SystemMatrix< T >::copyToMainDiagonal | ( | const double * | in | ) |

inline

References paso::SystemMatrix< T >::mainBlock.

## extendedRowsForST() [1/2]

template<class T >

void paso::SystemMatrix< T >::extendedRowsForST | ( | dim_t * | degree_ST,
|  | index_t * | offset_ST,
|  | index_t * | ST
| ) |  |

## extendedRowsForST() [2/2]

void paso::SystemMatrix< double >::extendedRowsForST | ( | dim_t * | degree_ST,
|  | index_t * | offset_ST,
|  | index_t * | ST
| ) |  |

References paso::util::comparIndex(), and MPI_INT.

## fillWithGlobalCoordinates() [1/2]

template<class T >

void paso::SystemMatrix< T >::fillWithGlobalCoordinates | ( | double | f1 | ) |

## fillWithGlobalCoordinates() [2/2]

void paso::SystemMatrix< double >::fillWithGlobalCoordinates | ( | double | f1 | ) |

## finishColCollect()

template<class T >

double* paso::SystemMatrix< T >::finishColCollect | ( |  | ) | const

inline

References paso::SystemMatrix< T >::col_coupler.

Referenced by paso::SystemMatrix< T >::finishCollect().

## finishCollect()

template<class T >

double* paso::SystemMatrix< T >::finishCollect | ( |  | ) | const

inline

References paso::SystemMatrix< T >::finishColCollect().

## finishRowCollect()

template<class T >

double* paso::SystemMatrix< T >::finishRowCollect | ( |  | ) |

inline

References paso::SystemMatrix< T >::row_coupler.

## freePreconditioner() [1/2]

void paso::SystemMatrix< double >::freePreconditioner | ( |  | ) |

References paso::Preconditioner_free().

## freePreconditioner() [2/2]

template<class T >

void paso::SystemMatrix< T >::freePreconditioner | ( |  | ) |

Referenced by paso::Solver_free().

## getColOverlap()

template<class T >

dim_t paso::SystemMatrix< T >::getColOverlap | ( |  | ) | const

inline

References paso::SystemMatrix< T >::col_coupler.

## getGlobalNumCols()

template<class T >

dim_t paso::SystemMatrix< T >::getGlobalNumCols | ( |  | ) | const

inline

References MATRIX_FORMAT_CSC, paso::SystemMatrix< T >::pattern, and paso::SystemMatrix< T >::type.

Referenced by paso::SystemMatrix< T >::getGlobalTotalNumCols().

## getGlobalNumRows()

template<class T >

dim_t paso::SystemMatrix< T >::getGlobalNumRows | ( |  | ) | const

inline

References MATRIX_FORMAT_CSC, paso::SystemMatrix< T >::pattern, and paso::SystemMatrix< T >::type.

Referenced by paso::SystemMatrix< T >::getGlobalTotalNumRows().

## getGlobalSize() [1/2]

double paso::SystemMatrix< double >::getGlobalSize | ( |  | ) | const

References MPI_DOUBLE, and MPI_SUM.

## getGlobalSize() [2/2]

template<class T >

double paso::SystemMatrix< T >::getGlobalSize | ( |  | ) | const

Referenced by paso::SystemMatrix< T >::getSparsity().

## getGlobalTotalNumCols()

template<class T >

dim_t paso::SystemMatrix< T >::getGlobalTotalNumCols | ( |  | ) | const

inline

References paso::SystemMatrix< T >::col_block_size, and paso::SystemMatrix< T >::getGlobalNumCols().

Referenced by paso::SystemMatrix< T >::getSparsity().

## getGlobalTotalNumRows()

template<class T >

dim_t paso::SystemMatrix< T >::getGlobalTotalNumRows | ( |  | ) | const

inline

References paso::SystemMatrix< T >::getGlobalNumRows(), and paso::SystemMatrix< T >::row_block_size.

Referenced by paso::SystemMatrix< T >::getSparsity().

## getNumCols()

template<class T >

dim_t paso::SystemMatrix< T >::getNumCols | ( |  | ) | const

inline

References paso::SystemMatrix< T >::mainBlock.

Referenced by paso::SystemMatrix< T >::getTotalNumCols().

## getNumOutput()

template<class T >

dim_t paso::SystemMatrix< T >::getNumOutput | ( |  | ) | const

inline

References paso::SystemMatrix< T >::pattern.

## getNumRows()

template<class T >

dim_t paso::SystemMatrix< T >::getNumRows | ( |  | ) | const

inline

References paso::SystemMatrix< T >::mainBlock.

Referenced by paso::SystemMatrix< T >::getTotalNumRows().

## getRowOverlap()

template<class T >

dim_t paso::SystemMatrix< T >::getRowOverlap | ( |  | ) | const

inline

References paso::SystemMatrix< T >::row_coupler.

## getSparsity()

template<class T >

double paso::SystemMatrix< T >::getSparsity | ( |  | ) | const

inline

References paso::SystemMatrix< T >::getGlobalSize(), paso::SystemMatrix< T >::getGlobalTotalNumCols(), and paso::SystemMatrix< T >::getGlobalTotalNumRows().

## getSystemMatrixTypeId()

template<class T >

int paso::SystemMatrix< T >::getSystemMatrixTypeId | ( | int | solver,
|  | int | preconditioner,
|  | int | package,
|  | bool | is_complex,
|  | bool | symmetry,
|  | const escript::JMPI & | mpi_info
| ) |  |

static

References paso::Options::getPackage(), paso::Options::mapEscriptOption(), MATRIX_FORMAT_BLK1, MATRIX_FORMAT_COMPLEX, MATRIX_FORMAT_CSC, MATRIX_FORMAT_DEFAULT, MATRIX_FORMAT_OFFSET1, PASO_MKL, PASO_MUMPS, PASO_PASO, and PASO_UMFPACK.

Referenced by dudley::DudleyDomain::getSystemMatrixTypeId(), finley::FinleyDomain::getSystemMatrixTypeId(), and ripley::RipleyDomain::getSystemMatrixTypeId().

## getTotalNumCols()

template<class T >

dim_t paso::SystemMatrix< T >::getTotalNumCols | ( |  | ) | const

inline

References paso::SystemMatrix< T >::col_block_size, and paso::SystemMatrix< T >::getNumCols().

## getTotalNumRows()

template<class T >

dim_t paso::SystemMatrix< T >::getTotalNumRows | ( |  | ) | const

inline

References paso::SystemMatrix< T >::getNumRows(), and paso::SystemMatrix< T >::row_block_size.

## loadMM_toCSC() [1/2]

template<class T >

static SystemMatrix_ptr<double> paso::SystemMatrix< T >::loadMM_toCSC | ( | const char * | filename | ) |

static

## loadMM_toCSC() [2/2]

SystemMatrix_ptr< double > paso::SystemMatrix< double >::loadMM_toCSC | ( | const char * | filename | ) |

References paso::M, escript::makeInfo(), MATRIX_FORMAT_CSC, MATRIX_FORMAT_DEFAULT, mm_is_general, mm_is_real, mm_is_sparse, mm_read_banner(), mm_read_mtx_crd_size(), MPI_COMM_WORLD, paso::N, paso::nz, and paso::q_sort().

## loadMM_toCSR() [1/2]

template<class T >

static SystemMatrix_ptr<double> paso::SystemMatrix< T >::loadMM_toCSR | ( | const char * | filename | ) |

static

## loadMM_toCSR() [2/2]

SystemMatrix_ptr< double > paso::SystemMatrix< double >::loadMM_toCSR | ( | const char * | filename | ) |

References paso::M, escript::makeInfo(), MATRIX_FORMAT_DEFAULT, mm_is_general, mm_is_real, mm_is_sparse, mm_read_banner(), mm_read_mtx_crd_size(), MPI_COMM_WORLD, paso::N, paso::nz, and paso::q_sort().

## makeZeroRowSums() [1/2]

void paso::SystemMatrix< double >::makeZeroRowSums | ( | double * | left_over | ) |

## makeZeroRowSums() [2/2]

template<class T >

void paso::SystemMatrix< T >::makeZeroRowSums | ( | double * | left_over | ) |

## MatrixVector() [1/5]

void paso::SystemMatrix< cplx_t >::MatrixVector | ( | double | alpha,
|  | const cplx_t * | in,
|  | double | beta,
|  | cplx_t * | out
| ) |  | const

## MatrixVector() [2/5]

void paso::SystemMatrix< cplx_t >::MatrixVector | ( | double | alpha,
|  | const cplx_t * | in,
|  | double | beta,
|  | cplx_t * | out
| ) |  | const

References MATRIX_FORMAT_BLK1, and MATRIX_FORMAT_OFFSET1.

## MatrixVector() [3/5]

void paso::SystemMatrix< double >::MatrixVector | ( | double | alpha,
|  | const double * | in,
|  | double | beta,
|  | double * | out
| ) |  | const

## MatrixVector() [4/5]

void paso::SystemMatrix< double >::MatrixVector | ( | double | alpha,
|  | const double * | in,
|  | double | beta,
|  | double * | out
| ) |  | const

References MATRIX_FORMAT_CSC, MATRIX_FORMAT_OFFSET1, paso::SparseMatrix_MatrixVector_CSC_OFFSET0(), and paso::SparseMatrix_MatrixVector_CSC_OFFSET1().

## MatrixVector() [5/5]

template<class T >

void paso::SystemMatrix< T >::MatrixVector | ( | double | alpha,
|  | const T * | in,
|  | double | beta,
|  | T * | out
| ) |  | const

## MatrixVector_CSR_OFFSET0() [1/2]

template<class T >

void paso::SystemMatrix< T >::MatrixVector_CSR_OFFSET0 | ( | double | alpha,
|  | const double * | in,
|  | double | beta,
|  | double * | out
| ) |  | const

## MatrixVector_CSR_OFFSET0() [2/2]

void paso::SystemMatrix< double >::MatrixVector_CSR_OFFSET0 | ( | double | alpha,
|  | const double * | in,
|  | double | beta,
|  | double * | out
| ) |  | const

References MATRIX_FORMAT_DIAGONAL_BLOCK, paso::SparseMatrix_MatrixVector_CSR_OFFSET0(), and paso::SparseMatrix_MatrixVector_CSR_OFFSET0_DIAG().

## mergeMainAndCouple() [1/2]

template<class T >

void paso::SystemMatrix< T >::mergeMainAndCouple | ( | index_t ** | p_ptr,
|  | index_t ** | p_idx,
|  | double ** | p_val
| ) |  | const

## mergeMainAndCouple() [2/2]

void paso::SystemMatrix< double >::mergeMainAndCouple | ( | index_t ** | p_ptr,
|  | index_t ** | p_idx,
|  | double ** | p_val
| ) |  | const

References MATRIX_FORMAT_BLK1, MATRIX_FORMAT_CSC, MATRIX_FORMAT_DEFAULT, and MATRIX_FORMAT_OFFSET1.

## mergeMainAndCouple_CSC_OFFSET1() [1/2]

template<class T >

void paso::SystemMatrix< T >::mergeMainAndCouple_CSC_OFFSET1 | ( | index_t ** | p_ptr,
|  | index_t ** | p_idx,
|  | double ** | p_val
| ) |  | const

## mergeMainAndCouple_CSC_OFFSET1() [2/2]

void paso::SystemMatrix< double >::mergeMainAndCouple_CSC_OFFSET1 | ( | index_t ** | p_ptr,
|  | index_t ** | p_idx,
|  | double ** | p_val
| ) |  | const

## mergeMainAndCouple_CSR_OFFSET0() [1/2]

template<class T >

void paso::SystemMatrix< T >::mergeMainAndCouple_CSR_OFFSET0 | ( | index_t ** | p_ptr,
|  | index_t ** | p_idx,
|  | double ** | p_val
| ) |  | const

## mergeMainAndCouple_CSR_OFFSET0() [2/2]

void paso::SystemMatrix< double >::mergeMainAndCouple_CSR_OFFSET0 | ( | index_t ** | p_ptr,
|  | index_t ** | p_idx,
|  | double ** | p_val
| ) |  | const

## mergeMainAndCouple_CSR_OFFSET0_Block() [1/2]

template<class T >

void paso::SystemMatrix< T >::mergeMainAndCouple_CSR_OFFSET0_Block | ( | index_t ** | p_ptr,
|  | index_t ** | p_idx,
|  | double ** | p_val
| ) |  | const

## mergeMainAndCouple_CSR_OFFSET0_Block() [2/2]

void paso::SystemMatrix< double >::mergeMainAndCouple_CSR_OFFSET0_Block | ( | index_t ** | p_ptr,
|  | index_t ** | p_idx,
|  | double ** | p_val
| ) |  | const

## mergeSystemMatrix() [1/5]

SparseMatrix_ptr< double > paso::SystemMatrix< double >::mergeSystemMatrix | ( |  | ) | const

References MPI_DOUBLE, and MPI_INT.

## mergeSystemMatrix() [2/5]

SparseMatrix_ptr< cplx_t > paso::SystemMatrix< cplx_t >::mergeSystemMatrix | ( |  | ) | const

## mergeSystemMatrix() [3/5]

template<class T >

SparseMatrix_ptr<T> paso::SystemMatrix< T >::mergeSystemMatrix | ( |  | ) | const

Merges the system matrix which is distributed on several MPI ranks into a complete sparse matrix on rank 0. Used by the Merged Solver.

Referenced by paso::SystemMatrix< T >::saveMM().

## mergeSystemMatrix() [4/5]

SparseMatrix_ptr< double > paso::SystemMatrix< double >::mergeSystemMatrix | ( |  | ) | const

## mergeSystemMatrix() [5/5]

SparseMatrix_ptr< cplx_t > paso::SystemMatrix< cplx_t >::mergeSystemMatrix | ( |  | ) | const

## nullifyRows() [1/2]

void paso::SystemMatrix< double >::nullifyRows | ( | double * | mask_row,
|  | double | main_diagonal_value
| ) |  |

References MATRIX_FORMAT_CSC.

## nullifyRows() [2/2]

template<class T >

void paso::SystemMatrix< T >::nullifyRows | ( | double * | mask_row,
|  | double | main_diagonal_value
| ) |  |

Nullifies rows in the matrix. The rows are marked by positive values in mask_row. Values on the main diagonal which are marked to set to zero by mask_row are set to main_diagonal_value.

## nullifyRowsAndCols()

template<class T >

void paso::SystemMatrix< T >::nullifyRowsAndCols | ( | escript::Data & | mask_row,
|  | escript::Data & | mask_col,
|  | double | main_diagonal_value
| ) |  |

virtual

Nullifies rows and columns in the matrix. The rows and columns are marked by positive values in mask_row and mask_col. Values on the main diagonal which are marked to set to zero by both mask_row and mask_col are set to main_diagonal_value.

Reimplemented from escript::AbstractSystemMatrix.

References escript::DataTypes::DataVectorAlt< T >::data(), escript::Data::expand(), escript::Data::getDataPointSize(), escript::Data::getExpandedVectorReference(), escript::Data::getFunctionSpace(), escript::Data::isComplex(), MATRIX_FORMAT_CSC, and escript::Data::requireWrite().

## print() [1/2]

template<class T >

void paso::SystemMatrix< T >::print | ( |  | ) | const

## print() [2/2]

void paso::SystemMatrix< double >::print | ( | void |  | ) | const

## resetValues()

template<class T >

void paso::SystemMatrix< T >::resetValues | ( | bool | preserveSolverData = `false` | ) |

virtual

resets the matrix entries

Reimplemented from escript::AbstractSystemMatrix.

References paso::solve_free().

## rowSum()

template<class T >

void paso::SystemMatrix< T >::rowSum | ( | double * | row_sum | ) | const

inline

References paso::SystemMatrix< T >::col_coupleBlock, paso::SystemMatrix< T >::mainBlock, MATRIX_FORMAT_CSC, MATRIX_FORMAT_OFFSET1, paso::SystemMatrix< T >::row_block_size, and paso::SystemMatrix< T >::type.

## saveHB()

template<class T >

virtual void paso::SystemMatrix< T >::saveHB | ( | const std::string & | filename | ) | const

inline virtual

writes the matrix to a file using the Harwell-Boeing file format

Reimplemented from escript::AbstractSystemMatrix.

References paso::SystemMatrix< T >::mainBlock, MATRIX_FORMAT_CSC, paso::SystemMatrix< T >::mpi_info, and paso::SystemMatrix< T >::type.

## saveMM()

template<class T >

virtual void paso::SystemMatrix< T >::saveMM | ( | const std::string & | filename | ) | const

inline virtual

writes the matrix to a file using the Matrix Market file format

Reimplemented from escript::AbstractSystemMatrix.

References paso::SystemMatrix< T >::mainBlock, paso::SystemMatrix< T >::mergeSystemMatrix(), and paso::SystemMatrix< T >::mpi_info.

## setPreconditioner() [1/2]

void paso::SystemMatrix< double >::setPreconditioner | ( | Options * | options | ) |

References paso::Preconditioner_alloc().

## setPreconditioner() [2/2]

template<class T >

void paso::SystemMatrix< T >::setPreconditioner | ( | Options * | options | ) |

## setToSolution()

template<class T >

void paso::SystemMatrix< T >::setToSolution | ( | escript::Data & | out,
|  | escript::Data & | in,
|  | boost::python::object & | options
| ) |  | const

private virtual

solves the linear system this*out=in

Reimplemented from escript::AbstractSystemMatrix.

References escript::DataTypes::DataVectorAlt< T >::data(), escript::Data::expand(), escript::Data::getDataPointSize(), escript::Data::getExpandedVectorReference(), escript::Data::getFunctionSpace(), escript::Data::isComplex(), escript::Data::requireWrite(), and paso::Options::updateEscriptDiagnostics().

## setValues()

template<class T >

void paso::SystemMatrix< T >::setValues | ( | double | value | ) |

inline

References paso::SystemMatrix< T >::col_coupleBlock, paso::SystemMatrix< T >::is_balanced, paso::SystemMatrix< T >::mainBlock, and paso::SystemMatrix< T >::row_coupleBlock.

## solve() [1/5]

void paso::SystemMatrix< cplx_t >::solve | ( | cplx_t * | out,
|  | cplx_t * | in,
|  | Options * | options
| ) |  | const

private

References paso::Options::accept_failed_convergence, paso::Breakdown, paso::Options::converged, paso::Divergence, escript::gettime(), paso::InputError, paso::MaxIterReached, paso::MUMPS_solve(), paso::NegativeNormError, paso::NoError, paso::Options::num_iter, PASO_MUMPS, PERFORMANCE_ALL, paso::Performance_close(), paso::Performance_open(), paso::Performance_startMonitor(), paso::Performance_stopMonitor(), paso::Options::refinements, paso::Options::residual_norm, paso::Options::set_up_time, paso::Options::time, and paso::Options::verbose.

## solve() [2/5]

void paso::SystemMatrix< cplx_t >::solve | ( | cplx_t * | out,
|  | cplx_t * | in,
|  | Options * | options
| ) |  | const

private

## solve() [3/5]

void paso::SystemMatrix< double >::solve | ( | double * | out,
|  | double * | in,
|  | Options * | options
| ) |  | const

private

References paso::Options::accept_failed_convergence, paso::Breakdown, paso::Options::converged, paso::Divergence, escript::gettime(), paso::InputError, paso::MaxIterReached, paso::MKL_solve(), paso::MUMPS_solve(), paso::NegativeNormError, paso::NoError, paso::Options::num_iter, PASO_MKL, PASO_MUMPS, PASO_PASO, PASO_UMFPACK, PERFORMANCE_ALL, paso::Performance_close(), paso::Performance_open(), paso::Performance_startMonitor(), paso::Performance_stopMonitor(), paso::Options::refinements, paso::Options::reordering, paso::Options::residual_norm, paso::Options::set_up_time, paso::Solver(), paso::Options::time, paso::UMFPACK_solve(), and paso::Options::verbose.

## solve() [4/5]

void paso::SystemMatrix< double >::solve | ( | double * | out,
|  | double * | in,
|  | Options * | options
| ) |  | const

private

## solve() [5/5]

template<class T >

void paso::SystemMatrix< T >::solve | ( | T * | out,
|  | T * | in,
|  | Options * | options
| ) |  | const

private

## solvePreconditioner() [1/2]

void paso::SystemMatrix< double >::solvePreconditioner | ( | double * | x,
|  | double * | b
| ) |  |

References paso::Preconditioner_solve().

## solvePreconditioner() [2/2]

template<class T >

void paso::SystemMatrix< T >::solvePreconditioner | ( | double * | x,
|  | double * | b
| ) |  |

Applies the preconditioner. This method needs to be called within a parallel region. Barrier synchronization is performed before the evaluation to make sure that the input vector is available

## startColCollect()

template<class T >

void paso::SystemMatrix< T >::startColCollect | ( | const double * | in | ) | const

inline

References paso::SystemMatrix< T >::col_coupler.

Referenced by paso::SystemMatrix< T >::startCollect().

## startCollect()

template<class T >

void paso::SystemMatrix< T >::startCollect | ( | const double * | in | ) | const

inline

References paso::SystemMatrix< T >::startColCollect().

## startRowCollect()

template<class T >

void paso::SystemMatrix< T >::startRowCollect | ( | const double * | in | ) |

inline

References paso::SystemMatrix< T >::row_coupler.

## ypAx()

template<class T >

void paso::SystemMatrix< T >::ypAx | ( | escript::Data & | y,
|  | escript::Data & | x
| ) |  | const

private virtual

performs y+=this*x

Reimplemented from escript::AbstractSystemMatrix.

References escript::DataTypes::DataVectorAlt< T >::data(), escript::Data::expand(), escript::Data::getDataPointSize(), escript::Data::getExpandedVectorReference(), escript::Data::getFunctionSpace(), escript::Data::isComplex(), and escript::Data::requireWrite().

## Member Data Documentation

## balance_vector

template<class T >

double* paso::SystemMatrix< T >::balance_vector

matrix may be balanced by a diagonal matrix D=diagonal(balance_vector) if is_balanced is true, the matrix stored is D*A*D where A is the original matrix. When the system of linear equations is solved we solve D*A*D*y=c. So to solve A*x=b one needs to set c=D*b and x=D*y.

Referenced by paso::SystemMatrix< T >::SystemMatrix().

## block_size

template<class T >

dim_t paso::SystemMatrix< T >::block_size

Referenced by paso::SystemMatrix< T >::SystemMatrix().

## col_block_size

template<class T >

dim_t paso::SystemMatrix< T >::col_block_size

Referenced by dudley::AssembleParameters::AssembleParameters(), finley::AssembleParameters::AssembleParameters(), paso::SystemMatrix< T >::getGlobalTotalNumCols(), paso::SystemMatrix< T >::getTotalNumCols(), and paso::SystemMatrix< T >::SystemMatrix().

## col_coupleBlock

template<class T >

SparseMatrix_ptr<T> paso::SystemMatrix< T >::col_coupleBlock

coupling to neighbouring processors (row - col)

Referenced by paso::SystemMatrix< T >::rowSum(), paso::SystemMatrix< T >::setValues(), and paso::SystemMatrix< T >::SystemMatrix().

## col_coupler

template<class T >

Coupler_ptr<real_t> paso::SystemMatrix< T >::col_coupler

Referenced by paso::SystemMatrix< T >::finishColCollect(), paso::SystemMatrix< T >::getColOverlap(), paso::SystemMatrix< T >::startColCollect(), and paso::SystemMatrix< T >::SystemMatrix().

## col_distribution

template<class T >

escript::Distribution_ptr paso::SystemMatrix< T >::col_distribution

Referenced by dudley::AssembleParameters::AssembleParameters(), finley::AssembleParameters::AssembleParameters(), and paso::SystemMatrix< T >::SystemMatrix().

## global_id

template<class T >

index_t* paso::SystemMatrix< T >::global_id

mutable

stores the global ids for all cols in col_coupleBlock

## is_balanced

template<class T >

bool paso::SystemMatrix< T >::is_balanced

Referenced by paso::SystemMatrix< T >::setValues().

## logical_col_block_size

template<class T >

dim_t paso::SystemMatrix< T >::logical_col_block_size

## logical_row_block_size

template<class T >

dim_t paso::SystemMatrix< T >::logical_row_block_size

Referenced by dudley::AssembleParameters::AssembleParameters(), and finley::AssembleParameters::AssembleParameters().

## mainBlock

template<class T >

SparseMatrix_ptr<T> paso::SystemMatrix< T >::mainBlock

main block

Referenced by paso::SystemMatrix< T >::copyBlockFromMainDiagonal(), paso::SystemMatrix< T >::copyBlockToMainDiagonal(), paso::SystemMatrix< T >::copyFromMainDiagonal(), paso::SystemMatrix< T >::copyToMainDiagonal(), paso::SystemMatrix< T >::getNumCols(), paso::SystemMatrix< T >::getNumRows(), paso::SystemMatrix< T >::rowSum(), paso::SystemMatrix< T >::saveHB(), paso::SystemMatrix< T >::saveMM(), paso::SystemMatrix< T >::setValues(), paso::solve_free(), and paso::SystemMatrix< T >::SystemMatrix().

## mpi_info

template<class T >

escript::JMPI paso::SystemMatrix< T >::mpi_info

Referenced by paso::SystemMatrix< T >::saveHB(), paso::SystemMatrix< T >::saveMM(), and paso::SystemMatrix< T >::SystemMatrix().

## pattern

template<class T >

SystemMatrixPattern_ptr paso::SystemMatrix< T >::pattern

Referenced by paso::SystemMatrix< T >::getGlobalNumCols(), paso::SystemMatrix< T >::getGlobalNumRows(), paso::SystemMatrix< T >::getNumOutput(), and paso::SystemMatrix< T >::SystemMatrix().

## remote_coupleBlock

template<class T >

SparseMatrix_ptr<T> paso::SystemMatrix< T >::remote_coupleBlock

coupling of rows-cols on neighbouring processors (may not be valid)

## row_block_size

template<class T >

dim_t paso::SystemMatrix< T >::row_block_size

Referenced by dudley::AssembleParameters::AssembleParameters(), finley::AssembleParameters::AssembleParameters(), paso::SystemMatrix< T >::getGlobalTotalNumRows(), paso::SystemMatrix< T >::getTotalNumRows(), paso::SystemMatrix< T >::rowSum(), and paso::SystemMatrix< T >::SystemMatrix().

## row_coupleBlock

template<class T >

SparseMatrix_ptr<T> paso::SystemMatrix< T >::row_coupleBlock

coupling to neighbouring processors (col - row)

Referenced by paso::SystemMatrix< T >::setValues(), and paso::SystemMatrix< T >::SystemMatrix().

## row_coupler

template<class T >

Coupler_ptr<real_t> paso::SystemMatrix< T >::row_coupler

Referenced by paso::SystemMatrix< T >::finishRowCollect(), paso::SystemMatrix< T >::getRowOverlap(), paso::SystemMatrix< T >::startRowCollect(), and paso::SystemMatrix< T >::SystemMatrix().

## row_distribution

template<class T >

escript::Distribution_ptr paso::SystemMatrix< T >::row_distribution

Referenced by dudley::AssembleParameters::AssembleParameters(), finley::AssembleParameters::AssembleParameters(), and paso::SystemMatrix< T >::SystemMatrix().

## solver_p

template<class T >

void* paso::SystemMatrix< T >::solver_p

pointer to data needed by a solver

Referenced by paso::solve_free().

## solver_package

template<class T >

index_t paso::SystemMatrix< T >::solver_package

mutable

package code controlling the solver pointer

Referenced by paso::solve_free().

## type

template<class T >

SystemMatrixType paso::SystemMatrix< T >::type

Referenced by dudley::Assemble_addToSystemMatrix< cplx_t >(), finley::Assemble_addToSystemMatrix< cplx_t >(), dudley::Assemble_addToSystemMatrix< real_t >(), finley::Assemble_addToSystemMatrix< real_t >(), paso::SystemMatrix< T >::getGlobalNumCols(), paso::SystemMatrix< T >::getGlobalNumRows(), paso::SystemMatrix< T >::rowSum(), paso::SystemMatrix< T >::saveHB(), and paso::SystemMatrix< T >::SystemMatrix().

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

- SystemMatrix.h