commit 77f3027af56d193b84b7e97d29a82fa9e685756c
parent 6bf9871c697e402e7189f19aca79d2831bcf94e4
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Thu, 16 Apr 2020 14:36:59 +0200
Remove unused parameters, add -Wextra
Diffstat:
2 files changed, 16 insertions(+), 31 deletions(-)
diff --git a/Makefile b/Makefile
@@ -22,7 +22,7 @@ DOC = \
README.md\
LICENSE
-HERE_CFLAGS = ${CFLAGS} -std=c99 -pedantic -Wall -O2 -g
+HERE_CFLAGS = ${CFLAGS} -std=c99 -pedantic -Wall -Wextra -O2 -g
HERE_LDFLAGS = ${LDFLAGS} -lm -g
GLOBALCONST = -DVERSION=\"${VERSION}\"
diff --git a/simulation.c b/simulation.c
@@ -605,14 +605,7 @@ poisson_solver_1d_cell_update(int i,
double* g_out,
double* r_norm,
const double dz,
- const double* mu,
- const double* p,
- const double* xi,
- const double mu_s,
- const double C,
- const double b,
- const double rho_s,
- const double d)
+ const double* xi)
{
double coorp_term;
@@ -626,7 +619,7 @@ poisson_solver_1d_cell_update(int i,
#ifdef DEBUG
printf("-- %d --------------\n", i);
printf("coorp_term: %g\n", coorp_term);
- printf(" g_local: %g\n", local_fluidity(p[i], mu[i], mu_s, b, rho_s, d));
+ printf(" g_local: %g\n", g_local[i]);
printf(" g_in: %g\n", g_in[i+1]);
printf(" g_out: %g\n", g_out[i+1]);
printf(" r_norm: %g\n", r_norm[i]);
@@ -664,14 +657,7 @@ implicit_1d_jacobian_poisson_solver(struct simulation *sim,
g_ghost_out,
r_norm,
sim->dz,
- sim->mu,
- sim->sigma_n_eff,
- sim->xi,
- sim->mu_s,
- sim->C,
- sim->b,
- sim->rho_s,
- sim->d);
+ sim->xi);
r_norm_max = max(r_norm, sim->nz);
copy_values(g_ghost_out, sim->g_ghost, sim->nz+2);
@@ -747,11 +733,10 @@ coupled_shear_solver(struct simulation *sim,
const double rel_tol)
{
int coupled_iter, stress_iter;
- double res_norm, r_norm_max, mu_wall_orig;
+ double vel_res_norm, mu_wall_orig;
double *r_norm;
- res_norm = NAN;
- r_norm_max = NAN;
+ vel_res_norm = NAN;
r_norm = empty(sim->nz);
mu_wall_orig = sim->mu_wall;
@@ -816,29 +801,29 @@ coupled_shear_solver(struct simulation *sim,
if (!isnan(sim->v_x_limit) || !isnan(sim->v_x_fix)) {
if (!isnan(sim->v_x_limit)) {
- res_norm = (sim->v_x_limit - sim->v_x[sim->nz-1])
- /(sim->v_x[sim->nz-1] + 1e-12);
- if (res_norm > 0.0)
- res_norm = 0.0;
+ vel_res_norm = (sim->v_x_limit - sim->v_x[sim->nz-1])
+ /(sim->v_x[sim->nz-1] + 1e-12);
+ if (vel_res_norm > 0.0)
+ vel_res_norm = 0.0;
} else {
- res_norm = (sim->v_x_fix - sim->v_x[sim->nz-1])
- /(sim->v_x[sim->nz-1] + 1e-12);
+ vel_res_norm = (sim->v_x_fix - sim->v_x[sim->nz-1])
+ /(sim->v_x[sim->nz-1] + 1e-12);
}
- sim->mu_wall *= 1.0 + (res_norm*1e-2);
+ sim->mu_wall *= 1.0 + (vel_res_norm*1e-2);
}
if (++stress_iter > MAX_ITER_STRESS) {
fprintf(stderr, "error: stress solution did not converge:\n");
fprintf(stderr, "v_x=%g, v_x_fix=%g, v_x_limit=%g, "
- "res_norm=%g, mu_wall=%g\n",
+ "vel_res_norm=%g, mu_wall=%g\n",
sim->v_x[sim->nz-1], sim->v_x_fix, sim->v_x_limit,
- res_norm, sim->mu_wall);
+ vel_res_norm, sim->mu_wall);
return 10;
}
} while (0);
} while ((!isnan(sim->v_x_fix) || !isnan(sim->v_x_limit))
- && fabs(res_norm) > RTOL_STRESS);
+ && fabs(vel_res_norm) > RTOL_STRESS);
if (!isnan(sim->v_x_limit))
sim->mu_wall = mu_wall_orig;