escript
Revision_4925
|
#include <SystemMatrixAdapter.h>
Public Member Functions | |
SystemMatrixAdapter () | |
Wrapper for paso::SystemMatrix. More... | |
SystemMatrixAdapter (SystemMatrix_ptr 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. 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, const double mdv) const |
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 () const |
sets the matrix entries to zero More... | |
void | Print_Matrix_Info (const bool) const |
prints information about a system matrix More... | |
![]() | |
AbstractSystemMatrix () | |
Default constructor for AbstractSystemMatrix. More... | |
AbstractSystemMatrix (const int row_blocksize, const FunctionSpace &row_functionspace, const int column_blocksize, const FunctionSpace &column_functionspace) | |
virtual | ~AbstractSystemMatrix () |
Destructor. More... | |
Data | vectorMultiply (Data &right) const |
matrix*vector multiplication More... | |
int | 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 (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 (const int option) |
maps escript options onto Paso options More... | |
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 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, |
const int | row_blocksize, | ||
const escript::FunctionSpace & | row_functionspace, | ||
const 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&.
|
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 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 ripley::RipleyDomain::addPDEToSystem(), dudley::MeshAdapter::addPDEToSystem(), finley::MeshAdapter::addPDEToSystem(), and ripley::RipleyDomain::addToSystem().
|
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().
|
static |
maps escript options onto Paso options
References escript::ESCRIPT_AGGREGATION_COARSENING, escript::ESCRIPT_AMG, escript::ESCRIPT_AMLI, escript::ESCRIPT_BACKWARD_EULER, escript::ESCRIPT_BICGSTAB, escript::ESCRIPT_BOOMERAMG, escript::ESCRIPT_CGS, escript::ESCRIPT_CHOLEVSKY, escript::ESCRIPT_CIJP_COARSENING, escript::ESCRIPT_CIJP_FIXED_RANDOM_COARSENING, escript::ESCRIPT_CLASSIC_INTERPOLATION, escript::ESCRIPT_CLASSIC_INTERPOLATION_WITH_FF_COUPLING, escript::ESCRIPT_CR, escript::ESCRIPT_CRANK_NICOLSON, escript::ESCRIPT_DEFAULT, escript::ESCRIPT_DEFAULT_REORDERING, escript::ESCRIPT_DIRECT, escript::ESCRIPT_DIRECT_INTERPOLATION, escript::ESCRIPT_FALGOUT_COARSENING, escript::ESCRIPT_GAUSS_SEIDEL, escript::ESCRIPT_GMRES, escript::ESCRIPT_HMIS_COARSENING, escript::ESCRIPT_ILU0, escript::ESCRIPT_ILUT, escript::ESCRIPT_ITERATIVE, escript::ESCRIPT_JACOBI, escript::ESCRIPT_LINEAR_CRANK_NICOLSON, escript::ESCRIPT_LUMPING, escript::ESCRIPT_MINIMUM_FILL_IN, escript::ESCRIPT_MINRES, escript::ESCRIPT_MKL, escript::ESCRIPT_NESTED_DISSECTION, escript::ESCRIPT_NO_PRECONDITIONER, escript::ESCRIPT_NO_REORDERING, escript::ESCRIPT_NONLINEAR_GMRES, escript::ESCRIPT_PASO, escript::ESCRIPT_PASTIX, escript::ESCRIPT_PCG, escript::ESCRIPT_PMIS_COARSENING, escript::ESCRIPT_PRES20, escript::ESCRIPT_REC_ILU, escript::ESCRIPT_RILU, escript::ESCRIPT_RUGE_STUEBEN_COARSENING, escript::ESCRIPT_STANDARD_COARSENING, escript::ESCRIPT_SUPER_LU, escript::ESCRIPT_TFQMR, escript::ESCRIPT_TRILINOS, escript::ESCRIPT_UMFPACK, escript::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 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 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 m_system_matrix, MATRIX_FORMAT_BLK1, MATRIX_FORMAT_CSC, MATRIX_FORMAT_DEFAULT, MATRIX_FORMAT_OFFSET1, and MATRIX_FORMAT_TRILINOS_CRS.
Referenced by 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 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 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 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(), and paso::solve().
|
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().
|
private |
Referenced by getPaso_SystemMatrix(), nullifyRowsAndCols(), Print_Matrix_Info(), resetValues(), saveHB(), saveMM(), setToSolution(), and ypAx().