escript
Revision_
|
#include <SystemMatrixAdapter.h>
Public Member Functions | |
SystemMatrixAdapter () | |
Wrapper for paso::SystemMatrix. More... | |
SystemMatrixAdapter (SystemMatrix_ptr system_matrix, int row_blocksize, const escript::FunctionSpace &row_functionspace, 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. More... | |
SystemMatrix_ptr | getPaso_SystemMatrix () const |
Returns the pointer to the system matrix. More... | |
const escript::AbstractSystemMatrix & | asAbstractSystemMatrix () const |
Returns the system matrix as a const AbstractSystemMatrix&. More... | |
void | nullifyRowsAndCols (escript::Data &row_q, escript::Data &col_q, double mdv) |
nullifyRowsAndCols - calls SystemMatrix::nullifyRowsAndCols. 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 () |
sets the matrix entries to zero More... | |
void | Print_Matrix_Info (bool) const |
prints information about a system matrix More... | |
![]() | |
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... | |
Static Public Member Functions | |
static const SystemMatrixAdapter & | asSystemMatrixAdapter (const AbstractSystemMatrix &systemmatrix) |
Returns a system matrix as a const SystemMatrixAdapter&. More... | |
static int | mapOptionToPaso (int option) |
maps escript options onto Paso options More... | |
static int | getSystemMatrixTypeId (int solver, int preconditioner, int package, const bool symmetry, const esysUtils::JMPI &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 More... | |
static void | escriptToPasoOptions (Options *paso_options, const boost::python::object &options) |
extract paso options from SolutionOptions class More... | |
static void | pasoToEscriptOptions (const Options *paso_options, boost::python::object &options) |
copies diagnostic data back to the solver options 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... | |
Private Attributes | |
SystemMatrix_ptr | 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 | ( | SystemMatrix_ptr | system_matrix, |
int | row_blocksize, | ||
const escript::FunctionSpace & | row_functionspace, | ||
int | column_blocksize, | ||
const escript::FunctionSpace & | colum_functionspace | ||
) |
/brief Constructor for SystemMatrixAdapter.
paso::SystemMatrixAdapter::~SystemMatrixAdapter | ( | ) |
Destructor for SystemMatrixAdapter. As specified in the constructor this deallocates the pointer given to the constructor.
|
inline |
Returns the system matrix as a const AbstractSystemMatrix&.
|
inlinestatic |
Returns a system matrix as a const SystemMatrixAdapter&.
References escriptToPasoOptions(), getSystemMatrixTypeId(), mapOptionToPaso(), nullifyRowsAndCols(), pasoToEscriptOptions(), Print_Matrix_Info(), resetValues(), saveHB(), saveMM(), setToSolution(), and ypAx().
|
static |
extract paso options from SolutionOptions class
References escript::SolverBuddy::_getRestartForC(), paso::Options::absolute_tolerance, paso::Options::accept_failed_convergence, escript::SolverBuddy::acceptConvergenceFailure(), paso::Options::adapt_inner_tolerance, escript::SolverBuddy::adaptInnerTolerance(), paso::Options::coarse_matrix_refinements, paso::Options::coarsening_method, paso::Options::coarsening_threshold, paso::Options::diagonal_dominance_threshold, paso::Options::drop_storage, paso::Options::drop_tolerance, escript::SolverBuddy::getAbsoluteTolerance(), escript::SolverBuddy::getAMGInterpolation(), escript::SolverBuddy::getCoarsening(), escript::SolverBuddy::getCoarseningThreshold(), escript::SolverBuddy::getDiagonalDominanceThreshold(), escript::SolverBuddy::getDropStorage(), escript::SolverBuddy::getDropTolerance(), escript::SolverBuddy::getInnerIterMax(), escript::SolverBuddy::getInnerTolerance(), escript::SolverBuddy::getIterMax(), escript::SolverBuddy::getLevelMax(), escript::SolverBuddy::getMinCoarseMatrixSize(), escript::SolverBuddy::getMinCoarseMatrixSparsity(), escript::SolverBuddy::getNumCoarseMatrixRefinements(), escript::SolverBuddy::getNumPostSweeps(), escript::SolverBuddy::getNumPreSweeps(), escript::SolverBuddy::getNumRefinements(), escript::SolverBuddy::getNumSweeps(), escript::SolverBuddy::getODESolver(), escript::SolverBuddy::getPackage(), escript::SolverBuddy::getPreconditioner(), escript::SolverBuddy::getRelaxationFactor(), escript::SolverBuddy::getReordering(), escript::SolverBuddy::getSmoother(), escript::SolverBuddy::getSolverMethod(), escript::SolverBuddy::getTolerance(), escript::SolverBuddy::getTruncation(), paso::Options::inner_iter_max, paso::Options::inner_tolerance, paso::Options::interpolation_method, escript::SolverBuddy::isSymmetric(), escript::SolverBuddy::isVerbose(), paso::Options::iter_max, paso::Options::level_max, mapOptionToPaso(), paso::Options::method, paso::Options::min_coarse_matrix_size, paso::Options::min_coarse_sparsity, paso::Options::ode_solver, paso::Options::package, paso::Options::post_sweeps, paso::Options::pre_sweeps, paso::Options::preconditioner, paso::Options::refinements, paso::Options::relaxation_factor, paso::Options::reordering, paso::Options::restart, paso::Options::setDefaults(), paso::Options::smoother, paso::Options::sweeps, paso::Options::symmetric, paso::Options::tolerance, paso::Options::truncation, paso::Options::use_local_preconditioner, escript::SolverBuddy::useLocalPreconditioner(), paso::Options::usePanel, escript::SolverBuddy::usePanel(), and paso::Options::verbose.
Referenced by asSystemMatrixAdapter(), paso::TransportProblemAdapter::setToSolution(), and setToSolution().
SystemMatrix_ptr paso::SystemMatrixAdapter::getPaso_SystemMatrix | ( | ) | const |
Returns the pointer to the system matrix.
References m_system_matrix.
Referenced by finley::MeshAdapter::addPDEToSystem(), dudley::MeshAdapter::addPDEToSystem(), and ripley::RipleyDomain::addToSystemMatrix().
|
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(), paso::SystemMatrix::getSystemMatrixTypeId(), and mapOptionToPaso().
Referenced by asSystemMatrixAdapter(), and ripley::RipleyDomain::getSystemMatrixTypeId().
|
static |
maps escript options onto Paso options
References 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_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, PASO_YAIR_SHAPIRA_COARSENING, escript::SO_COARSENING_AGGREGATION, escript::SO_COARSENING_CIJP, escript::SO_COARSENING_CIJP_FIXED_RANDOM, escript::SO_COARSENING_FALGOUT, escript::SO_COARSENING_HMIS, escript::SO_COARSENING_PMIS, escript::SO_COARSENING_RUGE_STUEBEN, escript::SO_COARSENING_STANDARD, escript::SO_COARSENING_YAIR_SHAPIRA, escript::SO_DEFAULT, escript::SO_INTERPOLATION_CLASSIC, escript::SO_INTERPOLATION_CLASSIC_WITH_FF_COUPLING, escript::SO_INTERPOLATION_DIRECT, escript::SO_METHOD_BICGSTAB, escript::SO_METHOD_CGS, escript::SO_METHOD_CHOLEVSKY, escript::SO_METHOD_CR, escript::SO_METHOD_DIRECT, escript::SO_METHOD_GMRES, escript::SO_METHOD_ITERATIVE, escript::SO_METHOD_MINRES, escript::SO_METHOD_NONLINEAR_GMRES, escript::SO_METHOD_PCG, escript::SO_METHOD_PRES20, escript::SO_METHOD_TFQMR, escript::SO_ODESOLVER_BACKWARD_EULER, escript::SO_ODESOLVER_CRANK_NICOLSON, escript::SO_ODESOLVER_LINEAR_CRANK_NICOLSON, escript::SO_PACKAGE_MKL, escript::SO_PACKAGE_PASO, escript::SO_PACKAGE_PASTIX, escript::SO_PACKAGE_SUPER_LU, escript::SO_PACKAGE_TRILINOS, escript::SO_PACKAGE_UMFPACK, escript::SO_PRECONDITIONER_AMG, escript::SO_PRECONDITIONER_AMLI, escript::SO_PRECONDITIONER_BOOMERAMG, escript::SO_PRECONDITIONER_GAUSS_SEIDEL, escript::SO_PRECONDITIONER_ILU0, escript::SO_PRECONDITIONER_ILUT, escript::SO_PRECONDITIONER_JACOBI, escript::SO_PRECONDITIONER_NONE, escript::SO_PRECONDITIONER_REC_ILU, escript::SO_PRECONDITIONER_RILU, escript::SO_REORDERING_DEFAULT, escript::SO_REORDERING_MINIMUM_FILL_IN, escript::SO_REORDERING_NESTED_DISSECTION, and escript::SO_REORDERING_NONE.
Referenced by asSystemMatrixAdapter(), escriptToPasoOptions(), getSystemMatrixTypeId(), and paso::TransportProblemAdapter::getTransportTypeId().
|
virtual |
nullifyRowsAndCols - calls SystemMatrix::nullifyRowsAndCols.
Reimplemented from escript::AbstractSystemMatrix.
References paso::checkPasoError(), escript::Data::expand(), escript::AbstractSystemMatrix::getColumnBlockSize(), escript::AbstractSystemMatrix::getColumnFunctionSpace(), escript::Data::getDataPointSize(), escript::Data::getFunctionSpace(), escript::AbstractSystemMatrix::getRowBlockSize(), escript::AbstractSystemMatrix::getRowFunctionSpace(), escript::Data::getSampleDataRW(), m_system_matrix, and escript::Data::requireWrite().
Referenced by asSystemMatrixAdapter(), and BOOST_PYTHON_MODULE().
|
static |
copies diagnostic data back to the solver options
References SET.
Referenced by asSystemMatrixAdapter(), paso::TransportProblemAdapter::setToSolution(), and setToSolution().
void paso::SystemMatrixAdapter::Print_Matrix_Info | ( | bool | full = false | ) | const |
prints information about a system matrix
References m_system_matrix, MATRIX_FORMAT_BLK1, MATRIX_FORMAT_CSC, MATRIX_FORMAT_DEFAULT, MATRIX_FORMAT_OFFSET1, and MATRIX_FORMAT_TRILINOS_CRS.
Referenced by asSystemMatrixAdapter(), and BOOST_PYTHON_MODULE().
|
virtual |
sets the matrix entries to zero
Reimplemented from escript::AbstractSystemMatrix.
References paso::checkPasoError(), m_system_matrix, and paso::solve_free().
Referenced by asSystemMatrixAdapter(), and BOOST_PYTHON_MODULE().
|
virtual |
writes the matrix to a file using the Harwell-Boeing file format
Reimplemented from escript::AbstractSystemMatrix.
References paso::checkPasoError(), and m_system_matrix.
Referenced by asSystemMatrixAdapter(), and BOOST_PYTHON_MODULE().
|
virtual |
writes the matrix to a file using the Matrix Market file format
Reimplemented from escript::AbstractSystemMatrix.
References paso::checkPasoError(), and m_system_matrix.
Referenced by asSystemMatrixAdapter(), and BOOST_PYTHON_MODULE().
|
privatevirtual |
solves the linear system this*out=in
Reimplemented from escript::AbstractSystemMatrix.
References paso::checkPasoError(), escriptToPasoOptions(), escript::Data::expand(), escript::AbstractSystemMatrix::getColumnBlockSize(), escript::AbstractSystemMatrix::getColumnFunctionSpace(), escript::Data::getDataPointSize(), escript::Data::getFunctionSpace(), escript::AbstractSystemMatrix::getRowBlockSize(), escript::AbstractSystemMatrix::getRowFunctionSpace(), escript::Data::getSampleDataRW(), m_system_matrix, pasoToEscriptOptions(), escript::Data::requireWrite(), and paso::solve().
Referenced by asSystemMatrixAdapter().
|
privatevirtual |
performs y+=this*x
Reimplemented from escript::AbstractSystemMatrix.
References paso::checkPasoError(), escript::Data::expand(), escript::AbstractSystemMatrix::getColumnBlockSize(), escript::AbstractSystemMatrix::getColumnFunctionSpace(), escript::Data::getDataPointSize(), escript::Data::getFunctionSpace(), escript::AbstractSystemMatrix::getRowBlockSize(), escript::AbstractSystemMatrix::getRowFunctionSpace(), escript::Data::getSampleDataRW(), m_system_matrix, escript::Data::requireWrite(), and paso::SystemMatrix_MatrixVector().
Referenced by asSystemMatrixAdapter().
|
private |
Referenced by getPaso_SystemMatrix(), nullifyRowsAndCols(), Print_Matrix_Info(), resetValues(), saveHB(), saveMM(), setToSolution(), and ypAx().