diff --git a/MathLib/LinAlg/PETSc/PETScMatrix.cpp b/MathLib/LinAlg/PETSc/PETScMatrix.cpp index 1d6cbaa6858c10daedc966ceab3e0d5b5292c22a..9e70c3959052d13cafde38cda058f6cce1b5bc63 100644 --- a/MathLib/LinAlg/PETSc/PETScMatrix.cpp +++ b/MathLib/LinAlg/PETSc/PETScMatrix.cpp @@ -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); diff --git a/MathLib/LinAlg/PETSc/PETScMatrixOption.h b/MathLib/LinAlg/PETSc/PETScMatrixOption.h index f9add25c2a6d497ffaa126e4e4c05f025c1c1bcf..1b56c139b89106582396fbd636310063d244e082 100644 --- a/MathLib/LinAlg/PETSc/PETScMatrixOption.h +++ b/MathLib/LinAlg/PETSc/PETScMatrixOption.h @@ -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 diff --git a/Tests/MathLib/TestGlobalMatrixInterface.cpp b/Tests/MathLib/TestGlobalMatrixInterface.cpp index a775af693aacc190af336bb694a253807e458b68..db3744da7e1d9679f2e6a47c73cb81cfd6eff3d1 100644 --- a/Tests/MathLib/TestGlobalMatrixInterface.cpp +++ b/Tests/MathLib/TestGlobalMatrixInterface.cpp @@ -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);