diff --git a/include/diffusion/BTCSDiffusion.hpp b/include/diffusion/BTCSDiffusion.hpp index ef4c4d6..e9eb868 100644 --- a/include/diffusion/BTCSDiffusion.hpp +++ b/include/diffusion/BTCSDiffusion.hpp @@ -135,16 +135,17 @@ private: const BCMatrixRowMajor &bc, double time_step, double dx) -> DMatrixRowMajor; - void fillMatrixFromRow(Eigen::SparseMatrix &A_matrix, - const DVectorRowMajor &alpha, - const BCVectorRowMajor &bc, int size, double dx, - double time_step); + static void fillMatrixFromRow(Eigen::SparseMatrix &A_matrix, + const DVectorRowMajor &alpha, + const BCVectorRowMajor &bc, int size, double dx, + double time_step); - void fillVectorFromRow(Eigen::VectorXd &b_vector, const DVectorRowMajor &c, - const DVectorRowMajor &alpha, - const BCVectorRowMajor &bc, - const DVectorRowMajor &t0_c, int size, double dx, - double time_step); + static void fillVectorFromRow(Eigen::VectorXd &b_vector, + const DVectorRowMajor &c, + const DVectorRowMajor &alpha, + const BCVectorRowMajor &bc, + const DVectorRowMajor &t0_c, int size, + double dx, double time_step); void simulate3D(std::vector &c); inline static auto getBCFromFlux(Diffusion::boundary_condition bc, diff --git a/src/BTCSDiffusion.cpp b/src/BTCSDiffusion.cpp index 54b9789..240d76a 100644 --- a/src/BTCSDiffusion.cpp +++ b/src/BTCSDiffusion.cpp @@ -179,14 +179,15 @@ auto Diffusion::BTCSDiffusion::calc_t0_c(const DMatrixRowMajor &c, DMatrixRowMajor t0_c(n_rows, n_cols); - std::array y_values; + std::array y_values{}; // first, iterate over first row for (int j = 0; j < n_cols; j++) { boundary_condition tmp_bc = bc(0, j + 1); - if (tmp_bc.type == Diffusion::BC_CLOSED) + if (tmp_bc.type == Diffusion::BC_CLOSED){ continue; + } y_values[0] = getBCFromFlux(tmp_bc, c(0, j), alpha(0, j)); y_values[1] = c(0, j); @@ -216,8 +217,9 @@ auto Diffusion::BTCSDiffusion::calc_t0_c(const DMatrixRowMajor &c, for (int j = 0; j < n_cols; j++) { boundary_condition tmp_bc = bc(end + 1, j + 1); - if (tmp_bc.type == Diffusion::BC_CLOSED) + if (tmp_bc.type == Diffusion::BC_CLOSED) { continue; + } y_values[0] = c(end - 1, j); y_values[1] = c(end, j);