Code cleanup in enforced rotation module, remove warnings.
authorCarsten Kutzner <ckutzne@gwdg.de>
Wed, 22 May 2013 13:47:47 +0000 (15:47 +0200)
committerCarsten Kutzner <ckutzne@gwdg.de>
Mon, 27 May 2013 09:30:38 +0000 (11:30 +0200)
Change-Id: Iceb458b06f2c003c6325c77c3258edb112e449f6

include/pull_rotation.h
src/contrib/runner_openmm.c
src/kernel/runner.c
src/mdlib/pull_rotation.c

index b889e5bf34af4b3365101d99f916dd6d0ea109e6..9b9c33046d2e6e60dc48241c2414f500c709d22a 100644 (file)
@@ -70,6 +70,7 @@ extern "C" {
  *                          of the rotation output files.
  * \param cr                Pointer to MPI communication data.
  * \param x                 The positions of all MD particles.
+ * \param box               The simulation box.
  * \param mtop              Molecular topology.
  * \param oenv              Needed to open the rotation output xvgr file.
  * \param Flags             Flags passed over from main, used to determine
@@ -134,11 +135,10 @@ extern real add_rot_forces(t_rot *rot, rvec f[], t_commrec *cr, gmx_large_int_t
 
 /*! \brief Close the enforced rotation output files.
  *
- * \param fplog             General output file, normally md.log.
  * \param rot               Pointer to all the enforced rotation data.
  */
 GMX_LIBMD_EXPORT
-extern void finish_rot(FILE *fplog, t_rot *rot);
+extern void finish_rot(t_rot *rot);
 
 
 #ifdef __cplusplus
index 72a5c4858bddfcc02cca4c70538c963b762b2e03..9272ef3bb7564ace627dc45f882268fa9eb7d88d 100644 (file)
@@ -1909,7 +1909,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
         
         if (inputrec->bRot)
         {
-            finish_rot(fplog,inputrec->rot);
+            finish_rot(inputrec->rot);
         }
 
     } 
index 765be55653ee82ab5793a832b38605b15d323025..d9bfae0482ed39702cf10ea0d99d8af24414da7f 100644 (file)
@@ -1603,7 +1603,7 @@ int mdrunner(gmx_hw_opt_t *hw_opt,
 
         if (inputrec->bRot)
         {
-            finish_rot(fplog, inputrec->rot);
+            finish_rot(inputrec->rot);
         }
 
     }
index 5b600b908efe27470d8e45b83ec33700b6602435..8fbe2272fa094b7e92ba47d48427406253cbdbbf 100644 (file)
@@ -782,7 +782,7 @@ static FILE *open_output_file(const char *fn, int steps, const char what[])
 
 
 /* Open output file for slab center data. Call on master only */
-static FILE *open_slab_out(const char *fn, t_rot *rot, const output_env_t oenv)
+static FILE *open_slab_out(const char *fn, t_rot *rot)
 {
     FILE      *fp;
     int        g, i;
@@ -997,7 +997,7 @@ static FILE *open_rot_out(const char *fn, t_rot *rot, const output_env_t oenv)
 
 
 /* Call on master only */
-static FILE *open_angles_out(const char *fn, t_rot *rot, const output_env_t oenv)
+static FILE *open_angles_out(const char *fn, t_rot *rot)
 {
     int             g, i;
     FILE           *fp;
@@ -1083,7 +1083,7 @@ static FILE *open_angles_out(const char *fn, t_rot *rot, const output_env_t oenv
 
 /* Open torque output file and write some information about it's structure.
  * Call on master only */
-static FILE *open_torque_out(const char *fn, t_rot *rot, const output_env_t oenv)
+static FILE *open_torque_out(const char *fn, t_rot *rot)
 {
     FILE      *fp;
     int        g;
@@ -1692,7 +1692,7 @@ static int get_single_atom_gaussians(
     }
     count--;
 
-    /* Determine the max slab */
+    /* Determine the min slab */
     slab = homeslab;
     do
     {
@@ -2467,8 +2467,7 @@ static void get_firstlast_slab_check(
         t_rotgrp        *rotg,      /* The rotation group (inputrec data) */
         t_gmx_enfrotgrp *erg,       /* The rotation group (data only accessible in this file) */
         rvec             firstatom, /* First atom after sorting along the rotation vector v */
-        rvec             lastatom,  /* Last atom along v */
-        int              g)         /* The rotation group number */
+        rvec             lastatom)  /* Last atom along v */
 {
     erg->slab_first = get_first_slab(rotg, erg->max_beta, firstatom);
     erg->slab_last  = get_last_slab(rotg, erg->max_beta, lastatom);
@@ -2498,7 +2497,6 @@ static void do_flexible(
         rvec            x[],          /* The local positions                        */
         matrix          box,
         double          t,            /* Time in picoseconds                        */
-        gmx_large_int_t step,         /* The time step                              */
         gmx_bool        bOutstepRot,  /* Output to main rotation output file        */
         gmx_bool        bOutstepSlab) /* Output per-slab data                       */
 {
@@ -2518,7 +2516,7 @@ static void do_flexible(
 
     /* Determine the first relevant slab for the first atom and the last
      * relevant slab for the last atom */
-    get_firstlast_slab_check(rotg, erg, erg->xc[0], erg->xc[rotg->nat-1], g);
+    get_firstlast_slab_check(rotg, erg, erg->xc[0], erg->xc[rotg->nat-1]);
 
     /* Determine for each slab depending on the min_gaussian cutoff criterium,
      * a first and a last atom index inbetween stuff needs to be calculated */
@@ -2630,10 +2628,6 @@ static gmx_inline void project_onto_plane(rvec dr, const rvec v)
 /* springs to the reference atoms.                                     */
 static void do_fixed(
         t_rotgrp       *rotg,         /* The rotation group                         */
-        rvec            x[],          /* The positions                              */
-        matrix          box,          /* The simulation box                         */
-        double          t,            /* Time in picoseconds                        */
-        gmx_large_int_t step,         /* The time step                              */
         gmx_bool        bOutstepRot,  /* Output to main rotation output file        */
         gmx_bool        bOutstepSlab) /* Output per-slab data                       */
 {
@@ -2744,10 +2738,6 @@ static void do_fixed(
 /* Calculate the radial motion potential and forces */
 static void do_radial_motion(
         t_rotgrp       *rotg,         /* The rotation group                         */
-        rvec            x[],          /* The positions                              */
-        matrix          box,          /* The simulation box                         */
-        double          t,            /* Time in picoseconds                        */
-        gmx_large_int_t step,         /* The time step                              */
         gmx_bool        bOutstepRot,  /* Output to main rotation output file        */
         gmx_bool        bOutstepSlab) /* Output per-slab data                       */
 {
@@ -2847,8 +2837,6 @@ static void do_radial_motion_pf(
         t_rotgrp       *rotg,         /* The rotation group                         */
         rvec            x[],          /* The positions                              */
         matrix          box,          /* The simulation box                         */
-        double          t,            /* Time in picoseconds                        */
-        gmx_large_int_t step,         /* The time step                              */
         gmx_bool        bOutstepRot,  /* Output to main rotation output file        */
         gmx_bool        bOutstepSlab) /* Output per-slab data                       */
 {
@@ -3059,8 +3047,6 @@ static void do_radial_motion2(
         t_rotgrp       *rotg,         /* The rotation group                         */
         rvec            x[],          /* The positions                              */
         matrix          box,          /* The simulation box                         */
-        double          t,            /* Time in picoseconds                        */
-        gmx_large_int_t step,         /* The time step                              */
         gmx_bool        bOutstepRot,  /* Output to main rotation output file        */
         gmx_bool        bOutstepSlab) /* Output per-slab data                       */
 {
@@ -3307,7 +3293,7 @@ static void allocate_slabs(
 }
 
 
-/* From the extreme coordinates of the reference group, determine the first
+/* From the extreme positions of the reference group, determine the first
  * and last slab of the reference. We can never have more slabs in the real
  * simulation than calculated here for the reference.
  */
@@ -3583,7 +3569,7 @@ static void init_rot_group(FILE *fplog, t_commrec *cr, int g, t_rotgrp *rotg,
         /* Determine the smallest and largest coordinate with respect to the rotation vector */
         get_firstlast_atom_ref(rotg, &ref_firstindex, &ref_lastindex);
 
-        /* From the extreme coordinates of the reference group, determine the first
+        /* From the extreme positions of the reference group, determine the first
          * and last slab of the reference. */
         get_firstlast_slab_ref(rotg, erg->mc, ref_firstindex, ref_lastindex);
 
@@ -3724,7 +3710,7 @@ extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[
     er->out_slabs = NULL;
     if (MASTER(cr) && HaveFlexibleGroups(rot) )
     {
-        er->out_slabs = open_slab_out(opt2fn("-rs", nfile, fnm), rot, oenv);
+        er->out_slabs = open_slab_out(opt2fn("-rs", nfile, fnm), rot);
     }
 
     if (MASTER(cr))
@@ -3806,11 +3792,11 @@ extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[
         {
             if (HaveFlexibleGroups(rot) || HavePotFitGroups(rot) )
             {
-                er->out_angles  = open_angles_out(opt2fn("-ra", nfile, fnm), rot, oenv);
+                er->out_angles  = open_angles_out(opt2fn("-ra", nfile, fnm), rot);
             }
             if (HaveFlexibleGroups(rot) )
             {
-                er->out_torque  = open_torque_out(opt2fn("-rt", nfile, fnm), rot, oenv);
+                er->out_torque  = open_torque_out(opt2fn("-rt", nfile, fnm), rot);
             }
         }
 
@@ -3819,7 +3805,7 @@ extern void init_rot(FILE *fplog, t_inputrec *ir, int nfile, const t_filenm fnm[
 }
 
 
-extern void finish_rot(FILE *fplog, t_rot *rot)
+extern void finish_rot(t_rot *rot)
 {
     gmx_enfrot_t er;        /* Pointer to the enforced rotation buffer variables */
 
@@ -4043,17 +4029,17 @@ extern void do_rotation(
             case erotgISOPF:
             case erotgPM:
             case erotgPMPF:
-                do_fixed(rotg, x, box, t, step, outstep_rot, outstep_slab);
+                do_fixed(rotg, outstep_rot, outstep_slab);
                 break;
             case erotgRM:
-                do_radial_motion(rotg, x, box, t, step, outstep_rot, outstep_slab);
+                do_radial_motion(rotg, outstep_rot, outstep_slab);
                 break;
             case erotgRMPF:
-                do_radial_motion_pf(rotg, x, box, t, step, outstep_rot, outstep_slab);
+                do_radial_motion_pf(rotg, x, box, outstep_rot, outstep_slab);
                 break;
             case erotgRM2:
             case erotgRM2PF:
-                do_radial_motion2(rotg, x, box, t, step, outstep_rot, outstep_slab);
+                do_radial_motion2(rotg, x, box, outstep_rot, outstep_slab);
                 break;
             case erotgFLEXT:
             case erotgFLEX2T:
@@ -4063,13 +4049,13 @@ extern void do_rotation(
                 get_center(erg->xc, erg->mc, rotg->nat, erg->xc_center);
                 svmul(-1.0, erg->xc_center, transvec);
                 translate_x(erg->xc, rotg->nat, transvec);
-                do_flexible(MASTER(cr), er, rotg, g, x, box, t, step, outstep_rot, outstep_slab);
+                do_flexible(MASTER(cr), er, rotg, g, x, box, t, outstep_rot, outstep_slab);
                 break;
             case erotgFLEX:
             case erotgFLEX2:
                 /* Do NOT subtract the center of mass in the low level routines! */
                 clear_rvec(erg->xc_center);
-                do_flexible(MASTER(cr), er, rotg, g, x, box, t, step, outstep_rot, outstep_slab);
+                do_flexible(MASTER(cr), er, rotg, g, x, box, t, outstep_rot, outstep_slab);
                 break;
             default:
                 gmx_fatal(FARGS, "No such rotation potential.");