tMake resolution depend on grain size by default - 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 880728cd5cb9ae793a7dcf4d06bd7074c774dd1e
 (DIR) parent 553152a64edc5454b326ec55073263f47053431b
 (HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
       Date:   Thu, 29 Aug 2019 16:35:16 +0200
       
       Make resolution depend on grain size by default
       
       Diffstat:
         M main.c                              |       7 +++++--
         M parameter_defaults.h                |       2 +-
       
       2 files changed, 6 insertions(+), 3 deletions(-)
       ---
 (DIR) diff --git a/main.c b/main.c
       t@@ -42,7 +42,8 @@ usage(void)
                        " -p, --porosity VAL              porosity fraction [-] (default %g)\n"
                        " -d, --grain-size VAL            representative grain size [m] (default %g)\n"
                        " -r, --density VAL               grain material density [kg/m^3] (default %g)\n"
       -                " -n, --resolution VAL            number of cells in domain [-] (default %d)\n"
       +                " -n, --resolution VAL            number of cells in domain [-]\n"
       +                "                                 (default cell size equals grain size)\n"
                        " -o, --origo VAL                 coordinate system origo [m] (default %g)\n"
                        " -L, --length VAL                domain length [m] (default %g)\n"
                        "\nOptional arguments only relevant with transient (fluid) simulation:\n"
       t@@ -72,7 +73,6 @@ usage(void)
                        sim.phi[0],
                        sim.d,
                        sim.rho_s,
       -                sim.nz,
                        sim.origo_z,
                        sim.L_z,
                        sim.beta_f,
       t@@ -271,6 +271,9 @@ main(int argc, char* argv[])
                        snprintf(sim.name, sizeof(sim.name), "%s", argv[i]);
                }
        
       +        if (sim.nz < 1)
       +                sim.nz = (int)ceil(sim.L_z/sim.d);
       +
                prepare_arrays(&sim);
        
                if (!isnan(new_phi))
 (DIR) diff --git a/parameter_defaults.h b/parameter_defaults.h
       t@@ -23,7 +23,7 @@ struct simulation init_sim(void)
                sim.v_x_fix = NAN;
                sim.v_x_limit = NAN;
        
       -        sim.nz = 100;
       +        sim.nz = -1;        /* cell size equals grain size if negative */
        
                /* lower values of A mean that the velocity curve can have sharper curves,
                 * e.g. at the transition from μ ≈ μ_s */