ESScript
Revision_4488
|
#include <SystemMatrixAdapter.h>
Public Member Functions | |
SystemMatrixAdapter () | |
Wrapper for Paso_SystemMatrix. | |
SystemMatrixAdapter (Paso_SystemMatrix *system_matrix, const int row_blocksize, const escript::FunctionSpace &row_functionspace, const int column_blocksize, const escript::FunctionSpace &colum_functionspace) | |
~SystemMatrixAdapter () | |
Destructor for SystemMatrixAdapter. As specified in the constructor this deallocates the pointer given to the constructor. | |
Paso_SystemMatrix * | getPaso_SystemMatrix () const |
Returns the pointer to the system matrix. | |
const escript::AbstractSystemMatrix & | asAbstractSystemMatrix () const |
Returns the system matrix as a const AbstractSystemMatrix&. | |
void | nullifyRowsAndCols (escript::Data &row_q, escript::Data &col_q, const double mdv) const |
nullifyRowsAndCols - calls Paso_SystemMatrix_nullifyRowsAndCols. | |
virtual void | saveMM (const std::string &fileName) const |
writes the matrix to a file using the Matrix Market file format | |
virtual void | saveHB (const std::string &fileName) const |
writes the matrix to a file using the Harwell-Boeing file format | |
virtual void | resetValues () const |
sets the matrix entries to zero | |
void | Print_Matrix_Info (const bool) const |
prints information about a system matrix | |
![]() | |
AbstractSystemMatrix () | |
Default constructor for AbstractSystemMatrix. | |
AbstractSystemMatrix (const int row_blocksize, const FunctionSpace &row_functionspace, const int column_blocksize, const FunctionSpace &column_functionspace) | |
virtual | ~AbstractSystemMatrix () |
Destructor. | |
Data | vectorMultiply (Data &right) const |
matrix*vector multiplication | |
int | isEmpty () const |
returns true if the matrix is empty | |
FunctionSpace | getColumnFunctionSpace () const |
returns the column function space | |
FunctionSpace | getRowFunctionSpace () const |
returns the row function space | |
int | getRowBlockSize () const |
returns the row block size | |
int | getColumnBlockSize () const |
returns the column block size | |
Data | solve (Data &in, boost::python::object &options) const |
returns the solution u of the linear system this*u=in |
Static Public Member Functions | |
static const SystemMatrixAdapter & | asSystemMatrixAdapter (const AbstractSystemMatrix &systemmatrix) |
Returns a system matrix as a const SystemMatrixAdapter&. | |
static int | mapOptionToPaso (const int option) |
maps escript options onto Paso options | |
static int | getSystemMatrixTypeId (const int solver, const int preconditioner, const int package, const bool symmetry, Esys_MPIInfo *mpiInfo) |
returns the identifier of the matrix type to be used for the global stiffness matrix when the given solver, preconditioner and package is used | |
static void | escriptToPasoOptions (Paso_Options *paso_options, const boost::python::object &options) |
extract paso options from SolutionOptions class | |
static void | pasoToEscriptOptions (const Paso_Options *paso_options, boost::python::object &options) |
copies diagnostic data back to the solver options |
Private Member Functions | |
virtual void | setToSolution (escript::Data &out, escript::Data &in, boost::python::object &options) const |
solves the linear system this*out=in | |
virtual void | ypAx (escript::Data &y, escript::Data &x) const |
performs y+=this*x |
Private Attributes | |
boost::shared_ptr < Paso_SystemMatrix > | m_system_matrix |
paso::SystemMatrixAdapter::SystemMatrixAdapter | ( | ) |
Wrapper for Paso_SystemMatrix.
Description: Wrapper for Paso_SystemMatrix. /brief Default Constructor for SystemMatrixAdapter. NB: Only throws an exception.
paso::SystemMatrixAdapter::SystemMatrixAdapter | ( | Paso_SystemMatrix * | system_matrix, |
const int | row_blocksize, | ||
const escript::FunctionSpace & | row_functionspace, | ||
const int | column_blocksize, | ||
const escript::FunctionSpace & | colum_functionspace | ||
) |
/brief Constructor for SystemMatrixAdapter.
References m_system_matrix.
paso::SystemMatrixAdapter::~SystemMatrixAdapter | ( | ) |
Destructor for SystemMatrixAdapter. As specified in the constructor this deallocates the pointer given to the constructor.
References m_system_matrix, and Paso_SystemMatrix_free().
|
inline |
Returns the system matrix as a const AbstractSystemMatrix&.
|
inlinestatic |
Returns a system matrix as a const SystemMatrixAdapter&.
|
static |
extract paso options from SolutionOptions class
References EXTRACT, EXTRACT_OPTION, Paso_Options_setDefaults(), and escript::DataMaths::symmetric().
Referenced by paso::TransportProblemAdapter::setToSolution(), and setToSolution().
Paso_SystemMatrix * paso::SystemMatrixAdapter::getPaso_SystemMatrix | ( | ) | const |
Returns the pointer to the system matrix.
References m_system_matrix.
Referenced by ripley::RipleyDomain::addPDEToSystem(), dudley::MeshAdapter::addPDEToSystem(), finley::MeshAdapter::addPDEToSystem(), nullifyRowsAndCols(), resetValues(), saveHB(), saveMM(), setToSolution(), and ypAx().
|
static |
returns the identifier of the matrix type to be used for the global stiffness matrix when the given solver, preconditioner and package is used
References paso::checkPasoError(), mapOptionToPaso(), and Paso_SystemMatrix_getSystemMatrixTypeId().
|
static |
maps escript options onto Paso options
References ESCRIPT_AGGREGATION_COARSENING, ESCRIPT_AMG, ESCRIPT_AMLI, ESCRIPT_BACKWARD_EULER, ESCRIPT_BICGSTAB, ESCRIPT_BOOMERAMG, ESCRIPT_CGS, ESCRIPT_CHOLEVSKY, ESCRIPT_CIJP_COARSENING, ESCRIPT_CIJP_FIXED_RANDOM_COARSENING, ESCRIPT_CLASSIC_INTERPOLATION, ESCRIPT_CLASSIC_INTERPOLATION_WITH_FF_COUPLING, ESCRIPT_CR, ESCRIPT_CRANK_NICOLSON, ESCRIPT_DEFAULT, ESCRIPT_DEFAULT_REORDERING, ESCRIPT_DIRECT, ESCRIPT_DIRECT_INTERPOLATION, ESCRIPT_FALGOUT_COARSENING, ESCRIPT_GAUSS_SEIDEL, ESCRIPT_GMRES, ESCRIPT_HMIS_COARSENING, ESCRIPT_ILU0, ESCRIPT_ILUT, ESCRIPT_ITERATIVE, ESCRIPT_JACOBI, ESCRIPT_LINEAR_CRANK_NICOLSON, ESCRIPT_LUMPING, ESCRIPT_MINIMUM_FILL_IN, ESCRIPT_MINRES, ESCRIPT_MKL, ESCRIPT_NESTED_DISSECTION, ESCRIPT_NO_PRECONDITIONER, ESCRIPT_NO_REORDERING, ESCRIPT_NONLINEAR_GMRES, ESCRIPT_PASO, ESCRIPT_PASTIX, ESCRIPT_PCG, ESCRIPT_PMIS_COARSENING, ESCRIPT_PRES20, ESCRIPT_REC_ILU, ESCRIPT_RILU, ESCRIPT_RUGE_STUEBEN_COARSENING, ESCRIPT_STANDARD_COARSENING, ESCRIPT_SUPER_LU, ESCRIPT_TFQMR, ESCRIPT_TRILINOS, ESCRIPT_UMFPACK, ESCRIPT_YAIR_SHAPIRA_COARSENING, PASO_AGGREGATION_COARSENING, PASO_AMG, PASO_AMLI, PASO_BACKWARD_EULER, PASO_BICGSTAB, PASO_BOOMERAMG, PASO_CGS, PASO_CHOLEVSKY, PASO_CIJP_COARSENING, PASO_CIJP_FIXED_RANDOM_COARSENING, PASO_CLASSIC_INTERPOLATION, PASO_CLASSIC_INTERPOLATION_WITH_FF_COUPLING, PASO_CR, PASO_CRANK_NICOLSON, PASO_DEFAULT, PASO_DEFAULT_REORDERING, PASO_DIRECT, PASO_DIRECT_INTERPOLATION, PASO_FALGOUT_COARSENING, PASO_GAUSS_SEIDEL, PASO_GMRES, PASO_HMIS_COARSENING, PASO_ILU0, PASO_ILUT, PASO_ITERATIVE, PASO_JACOBI, PASO_LINEAR_CRANK_NICOLSON, PASO_LUMPING, PASO_MINIMUM_FILL_IN, PASO_MINRES, PASO_MKL, PASO_NESTED_DISSECTION, PASO_NO_PRECONDITIONER, PASO_NO_REORDERING, PASO_NONLINEAR_GMRES, PASO_PASO, PASO_PASTIX, PASO_PCG, PASO_PMIS_COARSENING, PASO_PRES20, PASO_REC_ILU, PASO_RILU, PASO_RUGE_STUEBEN_COARSENING, PASO_STANDARD_COARSENING, PASO_SUPER_LU, PASO_TFQMR, PASO_TRILINOS, PASO_UMFPACK, and PASO_YAIR_SHAPIRA_COARSENING.
Referenced by getSystemMatrixTypeId(), and paso::TransportProblemAdapter::getTransportTypeId().
|
virtual |
nullifyRowsAndCols - calls Paso_SystemMatrix_nullifyRowsAndCols.
Reimplemented from escript::AbstractSystemMatrix.
References paso::checkPasoError(), escript::Data::expand(), escript::AbstractSystemMatrix::getColumnBlockSize(), escript::AbstractSystemMatrix::getColumnFunctionSpace(), escript::Data::getDataPointSize(), escript::Data::getFunctionSpace(), getPaso_SystemMatrix(), escript::AbstractSystemMatrix::getRowBlockSize(), escript::AbstractSystemMatrix::getRowFunctionSpace(), escript::Data::getSampleDataRW(), Paso_SystemMatrix_nullifyRowsAndCols(), and escript::Data::requireWrite().
Referenced by BOOST_PYTHON_MODULE().
|
static |
copies diagnostic data back to the solver options
References SET.
Referenced by paso::TransportProblemAdapter::setToSolution(), and setToSolution().
void paso::SystemMatrixAdapter::Print_Matrix_Info | ( | const bool | full = false | ) | const |
prints information about a system matrix
References Paso_SystemMatrix::block_size, Paso_SystemMatrix::col_block_size, Paso_SystemMatrix::col_coupleBlock, Paso_SystemMatrix::col_distribution, Paso_Distribution::first_component, Paso_SystemMatrix::logical_col_block_size, Paso_SystemMatrix::logical_row_block_size, m_system_matrix, Paso_SystemMatrix::mainBlock, MATRIX_FORMAT_BLK1, MATRIX_FORMAT_CSC, MATRIX_FORMAT_DEFAULT, MATRIX_FORMAT_OFFSET1, MATRIX_FORMAT_TRILINOS_CRS, Paso_SystemMatrix::mpi_info, Paso_SparseMatrix::numCols, Paso_Pattern::numOutput, Paso_SparseMatrix::numRows, Paso_SparseMatrix::pattern, Esys_MPIInfo::rank, Paso_SystemMatrix::row_block_size, Paso_SystemMatrix::row_coupleBlock, Paso_SystemMatrix::row_distribution, Esys_MPIInfo::size, and Paso_SystemMatrix::type.
Referenced by BOOST_PYTHON_MODULE().
|
virtual |
sets the matrix entries to zero
Reimplemented from escript::AbstractSystemMatrix.
References paso::checkPasoError(), getPaso_SystemMatrix(), Paso_solve_free(), and Paso_SystemMatrix_setValues().
Referenced by BOOST_PYTHON_MODULE().
|
virtual |
writes the matrix to a file using the Harwell-Boeing file format
Reimplemented from escript::AbstractSystemMatrix.
References paso::checkPasoError(), getPaso_SystemMatrix(), Paso_SystemMatrix_saveHB(), TMPMEMALLOC, and TMPMEMFREE.
Referenced by BOOST_PYTHON_MODULE().
|
virtual |
writes the matrix to a file using the Matrix Market file format
Reimplemented from escript::AbstractSystemMatrix.
References paso::checkPasoError(), getPaso_SystemMatrix(), Paso_SystemMatrix_saveMM(), TMPMEMALLOC, and TMPMEMFREE.
Referenced by BOOST_PYTHON_MODULE().
|
privatevirtual |
solves the linear system this*out=in
References paso::checkPasoError(), escriptToPasoOptions(), escript::Data::expand(), escript::AbstractSystemMatrix::getColumnBlockSize(), escript::AbstractSystemMatrix::getColumnFunctionSpace(), escript::Data::getDataPointSize(), escript::Data::getFunctionSpace(), getPaso_SystemMatrix(), escript::AbstractSystemMatrix::getRowBlockSize(), escript::AbstractSystemMatrix::getRowFunctionSpace(), escript::Data::getSampleDataRW(), Paso_solve(), and pasoToEscriptOptions().
|
privatevirtual |
performs y+=this*x
References paso::checkPasoError(), escript::Data::expand(), escript::AbstractSystemMatrix::getColumnBlockSize(), escript::AbstractSystemMatrix::getColumnFunctionSpace(), escript::Data::getDataPointSize(), escript::Data::getFunctionSpace(), getPaso_SystemMatrix(), escript::AbstractSystemMatrix::getRowBlockSize(), escript::AbstractSystemMatrix::getRowFunctionSpace(), escript::Data::getSampleDataRW(), Paso_SystemMatrix_MatrixVector(), and escript::Data::requireWrite().
|
private |
Referenced by getPaso_SystemMatrix(), Print_Matrix_Info(), SystemMatrixAdapter(), and ~SystemMatrixAdapter().