From e08ee71580689942cc2ca44d8bcd2d1e0a682e60 Mon Sep 17 00:00:00 2001 From: weiyewang Date: Mon, 16 Sep 2024 11:55:00 -0700 Subject: [PATCH] =nothing major --- src/residue.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/residue.cpp b/src/residue.cpp index bd785a7..4900620 100644 --- a/src/residue.cpp +++ b/src/residue.cpp @@ -1789,6 +1789,7 @@ int residue(double t, N_Vector y, N_Vector ydot, N_Vector res, void *user_data) /*implement res @ left boundary i.e., first grid point*/ Rres(1) = Rdot(1); + sum = ZERO ; if (dropType == 0) { // Yres(1,data->k_drop[0]) = Ydot(1,data->k_drop[0]); for (size_t k = 1; k <= nsp; k++) { @@ -1798,12 +1799,18 @@ int residue(double t, N_Vector y, N_Vector ydot, N_Vector res, void *user_data) for (size_t k = 1; k <= nsp; k++) { if (k == k_drop[0]) { Yres(1, k) = Y(2, k) - Y(1, k); - } else if (k == k_drop[1]) { - Yres(1, k) = ONE - Y(1, k_drop[0]) - Y(1, k); - } else { + sum += Y(1, k); + } +// else if (k == k_drop[1]) { +// //Yres(1, k) = ONE - Y(1, k_drop[0]) - Y(1, k); +// Yres(1,k) = +// } + else if (k != k_drop[1] && k != k_drop[0]) { Yres(1, k) = Ydot(1, k); + sum += Y(1, k); } } + Yres(1, k_drop[1]) = ONE - sum - Y(1, k_drop[1]); } Pres(1) = P(2) - P(1); Mdotres(1) = Mdot(2) - Mdot(1);