From 0a5c271a4b7f132ceb858b8879fe553c5a596549 Mon Sep 17 00:00:00 2001 From: Max Luebke Date: Mon, 6 Dec 2021 20:18:33 +0100 Subject: [PATCH] change values of bc @ A and b --- src/BTCSDiffusion.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/BTCSDiffusion.cpp b/src/BTCSDiffusion.cpp index 8023970..f6977f2 100644 --- a/src/BTCSDiffusion.cpp +++ b/src/BTCSDiffusion.cpp @@ -106,8 +106,11 @@ void BTCSDiffusion::simulate1D(std::vector &c, double bc_left, A_matrix.resize(size, size); A_matrix.reserve(Eigen::VectorXi::Constant(size, 3)); - A_matrix.insert(0, 0) = bc_left; - A_matrix.insert(size - 1, size - 1) = bc_right; + A_matrix.insert(0, 0) = 1; + A_matrix.insert(size - 1, size - 1) = 1; + + b_vector[0] = bc_left; + b_vector[size-1] = bc_right; for (int i = 1; i < this->dim_x + 1; i++) { double sx = (alpha[i - 1] * time_step) / (dx * dx);