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 (escript::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 (bool preserveSolverData=false)
 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...
 
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...
 

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

escript::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

◆ SystemMatrix()

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

◆ ~SystemMatrix()

virtual ripley::SystemMatrix::~SystemMatrix ( )
inlinevirtual

Member Function Documentation

◆ add()

void ripley::SystemMatrix::add ( const IndexVector rowIndex,
const std::vector< double > &  array 
)

◆ checkCUDA()

static void ripley::SystemMatrix::checkCUDA ( )
staticprivate

◆ copyMatrixToDevice()

void ripley::SystemMatrix::copyMatrixToDevice ( bool  verbose = false) const
private

copies the current matrix stored on host to device if required

◆ getBlockSize()

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

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

◆ nullifyRowsAndCols()

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.

◆ resetValues()

virtual void ripley::SystemMatrix::resetValues ( bool  preserveSolverData = false)
virtual

resets the matrix entries

Reimplemented from escript::AbstractSystemMatrix.

◆ runSolver()

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

◆ saveHB()

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.

◆ saveMM()

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.

◆ setToSolution()

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.

◆ ypAx()

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

performs y+=this*x

Reimplemented from escript::AbstractSystemMatrix.

Member Data Documentation

◆ cudaDevices

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

GPU device IDs supporting CUDA.

◆ dmat

DeviceMatrixType ripley::SystemMatrix::dmat
mutableprivate

◆ m_mpiInfo

escript::JMPI ripley::SystemMatrix::m_mpiInfo
private

◆ mat

HostMatrixType ripley::SystemMatrix::mat
private

◆ matrixAltered

bool ripley::SystemMatrix::matrixAltered
mutableprivate

◆ symmetric

bool ripley::SystemMatrix::symmetric
private

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