commit 8c36fa6f35790cd63a11b96ee642d4635bbe2bc1
parent 1d1a4a362c52237b3a81ebf5cad99b165388a331
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Tue, 24 Nov 2020 08:08:45 +0100
fluid.c: add missing computation of normalized residual
Also remove some unused code
Diffstat:
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/fluid.c b/fluid.c
@@ -260,21 +260,17 @@ darcy_solver_1d(struct simulation *sim,
sim->mu_f,
sim->D);
- /*for (i = 0; i < sim->nz; ++i)
- printf("sim->p_f_dot_impl[%d] = %g (t = %g s, iter = %d)\n",
- i, sim->p_f_dot_impl[i], sim->t, iter);*/
-
- /*for (i = 0; i < sim->nz; ++i)
- if (fabs(sim->p_f_dot_impl[i]) > 1e-12)
- errx(1, "sim->p_f_dot_impl[%d] = %g (t = %g s, iter = %d)",
- i, sim->p_f_dot_impl[i], sim->t, iter);*/
for (i = 0; i < sim->nz; ++i)
if (isnan(sim->p_f_dot_impl[i]))
errx(1, "NaN at sim->p_f_dot_impl[%d] (t = %g s, iter = %d)",
i, sim->t, iter);
+ for (i = 0; i < sim->nz - 1; ++i)
+ sim->p_f_dot_impl_r_norm[i] = fabs(residual(sim->p_f_dot_impl[i],
+ sim->old_val[i]));
r_norm_max = max(sim->p_f_dot_impl_r_norm, sim->nz - 1);
+
#ifdef DEBUG
puts(".. p_f_ghost_new:");
print_array(sim->tmp_ghost, sim->nz + 2);