30 use_external_arrays_(false)
32 int ierr = lis_matrix_create(0, &
AA_);
34 ierr = lis_matrix_set_size(
AA_, 0, n_rows);
37 ierr = lis_vector_duplicate(
AA_, &
diag_);
46 use_external_arrays_(true)
48 int ierr = lis_matrix_create(0, &
AA_);
50 ierr = lis_matrix_set_size(
AA_, 0, n_rows);
52 ierr = lis_matrix_set_csr(nnz, row_ptr, col_idx, data,
AA_);
54 ierr = lis_matrix_assemble(
AA_);
58 ierr = lis_vector_duplicate(
AA_, &
diag_);
67 ierr = lis_matrix_unset(
AA_);
70 ierr = lis_matrix_destroy(
AA_);
72 ierr = lis_vector_destroy(
diag_);
80 int ierr = lis_matrix_destroy(
AA_);
82 ierr = lis_matrix_create(0, &
AA_);
86 ierr = lis_vector_set_all(0.0,
diag_);
96 lis_matrix_set_value(LIS_INS_VALUE, rowId, colId,
v,
AA_);
98 lis_vector_set_value(LIS_INS_VALUE, rowId,
v,
diag_);
107 lis_matrix_set_value(LIS_ADD_VALUE, rowId, colId,
v,
AA_);
109 lis_vector_set_value(LIS_ADD_VALUE, rowId,
v,
diag_);
118 OGS_FATAL(
"LisMatrix::write(): matrix not assembled.");
120 lis_output_matrix(
AA_, LIS_FMT_MM,
const_cast<char*
>(filename.c_str()));
130 lis_matrix_set_type(A,
static_cast<int>(mat.
getMatrixType()));
132 ierr = lis_matrix_assemble(A);
Definition of the LisMatrix class.
Definition of the LisVector class.
LisMatrix is a wrapper class for matrix types of the linear iterative solvers library.
IndexType ie_
location where the partial matrix AA_ ends in global matrix.
LisMatrix(std::size_t n_rows, MatrixType mat_type=MatrixType::CRS)
std::size_t const n_rows_
int setValue(IndexType rowId, IndexType colId, double v)
set entry
int add(IndexType rowId, IndexType colId, double v)
add value
void setZero()
reset this matrix with keeping its original dimension
MatrixType getMatrixType() const
get this matrix type
bool use_external_arrays_
void write(const std::string &filename) const
printout this equation for debugging
LIS_MATRIX & getRawMatrix()
return a raw Lis matrix object
bool isAssembled() const
return if this matrix is already assembled or not
bool checkLisError(int err)
bool finalizeMatrixAssembly(MAT_T &)