paso::SystemMatrix Class Reference

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

`#include <SystemMatrix.h>`

Inheritance diagram for paso::SystemMatrix:

## 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 | 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 double *in, double beta, double *out) const
void | MatrixVector_CSR_OFFSET0 (double alpha, const double *in, double beta, double *out) 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 | loadMM_toCSR (const char *filename)
static SystemMatrix_ptr | loadMM_toCSC (const char *filename)
static int | getSystemMatrixTypeId (int solver, int preconditioner, int package, 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 | mainBlock
| main block More...
SparseMatrix_ptr | col_coupleBlock
| coupling to neighbouring processors (row - col) More...
SparseMatrix_ptr | row_coupleBlock
| coupling to neighbouring processors (col - row) More...
SparseMatrix_ptr | 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 (double *out, double *in, Options *options) const

## Detailed Description

this class holds a (distributed) stiffness matrix

## Constructor & Destructor Documentation

## SystemMatrix() [1/2]

paso::SystemMatrix::SystemMatrix | ( |  | ) |

default constructor - throws exception.

Referenced by loadMM_toCSC(), and loadMM_toCSR().

## SystemMatrix() [2/2]

paso::SystemMatrix::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 balance_vector, block_size, col_block_size, col_coupleBlock, col_coupler, col_distribution, mainBlock, MATRIX_FORMAT_BLK1, MATRIX_FORMAT_CSC, MATRIX_FORMAT_DEFAULT, MATRIX_FORMAT_DIAGONAL_BLOCK, MATRIX_FORMAT_OFFSET1, mpi_info, pattern, row_block_size, row_coupleBlock, row_coupler, row_distribution, and type.

## ~SystemMatrix()

paso::SystemMatrix::~SystemMatrix | ( |  | ) |

References balance_vector, global_id, and paso::solve_free().

## Member Function Documentation

## add()

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

Referenced by saveHB().

## applyBalance()

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

References balance_vector, getTotalNumCols(), getTotalNumRows(), and is_balanced.

Referenced by saveHB().

## applyBalanceInPlace()

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

References balance_vector, getTotalNumCols(), getTotalNumRows(), and is_balanced.

Referenced by saveHB().

## balance()

void paso::SystemMatrix::balance | ( |  | ) |

References balance_vector, col_block_size, col_coupleBlock, finishCollect(), getGlobalNumCols(), getGlobalNumRows(), getTotalNumRows(), is_balanced, mainBlock, MATRIX_FORMAT_CSC, MATRIX_FORMAT_OFFSET1, row_block_size, row_coupleBlock, startCollect(), and type.

Referenced by saveHB().

## borrowMainDiagonalPointer()

index_t * paso::SystemMatrix::borrowMainDiagonalPointer | ( |  | ) | const

References mainBlock, mpi_info, MPI_INT, and MPI_MAX.

Referenced by makeZeroRowSums(), and saveHB().

## copyBlockFromMainDiagonal()

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

inline

References mainBlock.

## copyBlockToMainDiagonal()

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

inline

References mainBlock.

## copyColCoupleBlock()

void paso::SystemMatrix::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.

References block_size, col_coupleBlock, col_coupler, MPI_DOUBLE, mpi_info, pattern, row_coupleBlock, and row_coupler.

Referenced by saveHB().

## copyFromMainDiagonal()

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

inline

References mainBlock.

## copyMain_CSC_OFFSET1()

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

Referenced by saveHB().

## copyRemoteCoupleBlock()

void paso::SystemMatrix::copyRemoteCoupleBlock | ( | bool | recreatePattern | ) |

References block_size, col_block_size, col_coupleBlock, col_coupler, col_distribution, global_id, mainBlock, MPI_DOUBLE, mpi_info, MPI_INT, pattern, remote_coupleBlock, row_block_size, row_coupleBlock, and row_coupler.

Referenced by saveHB().

## copyToMainDiagonal()

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

inline

References mainBlock.

## extendedRowsForST()

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

References col_coupleBlock, col_coupler, col_distribution, paso::util::comparIndex(), global_id, mainBlock, mpi_info, MPI_INT, row_coupleBlock, and row_coupler.

Referenced by saveHB().

## fillWithGlobalCoordinates()

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

References block_size, col_coupleBlock, col_coupler, col_distribution, getNumCols(), getNumRows(), mainBlock, mpi_info, pattern, row_coupleBlock, and row_distribution.

Referenced by saveHB().

## finishColCollect()

double* paso::SystemMatrix::finishColCollect | ( |  | ) | const

inline

References col_coupler.

Referenced by finishCollect(), and nullifyRowsAndCols().

## finishCollect()

double* paso::SystemMatrix::finishCollect | ( |  | ) | const

inline

References finishColCollect().

Referenced by balance(), and MatrixVector_CSR_OFFSET0().

## finishRowCollect()

double* paso::SystemMatrix::finishRowCollect | ( |  | ) |

inline

References row_coupler.

Referenced by nullifyRows(), and nullifyRowsAndCols().

## freePreconditioner()

void paso::SystemMatrix::freePreconditioner | ( |  | ) |

References paso::Preconditioner_free(), and solver_p.

Referenced by saveHB(), and paso::Solver_free().

## getColOverlap()

dim_t paso::SystemMatrix::getColOverlap | ( |  | ) | const

inline

References col_coupler.

## getGlobalNumCols()

dim_t paso::SystemMatrix::getGlobalNumCols | ( |  | ) | const

inline

References MATRIX_FORMAT_CSC.

Referenced by balance(), getGlobalTotalNumCols(), and solve().

## getGlobalNumRows()

dim_t paso::SystemMatrix::getGlobalNumRows | ( |  | ) | const

inline

References MATRIX_FORMAT_CSC.

Referenced by balance(), getGlobalTotalNumRows(), mergeSystemMatrix(), and solve().

## getGlobalSize()

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

References col_coupleBlock, mainBlock, MPI_DOUBLE, mpi_info, and MPI_SUM.

Referenced by getSparsity(), and saveHB().

## getGlobalTotalNumCols()

dim_t paso::SystemMatrix::getGlobalTotalNumCols | ( |  | ) | const

inline

References col_block_size, and getGlobalNumCols().

Referenced by getSparsity().

## getGlobalTotalNumRows()

dim_t paso::SystemMatrix::getGlobalTotalNumRows | ( |  | ) | const

inline

References getGlobalNumRows(), and row_block_size.

Referenced by getSparsity().

## getNumCols()

dim_t paso::SystemMatrix::getNumCols | ( |  | ) | const

inline

References mainBlock.

Referenced by fillWithGlobalCoordinates(), and getTotalNumCols().

## getNumOutput()

dim_t paso::SystemMatrix::getNumOutput | ( |  | ) | const

inline

## getNumRows()

dim_t paso::SystemMatrix::getNumRows | ( |  | ) | const

inline

References mainBlock.

Referenced by fillWithGlobalCoordinates(), getTotalNumRows(), and print().

## getRowOverlap()

dim_t paso::SystemMatrix::getRowOverlap | ( |  | ) | const

inline

References row_coupler.

## getSparsity()

double paso::SystemMatrix::getSparsity | ( |  | ) | const

inline

References getGlobalSize(), getGlobalTotalNumCols(), and getGlobalTotalNumRows().

## getSystemMatrixTypeId()

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

static

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

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

## getTotalNumCols()

dim_t paso::SystemMatrix::getTotalNumCols | ( |  | ) | const

inline

References col_block_size, and getNumCols().

Referenced by applyBalance(), and applyBalanceInPlace().

## getTotalNumRows()

dim_t paso::SystemMatrix::getTotalNumRows | ( |  | ) | const

inline

References getNumRows(), and row_block_size.

Referenced by applyBalance(), applyBalanceInPlace(), and balance().

## loadMM_toCSC()

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

static

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, mpi_info, paso::N, paso::nz, pattern, paso::q_sort(), and SystemMatrix().

Referenced by rowSum().

## loadMM_toCSR()

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

static

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, mpi_info, paso::N, paso::nz, pattern, paso::q_sort(), and SystemMatrix().

Referenced by rowSum().

## makeZeroRowSums()

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

References block_size, borrowMainDiagonalPointer(), mainBlock, pattern, row_block_size, and rowSum().

Referenced by saveHB().

## MatrixVector()

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

References is_balanced, mainBlock, MATRIX_FORMAT_CSC, MATRIX_FORMAT_OFFSET1, MatrixVector_CSR_OFFSET0(), mpi_info, paso::SparseMatrix_MatrixVector_CSC_OFFSET0(), paso::SparseMatrix_MatrixVector_CSC_OFFSET1(), paso::SparseMatrix_MatrixVector_CSR_OFFSET1(), and type.

Referenced by rowSum(), and ypAx().

## MatrixVector_CSR_OFFSET0()

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

References col_coupleBlock, finishCollect(), mainBlock, MATRIX_FORMAT_DIAGONAL_BLOCK, paso::SparseMatrix_MatrixVector_CSR_OFFSET0(), paso::SparseMatrix_MatrixVector_CSR_OFFSET0_DIAG(), startCollect(), and type.

Referenced by MatrixVector(), and rowSum().

## mergeMainAndCouple()

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

References MATRIX_FORMAT_BLK1, MATRIX_FORMAT_CSC, MATRIX_FORMAT_DEFAULT, MATRIX_FORMAT_OFFSET1, mergeMainAndCouple_CSC_OFFSET1(), mergeMainAndCouple_CSR_OFFSET0(), and type.

Referenced by mergeSystemMatrix(), and saveHB().

## mergeMainAndCouple_CSC_OFFSET1()

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

Referenced by mergeMainAndCouple(), and saveHB().

## mergeMainAndCouple_CSR_OFFSET0()

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

References col_coupleBlock, col_coupler, col_distribution, global_id, mainBlock, mergeMainAndCouple_CSR_OFFSET0_Block(), mpi_info, and row_distribution.

Referenced by mergeMainAndCouple(), and saveHB().

## mergeMainAndCouple_CSR_OFFSET0_Block()

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

References block_size, col_coupleBlock, col_coupler, col_distribution, global_id, mainBlock, mpi_info, and row_distribution.

Referenced by mergeMainAndCouple_CSR_OFFSET0(), and saveHB().

## mergeSystemMatrix()

SparseMatrix_ptr paso::SystemMatrix::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.

References block_size, getGlobalNumRows(), mainBlock, mergeMainAndCouple(), MPI_DOUBLE, mpi_info, MPI_INT, and row_distribution.

Referenced by saveHB(), and saveMM().

## nullifyRows()

void paso::SystemMatrix::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.

References col_block_size, col_coupleBlock, finishRowCollect(), mainBlock, MATRIX_FORMAT_CSC, row_block_size, row_coupleBlock, startRowCollect(), and type.

Referenced by saveHB().

## nullifyRowsAndCols()

void paso::SystemMatrix::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 col_block_size, col_coupleBlock, escript::DataTypes::DataVectorAlt< T >::data(), escript::Data::expand(), finishColCollect(), finishRowCollect(), escript::AbstractSystemMatrix::getColumnBlockSize(), escript::AbstractSystemMatrix::getColumnFunctionSpace(), escript::Data::getDataPointSize(), escript::Data::getExpandedVectorReference(), escript::Data::getFunctionSpace(), escript::AbstractSystemMatrix::getRowBlockSize(), escript::AbstractSystemMatrix::getRowFunctionSpace(), escript::Data::isComplex(), mainBlock, MATRIX_FORMAT_CSC, mpi_info, escript::Data::requireWrite(), row_block_size, row_coupleBlock, startColCollect(), startRowCollect(), and type.

## print()

void paso::SystemMatrix::print | ( | void |  | ) | const

References block_size, col_coupleBlock, getNumRows(), global_id, mainBlock, mpi_info, pattern, remote_coupleBlock, and row_coupleBlock.

Referenced by saveHB().

## resetValues()

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

virtual

resets the matrix entries

Reimplemented from escript::AbstractSystemMatrix.

References setValues(), and paso::solve_free().

Referenced by saveHB().

## rowSum()

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

inline

References col_coupleBlock, getSystemMatrixTypeId(), loadMM_toCSC(), loadMM_toCSR(), mainBlock, MATRIX_FORMAT_CSC, MATRIX_FORMAT_OFFSET1, MatrixVector(), MatrixVector_CSR_OFFSET0(), mpi_info, and row_block_size.

Referenced by makeZeroRowSums().

## saveHB()

virtual void paso::SystemMatrix::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 add(), applyBalance(), applyBalanceInPlace(), balance(), borrowMainDiagonalPointer(), copyColCoupleBlock(), copyMain_CSC_OFFSET1(), copyRemoteCoupleBlock(), extendedRowsForST(), fillWithGlobalCoordinates(), freePreconditioner(), getGlobalSize(), mainBlock, makeZeroRowSums(), MATRIX_FORMAT_CSC, mergeMainAndCouple(), mergeMainAndCouple_CSC_OFFSET1(), mergeMainAndCouple_CSR_OFFSET0(), mergeMainAndCouple_CSR_OFFSET0_Block(), mergeSystemMatrix(), mpi_info, nullifyRows(), print(), resetValues(), setPreconditioner(), and solvePreconditioner().

## saveMM()

virtual void paso::SystemMatrix::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 mainBlock, mergeSystemMatrix(), and mpi_info.

## setPreconditioner()

void paso::SystemMatrix::setPreconditioner | ( | Options * | options | ) |

References escript::AbstractSystemMatrix::getPtr(), paso::Preconditioner_alloc(), and solver_p.

Referenced by saveHB().

## setToSolution()

void paso::SystemMatrix::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::AbstractSystemMatrix::getColumnBlockSize(), escript::AbstractSystemMatrix::getColumnFunctionSpace(), escript::Data::getDataPointSize(), escript::Data::getExpandedVectorReference(), escript::Data::getFunctionSpace(), escript::AbstractSystemMatrix::getRowBlockSize(), escript::AbstractSystemMatrix::getRowFunctionSpace(), escript::Data::isComplex(), escript::Data::requireWrite(), solve(), and paso::Options::updateEscriptDiagnostics().

## setValues()

void paso::SystemMatrix::setValues | ( | double | value | ) |

inline

References col_coupleBlock, is_balanced, mainBlock, and row_coupleBlock.

Referenced by resetValues().

## solve()

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

private

References paso::Options::accept_failed_convergence, paso::Breakdown, col_block_size, paso::Options::converged, paso::Divergence, getGlobalNumCols(), getGlobalNumRows(), escript::AbstractSystemMatrix::getPtr(), escript::gettime(), paso::InputError, mainBlock, paso::MaxIterReached, paso::MKL_solve(), mpi_info, paso::NegativeNormError, paso::NoError, paso::Options::num_iter, PASO_MKL, 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, row_block_size, paso::Options::set_up_time, paso::Solver(), solver_package, paso::Options::time, paso::UMFPACK_solve(), and paso::Options::verbose.

Referenced by setToSolution().

## solvePreconditioner()

void paso::SystemMatrix::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

References escript::AbstractSystemMatrix::getPtr(), paso::Preconditioner_solve(), and solver_p.

Referenced by saveHB().

## startColCollect()

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

inline

References col_coupler.

Referenced by nullifyRowsAndCols(), and startCollect().

## startCollect()

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

inline

References startColCollect().

Referenced by balance(), and MatrixVector_CSR_OFFSET0().

## startRowCollect()

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

inline

References row_coupler.

Referenced by nullifyRows(), and nullifyRowsAndCols().

## ypAx()

void paso::SystemMatrix::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::AbstractSystemMatrix::getColumnBlockSize(), escript::AbstractSystemMatrix::getColumnFunctionSpace(), escript::Data::getDataPointSize(), escript::Data::getExpandedVectorReference(), escript::Data::getFunctionSpace(), escript::AbstractSystemMatrix::getRowBlockSize(), escript::AbstractSystemMatrix::getRowFunctionSpace(), escript::Data::isComplex(), MatrixVector(), and escript::Data::requireWrite().

## Member Data Documentation

## balance_vector

double* paso::SystemMatrix::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 applyBalance(), applyBalanceInPlace(), balance(), SystemMatrix(), and ~SystemMatrix().

## block_size

dim_t paso::SystemMatrix::block_size

Referenced by dudley::Assemble_addToSystemMatrix< cplx_t >(), finley::Assemble_addToSystemMatrix< cplx_t >(), copyColCoupleBlock(), copyRemoteCoupleBlock(), fillWithGlobalCoordinates(), makeZeroRowSums(), mergeMainAndCouple_CSR_OFFSET0_Block(), mergeSystemMatrix(), print(), and SystemMatrix().

## col_block_size

dim_t paso::SystemMatrix::col_block_size

Referenced by ripley::RipleyDomain::addToSystemMatrix(), dudley::Assemble_addToSystemMatrix< cplx_t >(), finley::Assemble_addToSystemMatrix< cplx_t >(), finley::AssembleParameters::AssembleParameters(), dudley::AssembleParameters::AssembleParameters(), balance(), copyRemoteCoupleBlock(), getGlobalTotalNumCols(), getTotalNumCols(), nullifyRows(), nullifyRowsAndCols(), solve(), and SystemMatrix().

## col_coupleBlock

SparseMatrix_ptr paso::SystemMatrix::col_coupleBlock

coupling to neighbouring processors (row - col)

Referenced by ripley::RipleyDomain::addToSystemMatrix(), dudley::Assemble_addToSystemMatrix< cplx_t >(), finley::Assemble_addToSystemMatrix< cplx_t >(), balance(), copyColCoupleBlock(), copyRemoteCoupleBlock(), extendedRowsForST(), fillWithGlobalCoordinates(), getGlobalSize(), MatrixVector_CSR_OFFSET0(), mergeMainAndCouple_CSR_OFFSET0(), mergeMainAndCouple_CSR_OFFSET0_Block(), nullifyRows(), nullifyRowsAndCols(), print(), rowSum(), setValues(), and SystemMatrix().

## col_coupler

Coupler_ptr<real_t> paso::SystemMatrix::col_coupler

Referenced by copyColCoupleBlock(), copyRemoteCoupleBlock(), extendedRowsForST(), fillWithGlobalCoordinates(), finishColCollect(), getColOverlap(), mergeMainAndCouple_CSR_OFFSET0(), mergeMainAndCouple_CSR_OFFSET0_Block(), startColCollect(), and SystemMatrix().

## col_distribution

escript::Distribution_ptr paso::SystemMatrix::col_distribution

Referenced by dudley::AssembleParameters::AssembleParameters(), finley::AssembleParameters::AssembleParameters(), copyRemoteCoupleBlock(), extendedRowsForST(), fillWithGlobalCoordinates(), mergeMainAndCouple_CSR_OFFSET0(), mergeMainAndCouple_CSR_OFFSET0_Block(), and SystemMatrix().

## global_id

index_t* paso::SystemMatrix::global_id

mutable

stores the global ids for all cols in col_coupleBlock

Referenced by copyRemoteCoupleBlock(), extendedRowsForST(), mergeMainAndCouple_CSR_OFFSET0(), mergeMainAndCouple_CSR_OFFSET0_Block(), print(), and ~SystemMatrix().

## is_balanced

bool paso::SystemMatrix::is_balanced

Referenced by applyBalance(), applyBalanceInPlace(), balance(), MatrixVector(), and setValues().

## logical_col_block_size

dim_t paso::SystemMatrix::logical_col_block_size

## logical_row_block_size

dim_t paso::SystemMatrix::logical_row_block_size

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

## mainBlock

SparseMatrix_ptr paso::SystemMatrix::mainBlock

main block

Referenced by ripley::RipleyDomain::addToSystemMatrix(), dudley::Assemble_addToSystemMatrix< cplx_t >(), finley::Assemble_addToSystemMatrix< cplx_t >(), balance(), borrowMainDiagonalPointer(), copyBlockFromMainDiagonal(), copyBlockToMainDiagonal(), copyFromMainDiagonal(), copyRemoteCoupleBlock(), copyToMainDiagonal(), extendedRowsForST(), fillWithGlobalCoordinates(), getGlobalSize(), getNumCols(), getNumRows(), makeZeroRowSums(), MatrixVector(), MatrixVector_CSR_OFFSET0(), mergeMainAndCouple_CSR_OFFSET0(), mergeMainAndCouple_CSR_OFFSET0_Block(), mergeSystemMatrix(), nullifyRows(), nullifyRowsAndCols(), print(), rowSum(), saveHB(), saveMM(), setValues(), solve(), paso::solve_free(), and SystemMatrix().

## mpi_info

escript::JMPI paso::SystemMatrix::mpi_info

Referenced by borrowMainDiagonalPointer(), copyColCoupleBlock(), copyRemoteCoupleBlock(), extendedRowsForST(), fillWithGlobalCoordinates(), getGlobalSize(), loadMM_toCSC(), loadMM_toCSR(), MatrixVector(), mergeMainAndCouple_CSR_OFFSET0(), mergeMainAndCouple_CSR_OFFSET0_Block(), mergeSystemMatrix(), nullifyRowsAndCols(), print(), rowSum(), saveHB(), saveMM(), solve(), and SystemMatrix().

## pattern

SystemMatrixPattern_ptr paso::SystemMatrix::pattern

Referenced by ripley::RipleyDomain::addToSystemMatrix(), dudley::Assemble_addToSystemMatrix< cplx_t >(), finley::Assemble_addToSystemMatrix< cplx_t >(), copyColCoupleBlock(), copyRemoteCoupleBlock(), fillWithGlobalCoordinates(), loadMM_toCSC(), loadMM_toCSR(), makeZeroRowSums(), print(), and SystemMatrix().

## remote_coupleBlock

SparseMatrix_ptr paso::SystemMatrix::remote_coupleBlock

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

Referenced by copyRemoteCoupleBlock(), and print().

## row_block_size

dim_t paso::SystemMatrix::row_block_size

Referenced by ripley::RipleyDomain::addToSystemMatrix(), dudley::Assemble_addToSystemMatrix< cplx_t >(), finley::Assemble_addToSystemMatrix< cplx_t >(), finley::AssembleParameters::AssembleParameters(), dudley::AssembleParameters::AssembleParameters(), balance(), copyRemoteCoupleBlock(), getGlobalTotalNumRows(), getTotalNumRows(), makeZeroRowSums(), nullifyRows(), nullifyRowsAndCols(), rowSum(), solve(), and SystemMatrix().

## row_coupleBlock

SparseMatrix_ptr paso::SystemMatrix::row_coupleBlock

coupling to neighbouring processors (col - row)

Referenced by ripley::RipleyDomain::addToSystemMatrix(), dudley::Assemble_addToSystemMatrix< cplx_t >(), finley::Assemble_addToSystemMatrix< cplx_t >(), balance(), copyColCoupleBlock(), copyRemoteCoupleBlock(), extendedRowsForST(), fillWithGlobalCoordinates(), nullifyRows(), nullifyRowsAndCols(), print(), setValues(), and SystemMatrix().

## row_coupler

Coupler_ptr<real_t> paso::SystemMatrix::row_coupler

Referenced by copyColCoupleBlock(), copyRemoteCoupleBlock(), extendedRowsForST(), finishRowCollect(), getRowOverlap(), startRowCollect(), and SystemMatrix().

## row_distribution

escript::Distribution_ptr paso::SystemMatrix::row_distribution

Referenced by dudley::AssembleParameters::AssembleParameters(), finley::AssembleParameters::AssembleParameters(), fillWithGlobalCoordinates(), mergeMainAndCouple_CSR_OFFSET0(), mergeMainAndCouple_CSR_OFFSET0_Block(), mergeSystemMatrix(), and SystemMatrix().

## solver_p

void* paso::SystemMatrix::solver_p

pointer to data needed by a solver

Referenced by freePreconditioner(), setPreconditioner(), paso::solve_free(), and solvePreconditioner().

## solver_package

index_t paso::SystemMatrix::solver_package

mutable

package code controlling the solver pointer

Referenced by solve(), and paso::solve_free().

## type

SystemMatrixType paso::SystemMatrix::type

Referenced by ripley::RipleyDomain::addToSystemMatrix(), dudley::Assemble_addToSystemMatrix< cplx_t >(), finley::Assemble_addToSystemMatrix< cplx_t >(), dudley::Assemble_addToSystemMatrix< real_t >(), finley::Assemble_addToSystemMatrix< real_t >(), balance(), MatrixVector(), MatrixVector_CSR_OFFSET0(), mergeMainAndCouple(), nullifyRows(), nullifyRowsAndCols(), and SystemMatrix().

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

- SystemMatrix.h
- solve.cpp
- SystemMatrix.cpp
- SystemMatrix_copyRemoteCoupleBlock.cpp
- SystemMatrix_debug.cpp
- SystemMatrix_extendedRows.cpp
- SystemMatrix_loadMM.cpp
- SystemMatrix_MatrixVector.cpp
- SystemMatrix_mergeMainAndCouple.cpp