diff --git a/src/Matrix/SparseMatrix_petsc.hpp b/src/Matrix/SparseMatrix_petsc.hpp index 78687510db4c465be5cc74dc82c953a88ccf0f98..89c4ccd28ec1824dafbe451f5a1d4c32c81c3e85 100644 --- a/src/Matrix/SparseMatrix_petsc.hpp +++ b/src/Matrix/SparseMatrix_petsc.hpp @@ -80,7 +80,9 @@ public: } // Default constructor - triplet() {}; + triplet() + :row_(0),col_(0),val_(0) + {}; }; /*! \brief Sparse Matrix implementation, that map over Eigen diff --git a/src/Operators/Vector/vector_dist_operators_functions.hpp b/src/Operators/Vector/vector_dist_operators_functions.hpp index c7ce6bf3a0755c8186a694f978fbaefb1eba1654..50e397b48a22ead8679acae99632d8c3132c8707 100644 --- a/src/Operators/Vector/vector_dist_operators_functions.hpp +++ b/src/Operators/Vector/vector_dist_operators_functions.hpp @@ -234,7 +234,7 @@ public: //! constructor from an epxression exp1 and a vector vd vector_dist_expression_op(const exp1 & o1, const vector_type & vd) - :o1(o1), vd(vd) + :o1(o1),val(0),vd(vd) {} //! sum reduction require initialization where we calculate the reduction diff --git a/src/Solvers/petsc_solver.hpp b/src/Solvers/petsc_solver.hpp index e408c4cbe6027d5efd97e05aed04870838841bb9..df94c0c2ecfdab5572c49f534a26f273749c728a 100644 --- a/src/Solvers/petsc_solver.hpp +++ b/src/Solvers/petsc_solver.hpp @@ -777,6 +777,7 @@ class petsc_solver solError err; err.err_norm = norm / col; err.err_inf = norm_inf; + err.its = 0; return err; } @@ -792,7 +793,7 @@ public: } petsc_solver() - :maxits(300) + :maxits(300),tmp(0) { initKSP(); diff --git a/src/Vector/Vector_eigen.hpp b/src/Vector/Vector_eigen.hpp index 3febf779f86c94cfd7dc05606e738c10d764678c..243ef5c24e51939bca340137473226e0d3408833 100644 --- a/src/Vector/Vector_eigen.hpp +++ b/src/Vector/Vector_eigen.hpp @@ -29,21 +29,29 @@ template class rval { - // row + //! row long int r; - // value + //! value T val; public: - // Get the row + /*! \brief Return the row index + * + * \return a reference to the row index + * + */ long int & row() { return r; } - // Get the value + /*! \brief Return the value + * + * \return a reference to the row value + * + */ T & value() { return val; @@ -52,7 +60,9 @@ public: /*! \brief Default constructor * */ - rval() {} + rval() + :r(0) + {} /*! \brief Constructor from row, colum and value * @@ -70,19 +80,22 @@ public: template class Vector { + //! Eigen vector mutable Eigen::Matrix v; - // row value vector + //! row val vector mutable openfpm::vector> row_val; + + //! row val vector received mutable openfpm::vector> row_val_recv; - // global to local map + //! global to local map mutable std::unordered_map map; - // invalid + //! invalid T invalid; - // Processors from where we gather + //! Processors from where we gather mutable openfpm::vector prc; //size of each chunk @@ -141,6 +154,7 @@ public: * */ Vector(const Vector & v) + :invalid(0) { this->operator=(v); } @@ -151,6 +165,7 @@ public: * */ Vector(const Vector && v) + :invalid(0) { this->operator=(v); } diff --git a/src/Vector/Vector_petsc.hpp b/src/Vector/Vector_petsc.hpp index 2ea14c75bb451efe528451528d04215f226075c7..f2ab34bc4bf9d55d39a9bb7ca2557d9d2c7a8809 100644 --- a/src/Vector/Vector_petsc.hpp +++ b/src/Vector/Vector_petsc.hpp @@ -152,6 +152,7 @@ public: * */ Vector(Vector && v) + :n_row(0),n_row_local(0),invalid(0) { this->operator=(v); } @@ -173,7 +174,7 @@ public: * */ Vector(size_t n, size_t n_row_local) - :n_row_local(n_row_local) + :n_row_local(n_row_local),invalid(0),v(NULL) { // Create the vector PETSC_SAFE_CALL(VecCreate(PETSC_COMM_WORLD,&v)); @@ -185,7 +186,7 @@ public: * */ Vector() - :n_row(0),n_row_local(0) + :n_row(0),n_row_local(0),invalid(0) { // Create the vector PETSC_SAFE_CALL(VecCreate(PETSC_COMM_WORLD,&v));