#include "Common.h"
#include "SparseMatrix.h"
#include "SystemMatrixPattern.h"
#include "Options.h"
#include "Paso_MPI.h"
#include "Paso.h"
#include "Coupler.h"
Go to the source code of this file.
#define MATRIX_FORMAT_BLK1 4 |
#define MATRIX_FORMAT_CSC 1 |
#define MATRIX_FORMAT_DEFAULT 0 |
#define MATRIX_FORMAT_OFFSET1 8 |
#define MATRIX_FORMAT_SYM 2 |
#define MATRIX_FORMAT_TRILINOS_CRS 16 |
typedef int Paso_SystemMatrixType |
void Paso_RHS_loadMM_toCSR | ( | char * | fileName_p, | |
double * | b, | |||
dim_t | size | |||
) |
References IO_ERROR, M, mm_is_array, mm_is_general, mm_is_real, mm_read_banner(), mm_read_mtx_array_size(), N, nz, Paso_noError(), Paso_resetError(), Paso_setError(), and TYPE_ERROR.
void Paso_solve | ( | Paso_SystemMatrix * | A, | |
double * | out, | |||
double * | in, | |||
Paso_Options * | options | |||
) |
References Paso_Options::accept_failed_convergence, Paso_SystemMatrix::col_block_size, DIVERGED, Paso_Options::method, Paso_SystemMatrix::mpi_info, Paso_Options::package, Paso_getErrorType(), Paso_MKL(), PASO_MKL, Paso_noError(), Paso_Options_getPackage(), PASO_PASO, Paso_resetError(), Paso_setError(), Paso_Solver(), Paso_SystemMatrix_getGlobalNumCols(), Paso_SystemMatrix_getGlobalNumRows(), Paso_UMFPACK(), PASO_UMFPACK, Performance_close(), Performance_open(), Paso_SystemMatrix::row_block_size, Paso_MPIInfo::size, Paso_SystemMatrix::solver_package, Paso_Options::symmetric, VALUE_ERROR, and Paso_Options::verbose.
Referenced by finley::SystemMatrixAdapter::setToSolution().
void Paso_solve_free | ( | Paso_SystemMatrix * | in | ) |
void Paso_SparseMatrix_nullifyRows_CSR | ( | Paso_SparseMatrix * | , | |
double * | , | |||
double | ||||
) |
References Paso_SparseMatrix::block_size, Paso_SparseMatrix::col_block_size, Paso_Pattern::index, MATRIX_FORMAT_OFFSET1, Paso_Pattern::numOutput, Paso_SparseMatrix::pattern, Paso_Pattern::ptr, Paso_SparseMatrix::row_block_size, Paso_SparseMatrix::type, and Paso_SparseMatrix::val.
Referenced by Paso_SystemMatrix_nullifyRows().
void Paso_SystemMatrix_add | ( | Paso_SystemMatrix * | , | |
dim_t | , | |||
index_t * | , | |||
dim_t | , | |||
dim_t | , | |||
index_t * | , | |||
dim_t | , | |||
double * | ||||
) |
Paso_SystemMatrix* Paso_SystemMatrix_alloc | ( | Paso_SystemMatrixType | , | |
Paso_SystemMatrixPattern * | , | |||
dim_t | , | |||
dim_t | , | |||
const bool_t | patternIsUnrolled | |||
) |
References Paso_SystemMatrix::block_size, Paso_SystemMatrix::col_block_size, Paso_SystemMatrixPattern::col_connector, Paso_SystemMatrix::col_coupleBlock, Paso_SystemMatrixPattern::col_couplePattern, Paso_SystemMatrix::col_coupler, Paso_SystemMatrix::col_distribution, FALSE, Paso_SystemMatrixPattern::input_distribution, Paso_SystemMatrix::logical_col_block_size, Paso_SystemMatrix::logical_row_block_size, Paso_SystemMatrix::mainBlock, Paso_SystemMatrixPattern::mainPattern, MATRIX_FORMAT_BLK1, MATRIX_FORMAT_CSC, MATRIX_FORMAT_OFFSET1, MATRIX_FORMAT_SYM, MATRIX_FORMAT_TRILINOS_CRS, MEMALLOC, Paso_SystemMatrixPattern::mpi_info, Paso_SystemMatrix::mpi_info, Paso_SystemMatrix::normalizer, Paso_SystemMatrix::normalizer_is_valid, Paso_SparseMatrix::numCols, Paso_SparseMatrix::numRows, Paso_SystemMatrixPattern::output_distribution, Paso_checkPtr(), Paso_Coupler_alloc(), Paso_Distribution_getReference(), Paso_MPIInfo_getReference(), Paso_noError(), PASO_PASO, Paso_resetError(), Paso_setError(), Paso_SparseMatrix_alloc(), Paso_SystemMatrix_free(), Paso_SystemMatrixPattern_getReference(), Paso_SystemMatrixPattern_unrollBlocks(), Paso_TRILINOS_alloc(), Paso_SystemMatrix::pattern, PATTERN_FORMAT_DEFAULT, PATTERN_FORMAT_OFFSET1, Paso_SystemMatrix::reference_counter, Paso_SystemMatrix::row_block_size, Paso_SystemMatrixPattern::row_connector, Paso_SystemMatrix::row_coupleBlock, Paso_SystemMatrixPattern::row_couplePattern, Paso_SystemMatrix::row_coupler, Paso_SystemMatrix::row_distribution, Paso_SystemMatrix::solver, Paso_SystemMatrix::solver_package, Paso_SystemMatrix::trilinos_data, TRUE, Paso_SystemMatrix::type, Paso_SystemMatrixPattern::type, TYPE_ERROR, and XNOR.
Referenced by finley::MeshAdapter::newSystemMatrix(), Paso_FCTransportProblem_alloc(), Paso_FCTransportProblem_setLowOrderOperator(), Paso_SolverFCT_solve(), Paso_SystemMatrix_loadMM_toCSC(), and Paso_SystemMatrix_loadMM_toCSR().
double* Paso_SystemMatrix_borrowNormalization | ( | Paso_SystemMatrix * | A | ) |
References ABS, Paso_SystemMatrix::col_coupleBlock, Paso_SystemMatrix::mainBlock, MATRIX_FORMAT_CSC, MATRIX_FORMAT_OFFSET1, MATRIX_FORMAT_SYM, Paso_SystemMatrix::mpi_info, Paso_SystemMatrix::normalizer, Paso_SystemMatrix::normalizer_is_valid, Paso_SparseMatrix::numRows, Paso_checkPtr(), Paso_MPIInfo_noError(), Paso_setError(), Paso_SparseMatrix_addAbsRow_CSR_OFFSET0(), Paso_SparseMatrix::pattern, Paso_Pattern::ptr, Paso_SystemMatrix::row_block_size, SYSTEM_ERROR, TRUE, Paso_SystemMatrix::type, TYPE_ERROR, and ZERO_DIVISION_ERROR.
Referenced by Paso_Solver().
double* Paso_SystemMatrix_finishColCollect | ( | Paso_SystemMatrix * | A | ) |
References Paso_SystemMatrix::col_coupler, Paso_Coupler_finishCollect(), and Paso_Coupler::recv_buffer.
Referenced by Paso_SystemMatrix_finishCollect(), and Paso_SystemMatrix_nullifyRowsAndCols().
double* Paso_SystemMatrix_finishCollect | ( | Paso_SystemMatrix * | A | ) |
References Paso_SystemMatrix_finishColCollect().
Referenced by Paso_SystemMatrix_MatrixVector_CSR_OFFSET0().
double* Paso_SystemMatrix_finishRowCollect | ( | Paso_SystemMatrix * | A | ) |
References Paso_Coupler_finishCollect(), Paso_Coupler::recv_buffer, and Paso_SystemMatrix::row_coupler.
Referenced by Paso_SystemMatrix_nullifyRows(), and Paso_SystemMatrix_nullifyRowsAndCols().
void Paso_SystemMatrix_free | ( | Paso_SystemMatrix * | ) |
References Paso_SystemMatrix::col_coupleBlock, Paso_SystemMatrix::col_coupler, Paso_SystemMatrix::col_distribution, Paso_SystemMatrix::mainBlock, MEMFREE, Paso_SystemMatrix::mpi_info, Paso_SystemMatrix::normalizer, Paso_Coupler_free(), Paso_Distribution_free(), Paso_MPIInfo_free(), Paso_solve_free(), Paso_SparseMatrix_free(), Paso_SystemMatrixPattern_free(), Paso_TRILINOS_free(), Paso_SystemMatrix::pattern, Paso_SystemMatrix::reference_counter, Paso_SystemMatrix::row_coupleBlock, Paso_SystemMatrix::row_coupler, Paso_SystemMatrix::row_distribution, and Paso_SystemMatrix::trilinos_data.
Referenced by Paso_FCTransportProblem_free(), Paso_Function_LinearSystem_free(), Paso_SolverFCT_solve(), Paso_SystemMatrix_alloc(), and finley::SystemMatrixAdapter::~SystemMatrixAdapter().
dim_t Paso_SystemMatrix_getGlobalNumCols | ( | Paso_SystemMatrix * | ) |
dim_t Paso_SystemMatrix_getGlobalNumRows | ( | Paso_SystemMatrix * | ) |
dim_t Paso_SystemMatrix_getNumOutput | ( | Paso_SystemMatrix * | A | ) |
References Paso_SystemMatrixPattern_getNumOutput(), and Paso_SystemMatrix::pattern.
Paso_SystemMatrix* Paso_SystemMatrix_getReference | ( | Paso_SystemMatrix * | ) |
int Paso_SystemMatrix_getSystemMatrixTypeId | ( | const index_t | solver, | |
const index_t | preconditioner, | |||
const index_t | package, | |||
const bool_t | symmetry, | |||
Paso_MPIInfo * | mpi_info | |||
) |
References MATRIX_FORMAT_BLK1, MATRIX_FORMAT_CSC, MATRIX_FORMAT_DEFAULT, MATRIX_FORMAT_OFFSET1, MATRIX_FORMAT_TRILINOS_CRS, PASO_MKL, Paso_Options_getPackage(), PASO_PASO, Paso_setError(), PASO_TRILINOS, PASO_UMFPACK, Paso_MPIInfo::size, and VALUE_ERROR.
Referenced by finley::MeshAdapter::getSystemMatrixTypeId().
dim_t Paso_SystemMatrix_getTotalNumCols | ( | const Paso_SystemMatrix * | ) |
References Paso_SystemMatrix::col_block_size, Paso_SystemMatrix::mainBlock, and Paso_SparseMatrix::numCols.
Referenced by Paso_Solver().
dim_t Paso_SystemMatrix_getTotalNumRows | ( | const Paso_SystemMatrix * | A | ) |
References Paso_SystemMatrix::mainBlock, Paso_SparseMatrix::numRows, and Paso_SystemMatrix::row_block_size.
Referenced by Paso_FCT_setUp(), Paso_FCT_setUpRightHandSide(), Paso_FCTransportProblem_addCorrectedFluxes(), Paso_FCTransportProblem_alloc(), Paso_FCTransportProblem_applyPreAntiDiffusionCorrection(), Paso_FCTransportProblem_checkinSolution(), Paso_FCTransportProblem_getSafeTimeStepSize(), Paso_FCTransportProblem_getTotalNumRows(), Paso_FCTransportProblem_insertConstraint(), Paso_FCTransportProblem_setAntiDiffusionFlux(), Paso_FCTransportProblem_setLowOrderOperator(), Paso_FCTransportProblem_setRs(), Paso_FCTransportProblem_setUpConstraint(), Paso_Function_LinearSystem_alloc(), Paso_Solver(), Paso_Solver_BiCGStab(), Paso_Solver_GMRES(), Paso_Solver_MINRES(), Paso_Solver_PCG(), Paso_Solver_TFQMR(), Paso_SolverFCT_setMuPaLuPbQ(), Paso_SolverFCT_setQs(), and Paso_SolverFCT_solve().
Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSC | ( | char * | ) |
References IO_ERROR, M, Paso_SystemMatrix::mainBlock, MATRIX_FORMAT_CSC, MEMALLOC, MEMFREE, mm_is_general, mm_is_real, mm_is_sparse, mm_read_banner(), mm_read_mtx_crd_size(), MPI_COMM_WORLD, N, nz, Paso_Connector_alloc(), Paso_Connector_free(), Paso_Distribution_alloc(), Paso_Distribution_free(), Paso_MPIInfo_alloc(), Paso_MPIInfo_free(), Paso_Pattern_alloc(), Paso_Pattern_free(), Paso_resetError(), Paso_setError(), Paso_SharedComponents_alloc(), Paso_SharedComponents_free(), Paso_SystemMatrix_alloc(), Paso_SystemMatrixPattern_alloc(), Paso_SystemMatrixPattern_free(), PATTERN_FORMAT_DEFAULT, q_sort(), Paso_MPIInfo::size, TRUE, TYPE_ERROR, and Paso_SparseMatrix::val.
Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSR | ( | char * | ) |
References IO_ERROR, M, Paso_SystemMatrix::mainBlock, MATRIX_FORMAT_DEFAULT, MEMALLOC, MEMFREE, MEMORY_ERROR, mm_is_general, mm_is_real, mm_is_sparse, mm_read_banner(), mm_read_mtx_crd_size(), MPI_COMM_WORLD, N, nz, Paso_Connector_alloc(), Paso_Connector_free(), Paso_Distribution_alloc(), Paso_Distribution_free(), Paso_MPIInfo_alloc(), Paso_MPIInfo_free(), Paso_Pattern_alloc(), Paso_Pattern_free(), Paso_resetError(), Paso_setError(), Paso_SharedComponents_alloc(), Paso_SharedComponents_free(), Paso_SystemMatrix_alloc(), Paso_SystemMatrixPattern_alloc(), Paso_SystemMatrixPattern_free(), PATTERN_FORMAT_DEFAULT, q_sort(), Paso_MPIInfo::size, TRUE, TYPE_ERROR, and Paso_SparseMatrix::val.
void Paso_SystemMatrix_MatrixVector | ( | const double | alpha, | |
Paso_SystemMatrix * | A, | |||
const double * | in, | |||
const double | beta, | |||
double * | out | |||
) |
References Paso_SystemMatrix::mainBlock, MATRIX_FORMAT_CSC, MATRIX_FORMAT_OFFSET1, MATRIX_FORMAT_TRILINOS_CRS, Paso_SystemMatrix::mpi_info, Paso_noError(), Paso_setError(), Paso_SparseMatrix_MatrixVector_CSC_OFFSET0(), Paso_SparseMatrix_MatrixVector_CSC_OFFSET1(), Paso_SparseMatrix_MatrixVector_CSR_OFFSET1(), Paso_SystemMatrix_MatrixVector_CSR_OFFSET0(), Paso_MPIInfo::size, SYSTEM_ERROR, and Paso_SystemMatrix::type.
Referenced by finley::TransportProblemAdapter::copyConstraint(), and finley::SystemMatrixAdapter::ypAx().
void Paso_SystemMatrix_MatrixVector_CSR_OFFSET0 | ( | double | alpha, | |
Paso_SystemMatrix * | A, | |||
const double * | in, | |||
const double | beta, | |||
double * | out | |||
) |
References Paso_SystemMatrix::col_coupleBlock, Paso_SystemMatrix::mainBlock, Paso_SparseMatrix_MatrixVector_CSR_OFFSET0(), Paso_SystemMatrix_finishCollect(), Paso_SystemMatrix_startCollect(), Paso_SparseMatrix::pattern, and Paso_Pattern::ptr.
Referenced by Paso_Function_LinearSystem_call(), Paso_Solver(), Paso_Solver_BiCGStab(), Paso_Solver_GMRES(), Paso_Solver_MINRES(), Paso_Solver_PCG(), Paso_Solver_solvePreconditioner(), Paso_Solver_TFQMR(), and Paso_SystemMatrix_MatrixVector().
void Paso_SystemMatrix_nullifyRows | ( | Paso_SystemMatrix * | A, | |
double * | mask_row, | |||
double | main_diagonal_value | |||
) |
References Paso_SystemMatrix::col_coupleBlock, Paso_SystemMatrix::mainBlock, MATRIX_FORMAT_CSC, MATRIX_FORMAT_TRILINOS_CRS, Paso_noError(), Paso_setError(), Paso_SparseMatrix_nullifyRows_CSR(), Paso_SparseMatrix_nullifyRows_CSR_BLK1(), Paso_SystemMatrix_finishRowCollect(), Paso_SystemMatrix_startRowCollect(), Paso_SystemMatrix::row_coupleBlock, SYSTEM_ERROR, and Paso_SystemMatrix::type.
Referenced by finley::TransportProblemAdapter::copyConstraint().
void Paso_SystemMatrix_nullifyRowsAndCols | ( | Paso_SystemMatrix * | A, | |
double * | mask_row, | |||
double * | mask_col, | |||
double | main_diagonal_value | |||
) |
References Paso_SystemMatrix::col_coupleBlock, Paso_SystemMatrix::mainBlock, MATRIX_FORMAT_CSC, MATRIX_FORMAT_TRILINOS_CRS, Paso_SystemMatrix::mpi_info, Paso_noError(), Paso_setError(), Paso_SparseMatrix_nullifyRowsAndCols_CSC(), Paso_SparseMatrix_nullifyRowsAndCols_CSC_BLK1(), Paso_SparseMatrix_nullifyRowsAndCols_CSR(), Paso_SparseMatrix_nullifyRowsAndCols_CSR_BLK1(), Paso_SystemMatrix_finishColCollect(), Paso_SystemMatrix_finishRowCollect(), Paso_SystemMatrix_startColCollect(), Paso_SystemMatrix_startRowCollect(), Paso_SystemMatrix::row_coupleBlock, Paso_MPIInfo::size, SYSTEM_ERROR, and Paso_SystemMatrix::type.
Referenced by finley::TransportProblemAdapter::copyConstraint(), and finley::SystemMatrixAdapter::nullifyRowsAndCols().
void Paso_SystemMatrix_rowSum | ( | Paso_SystemMatrix * | A, | |
double * | row_sum | |||
) |
References Paso_SystemMatrix::col_coupleBlock, Paso_SystemMatrix::mainBlock, MATRIX_FORMAT_CSC, MATRIX_FORMAT_OFFSET1, MATRIX_FORMAT_SYM, Paso_SparseMatrix::numRows, Paso_setError(), Paso_SparseMatrix_addRow_CSR_OFFSET0(), Paso_SystemMatrix::row_block_size, Paso_SystemMatrix::type, and TYPE_ERROR.
Referenced by Paso_FCTransportProblem_getSafeTimeStepSize().
void Paso_SystemMatrix_saveHB | ( | Paso_SystemMatrix * | , | |
char * | ||||
) |
void Paso_SystemMatrix_saveMM | ( | Paso_SystemMatrix * | , | |
char * | ||||
) |
References Paso_SystemMatrix::block_size, Paso_SystemMatrix::col_block_size, Paso_Pattern::index, IO_ERROR, M, Paso_SystemMatrix::mainBlock, MATRIX_FORMAT_CSC, MATRIX_FORMAT_SYM, mm_initialize_typecode, mm_set_coordinate, mm_set_matrix, mm_set_real, mm_write_banner(), mm_write_mtx_crd_size(), Paso_SystemMatrix::mpi_info, N, Paso_setError(), Paso_SystemMatrix_getGlobalNumCols(), Paso_SystemMatrix_getGlobalNumRows(), Paso_SparseMatrix::pattern, Paso_Pattern::ptr, Paso_SystemMatrix::row_block_size, Paso_MPIInfo::size, Paso_SystemMatrix::type, TYPE_ERROR, and Paso_SparseMatrix::val.
Referenced by finley::SystemMatrixAdapter::saveMM().
void Paso_SystemMatrix_setDefaults | ( | Paso_Options * | ) |
void Paso_SystemMatrix_setValues | ( | Paso_SystemMatrix * | , | |
double | ||||
) |
void Paso_SystemMatrix_startColCollect | ( | Paso_SystemMatrix * | A, | |
const double * | in | |||
) |
References Paso_SystemMatrix::col_coupler, and Paso_Coupler_startCollect().
Referenced by Paso_SystemMatrix_nullifyRowsAndCols(), and Paso_SystemMatrix_startCollect().
void Paso_SystemMatrix_startCollect | ( | Paso_SystemMatrix * | A, | |
const double * | in | |||
) |
References Paso_SystemMatrix_startColCollect().
Referenced by Paso_SystemMatrix_MatrixVector_CSR_OFFSET0().
void Paso_SystemMatrix_startRowCollect | ( | Paso_SystemMatrix * | A, | |
const double * | in | |||
) |
References Paso_Coupler_startCollect(), and Paso_SystemMatrix::row_coupler.
Referenced by Paso_SystemMatrix_nullifyRows(), and Paso_SystemMatrix_nullifyRowsAndCols().