escript  Revision_
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ripley::SystemMatrix Class Reference

#include <RipleySystemMatrix.h>

Inheritance diagram for ripley::SystemMatrix:
escript::AbstractSystemMatrix

Public Member Functions

 SystemMatrix (esysUtils::JMPI mpiInfo, int blocksize, const escript::FunctionSpace &fs, int nRows, const IndexVector &diagonalOffsets, bool symmetric)
 
virtual ~SystemMatrix ()
 
virtual void nullifyRowsAndCols (escript::Data &row_q, escript::Data &col_q, double mdv)
 sets matrix entries to zero in specified rows and columns. The rows and columns are marked by positive values in row_q and col_q. Values on the main diagonal which are marked to set to zero by both row_q and col_q are set to mdv (main diagonal value). More...
 
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 ()
 resets the matrix entries More...
 
void add (const IndexVector &rowIndex, const std::vector< double > &array)
 
int getBlockSize () 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...
 
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...
 

Private Member Functions

template<class LinearOperator , class Vector , class Preconditioner >
void runSolver (LinearOperator &A, Vector &x, Vector &b, Preconditioner &M, escript::SolverBuddy &sb) const
 
void copyMatrixToDevice (bool verbose=false) const
 copies the current matrix stored on host to device if required More...
 
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...
 

Static Private Member Functions

static void checkCUDA ()
 

Private Attributes

esysUtils::JMPI m_mpiInfo
 
HostMatrixType mat
 
DeviceMatrixType dmat
 
bool matrixAltered
 
bool symmetric
 

Static Private Attributes

static std::vector< int > cudaDevices
 GPU device IDs supporting CUDA. More...
 

Constructor & Destructor Documentation

ripley::SystemMatrix::SystemMatrix ( esysUtils::JMPI  mpiInfo,
int  blocksize,
const escript::FunctionSpace fs,
int  nRows,
const IndexVector diagonalOffsets,
bool  symmetric 
)
virtual ripley::SystemMatrix::~SystemMatrix ( )
inlinevirtual

Member Function Documentation

void ripley::SystemMatrix::add ( const IndexVector rowIndex,
const std::vector< double > &  array 
)
static void ripley::SystemMatrix::checkCUDA ( )
staticprivate
void ripley::SystemMatrix::copyMatrixToDevice ( bool  verbose = false) const
private

copies the current matrix stored on host to device if required

int ripley::SystemMatrix::getBlockSize ( ) const
inline

References paso::M, and escript::Vector().

virtual void ripley::SystemMatrix::nullifyRowsAndCols ( escript::Data row_q,
escript::Data col_q,
double  mdv 
)
virtual

sets matrix entries to zero in specified rows and columns. The rows and columns are marked by positive values in row_q and col_q. Values on the main diagonal which are marked to set to zero by both row_q and col_q are set to mdv (main diagonal value).

Reimplemented from escript::AbstractSystemMatrix.

virtual void ripley::SystemMatrix::resetValues ( )
virtual

resets the matrix entries

Reimplemented from escript::AbstractSystemMatrix.

template<class LinearOperator , class Vector , class Preconditioner >
void ripley::SystemMatrix::runSolver ( LinearOperator &  A,
Vector &  x,
Vector &  b,
Preconditioner &  M,
escript::SolverBuddy sb 
) const
private
virtual void ripley::SystemMatrix::saveHB ( const std::string &  filename) const
virtual

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

Reimplemented from escript::AbstractSystemMatrix.

virtual void ripley::SystemMatrix::saveMM ( const std::string &  filename) const
virtual

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

Reimplemented from escript::AbstractSystemMatrix.

virtual void ripley::SystemMatrix::setToSolution ( escript::Data out,
escript::Data in,
boost::python::object &  options 
) const
privatevirtual

solves the linear system this*out=in

Reimplemented from escript::AbstractSystemMatrix.

virtual void ripley::SystemMatrix::ypAx ( escript::Data y,
escript::Data x 
) const
privatevirtual

performs y+=this*x

Reimplemented from escript::AbstractSystemMatrix.

Member Data Documentation

std::vector<int> ripley::SystemMatrix::cudaDevices
staticprivate

GPU device IDs supporting CUDA.

DeviceMatrixType ripley::SystemMatrix::dmat
mutableprivate
esysUtils::JMPI ripley::SystemMatrix::m_mpiInfo
private
HostMatrixType ripley::SystemMatrix::mat
private
bool ripley::SystemMatrix::matrixAltered
mutableprivate
bool ripley::SystemMatrix::symmetric
private

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