tgranulargrain: add options to fix and disable rotation - granular - granular dynamics simulation
 (HTM) git clone git://src.adamsgaard.dk/granular
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit c5d3ea04206942befe8197ee0fee4e8f49fc7ccb
 (DIR) parent c4ee0c13dd0ce42de531eba07cc3d85b67859c87
 (HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
       Date:   Fri, 23 Apr 2021 06:06:34 +0200
       
       granulargrain: add options to fix and disable rotation
       
       Diffstat:
         M granulargrain.1                     |       9 ++++++++-
         M granulargrain.c                     |       8 ++++++++
       
       2 files changed, 16 insertions(+), 1 deletion(-)
       ---
 (DIR) diff --git a/granulargrain.1 b/granulargrain.1
       t@@ -7,7 +7,9 @@
        .Sh SYNOPSIS
        .Nm
        .Op Fl d Ar diameter
       +.Op Fl f
        .Op Fl h
       +.Op Fl R
        .Op Fl u Ar vx
        .Op Fl v Ar vy
        .Op Fl w Ar vz
       t@@ -26,8 +28,12 @@ The options are as follows:
        .Bl -tag -width Ds
        .It Fl d Ar diameter
        Specify grain diameter (default 1.0).
       +.It Fl f
       +Fix grain in space.
        .It Fl h
        Show help text.
       +.It Fl R
       +Disable grain rotation.
        .It Fl u Ar vx
        Set x velocity to
        .Ar vx
       t@@ -68,7 +74,7 @@ error
        .El
        .Sh EXAMPLES
        .Bd -literal -offset indent
       -$ (granularpacking -u 1.0; granularpacking -x 1.0) \\
       +$ (granulargrain -u 1.0; granulargrain -x 1.0) \\
                  | granular -e 2.0 -I 0.1 collision
        $ for f in collision.grain.*.tsv; do \\
                  granular2vtu <"$f" >"${f%.tsv}.vtu"; \\
       t@@ -76,6 +82,7 @@ $ for f in collision.grain.*.tsv; do \\
        .Ed
        .Sh SEE ALSO
        .Xr granular 1 ,
       +.Xr granular2img 1 ,
        .Xr granular2vtu 1 ,
        .Xr granularpacking 1 ,
        .Xr granular 5
 (DIR) diff --git a/granulargrain.c b/granulargrain.c
       t@@ -10,7 +10,9 @@ usage(void)
        {
                errx(1, "usage: %s "
                         "[-d diameter] "
       +                 "[-f] "
                         "[-h] "
       +                 "[-R] "
                         "[-u vx] "
                         "[-v vy] "
                         "[-w vz] "
       t@@ -28,9 +30,15 @@ main(int argc, char *argv[])
                case 'd':
                        g.diameter = atof(EARGF(usage()));
                        break;
       +        case 'f':
       +                g.fixed = 1;
       +                break;
                case 'h':
                        usage();
                        break;
       +        case 'R':
       +                g.rotating = 0;
       +                break;
                case 'u':
                        g.vel[0] = atof(EARGF(usage()));
                        break;