Skip to content
Snippets Groups Projects
Commit b92cbd07 authored by wenqing's avatar wenqing
Browse files

Change back the name of _d_nz and o_nz

parent 2dacdb31
No related branches found
No related tags found
No related merge requests found
......@@ -33,7 +33,7 @@ PETScMatrix::PETScMatrix (const PetscInt size, const PETScMatrixOption &mat_opt)
MatSetFromOptions(_A);
// for a dense matrix: MatSeqAIJSetPreallocation(_A, d_nz, PETSC_NULL);
MatMPIAIJSetPreallocation(_A, mat_opt._d_nnz, PETSC_NULL, mat_opt._o_nnz, PETSC_NULL);
MatMPIAIJSetPreallocation(_A, mat_opt._d_nz, PETSC_NULL, mat_opt._o_nz, PETSC_NULL);
MatGetOwnershipRange(_A, &_start_rank, &_end_rank);
MatGetSize(_A, &_size, PETSC_NULL);
......
......@@ -24,7 +24,7 @@ namespace MathLib
struct PETScMatrixOption
{
PETScMatrixOption() : _is_global_size(true), _n_local_cols(PETSC_DECIDE),
_d_nnz(PETSC_DECIDE), _o_nnz(PETSC_DECIDE)
_d_nz(PETSC_DECIDE), _o_nz(PETSC_DECIDE)
{ }
/*!
......@@ -43,13 +43,13 @@ struct PETScMatrixOption
\brief Number of nonzeros per row in DIAGONAL portion of local submatrix
(same value is used for all local rows), the default is PETSC_DECIDE
*/
PetscInt _d_nnz;
PetscInt _d_nz;
/*!
\brief Number of nonzeros per row in the OFF-DIAGONAL portion of local submatrix
(same value is used for all local rows), the default is PETSC_DECIDE
*/
PetscInt _o_nnz;
PetscInt _o_nz;
};
} // end namespace
......
......@@ -128,8 +128,8 @@ TEST(Math, CheckInterface_LisMatrix)
TEST(Math, CheckInterface_PETScMatrix_Local_Size)
{
MathLib::PETScMatrixOption opt;
opt._d_nnz = 2;
opt._o_nnz = 0;
opt._d_nz = 2;
opt._o_nz = 0;
opt._is_global_size = false;
opt._n_local_cols = 2;
MathLib::PETScMatrix A(2, opt);
......@@ -142,8 +142,8 @@ TEST(Math, CheckInterface_PETScMatrix_Local_Size)
TEST(Math, CheckInterface_PETScMatrix_Global_Size)
{
MathLib::PETScMatrixOption opt;
opt._d_nnz = 2;
opt._o_nnz = 0;
opt._d_nz = 2;
opt._o_nz = 0;
MathLib::PETScMatrix A(6, opt);
MathLib::PETScVector x(6);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment