瀏覽代碼

=nothing major

binary_fuel
Weiye Wang 1 月之前
父節點
當前提交
e08ee71580
共有 1 個文件被更改,包括 10 次插入3 次删除
  1. +10
    -3
      src/residue.cpp

+ 10
- 3
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);


Loading…
取消
儲存