tRemove unused parameters, add -Wextra - cngf-pf - continuum model for granular flows with pore-pressure dynamics (renamed from 1d_fd_simple_shear)
 (HTM) git clone git://src.adamsgaard.dk/cngf-pf
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 77f3027af56d193b84b7e97d29a82fa9e685756c
 (DIR) parent 6bf9871c697e402e7189f19aca79d2831bcf94e4
 (HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
       Date:   Thu, 16 Apr 2020 14:36:59 +0200
       
       Remove unused parameters, add -Wextra
       
       Diffstat:
         M Makefile                            |       2 +-
         M simulation.c                        |      45 +++++++++++---------------------
       
       2 files changed, 16 insertions(+), 31 deletions(-)
       ---
 (DIR) diff --git a/Makefile b/Makefile
       t@@ -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}\"
        
 (DIR) diff --git a/simulation.c b/simulation.c
       t@@ -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;
        
       t@@ -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]);
       t@@ -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);
       t@@ -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;
        
       t@@ -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;