diff --git a/MathLib/LinAlg/Lis/LisMatrix.cpp b/MathLib/LinAlg/Lis/LisMatrix.cpp
index 2e88de19d1606682c20c43c148f12e91ca482405..bbd4cd12db2ca4eeaf33d92019fc3fa5ffd00c58 100644
--- a/MathLib/LinAlg/Lis/LisMatrix.cpp
+++ b/MathLib/LinAlg/Lis/LisMatrix.cpp
@@ -21,7 +21,7 @@ namespace MathLib
 {
 
 LisMatrix::LisMatrix(std::size_t dimension, LisOption::MatrixType mat_type)
-: _n_rows(dimension), _max_diag_coeff(.0), _mat_type(mat_type)
+: _n_rows(dimension), _max_diag_coeff(.0), _mat_type(mat_type), _is_assembled(false)
 {
     int ierr = 0;
     ierr = lis_matrix_create(0, &_AA); checkLisError(ierr);
@@ -59,10 +59,14 @@ void LisMatrix::matvec (const LisVector &x, LisVector &y) const
 
 bool finalizeMatrixAssembly(LisMatrix &mat)
 {
-    if (!lis_matrix_is_assembled(mat.getRawMatrix())) {
-        int ierr = lis_matrix_set_type(mat.getRawMatrix(), static_cast<int>(mat.getMatrixType())); checkLisError(ierr);
-        ierr = lis_matrix_assemble(mat.getRawMatrix()); checkLisError(ierr);
-    }
+    LIS_MATRIX &A = mat.getRawMatrix();
+    // commented out below because lis_matrix_is_assembled() always returns the same value.
+    //    if (LIS_SUCCESS!=lis_matrix_is_assembled(A)) {
+    if (!mat.isAssembled()) {
+        int ierr = lis_matrix_set_type(A, static_cast<int>(mat.getMatrixType())); checkLisError(ierr);
+        ierr = lis_matrix_assemble(A); //checkLisError(ierr);
+        mat._is_assembled = true;
+   }
     return true;
 };
 
diff --git a/MathLib/LinAlg/Lis/LisMatrix.h b/MathLib/LinAlg/Lis/LisMatrix.h
index a0592c13077e911e0f75bb03a5287284e66467aa..25450c05287b851b73b689593c672f932961b632 100644
--- a/MathLib/LinAlg/Lis/LisMatrix.h
+++ b/MathLib/LinAlg/Lis/LisMatrix.h
@@ -102,13 +102,20 @@ public:
     /// get this matrix type
     LisOption::MatrixType getMatrixType() const { return _mat_type; };
 
+    /// return if this matrix is already assembled or not
+    bool isAssembled() const { return _is_assembled; };
+
 private:
     std::size_t _n_rows;
     double _max_diag_coeff;
     LisOption::MatrixType _mat_type;
     LIS_MATRIX _AA;
+    bool _is_assembled;
     int _is;
     int _ie;
+
+    // friend function
+    friend bool finalizeMatrixAssembly(LisMatrix &mat);
 };
 
 template<class T_DENSE_MATRIX>