| 1 | 
  | 
/* | 
| 2 | 
< | 
  File autogenerated by gengetopt version 2.16 | 
| 2 | 
> | 
  File autogenerated by gengetopt version 2.19.1 | 
| 3 | 
  | 
  generated with the following command: | 
| 4 | 
< | 
  gengetopt -F StaticPropsCmd  | 
| 4 | 
> | 
  gengetopt --file-name=StaticPropsCmd -u  | 
| 5 | 
  | 
 | 
| 6 | 
  | 
  The developers of gengetopt consider the fixed text that goes in all | 
| 7 | 
  | 
  gengetopt output files to be in the public domain: | 
| 21 | 
  | 
 | 
| 22 | 
  | 
#include "StaticPropsCmd.h" | 
| 23 | 
  | 
 | 
| 24 | 
+ | 
const char *gengetopt_args_info_purpose = ""; | 
| 25 | 
+ | 
 | 
| 26 | 
+ | 
const char *gengetopt_args_info_usage = "Usage: StaticProps [OPTIONS]... [FILES]..."; | 
| 27 | 
+ | 
 | 
| 28 | 
+ | 
const char *gengetopt_args_info_description = ""; | 
| 29 | 
+ | 
 | 
| 30 | 
+ | 
const char *gengetopt_args_info_help[] = { | 
| 31 | 
+ | 
  "  -h, --help                    Print help and exit", | 
| 32 | 
+ | 
  "  -V, --version                 Print version and exit", | 
| 33 | 
+ | 
  "  -i, --input=filename          input dump file", | 
| 34 | 
+ | 
  "  -o, --output=filename         output file name", | 
| 35 | 
+ | 
  "  -n, --step=INT                process every n frame  (default=`1')", | 
| 36 | 
+ | 
  "  -b, --nbins=INT               number of bins (general purpose)  \n                                  (default=`100')", | 
| 37 | 
+ | 
  "  -x, --nbins_x=INT             number of bins in x axis  (default=`100')", | 
| 38 | 
+ | 
  "  -y, --nbins_y=INT             number of bins in y axis  (default=`100')", | 
| 39 | 
+ | 
  "  -a, --nanglebins=INT          number of bins for cos(angle)  (default=`50')", | 
| 40 | 
+ | 
  "      --length=DOUBLE           maximum length (Defaults to 1/2 smallest length \n                                  of first frame)", | 
| 41 | 
+ | 
  "  -c, --rcut=DOUBLE             cutoff radius (rcut)", | 
| 42 | 
+ | 
  "  -z, --zoffset=DOUBLE          Where to set the zero for the slab_density \n                                  calculation  (default=`0')", | 
| 43 | 
+ | 
  "      --sele1=selection script  select the first stuntdouble set", | 
| 44 | 
+ | 
  "      --sele2=selection script  select the second stuntdouble set", | 
| 45 | 
+ | 
  "      --sele3=selection script  select the third stuntdouble set", | 
| 46 | 
+ | 
  "      --refsele=selection script\n                                select reference (use and only use with --gxyz)", | 
| 47 | 
+ | 
  "      --molname=STRING          molecule name", | 
| 48 | 
+ | 
  "      --begin=INT               begin internal index", | 
| 49 | 
+ | 
  "      --end=INT                 end internal index", | 
| 50 | 
+ | 
  "      --radius=DOUBLE           nanoparticle radius", | 
| 51 | 
+ | 
  "\n Group: staticProps\n   an option of this group is required", | 
| 52 | 
+ | 
  "      --bo                      bond order parameter (--rcut must be specified)", | 
| 53 | 
+ | 
  "      --bor                     bond order parameter as a function of radius \n                                  (--rcut must be specified)", | 
| 54 | 
+ | 
  "      --bad                     N(theta) bond angle density within (--rcut must \n                                  be specified)", | 
| 55 | 
+ | 
  "  -g, --gofr                    g(r)", | 
| 56 | 
+ | 
  "      --r_theta                 g(r, cos(theta))", | 
| 57 | 
+ | 
  "      --r_omega                 g(r, cos(omega))", | 
| 58 | 
+ | 
  "      --theta_omega             g(cos(theta), cos(omega))", | 
| 59 | 
+ | 
  "      --gxyz                    g(x, y, z)", | 
| 60 | 
+ | 
  "  -p, --p2                      p2 order parameter (--sele1 and --sele2 must be \n                                  specified)", | 
| 61 | 
+ | 
  "      --rp2                     rp2 order parameter (--sele1 and --sele2 must \n                                  be specified)", | 
| 62 | 
+ | 
  "  -s, --scd                     scd order parameter (either --sele1, --sele2, \n                                  --sele3 are specified or --molname, --begin, \n                                  --end are specified)", | 
| 63 | 
+ | 
  "  -d, --density                 density plot", | 
| 64 | 
+ | 
  "      --slab_density            slab density", | 
| 65 | 
+ | 
  "      --hxy                     hxy", | 
| 66 | 
+ | 
  "      --rho_r                   rho of R", | 
| 67 | 
+ | 
  "      --hullvol                 hull volume of nanoparticle", | 
| 68 | 
+ | 
    0 | 
| 69 | 
+ | 
}; | 
| 70 | 
+ | 
 | 
| 71 | 
  | 
static | 
| 72 | 
  | 
void clear_given (struct gengetopt_args_info *args_info); | 
| 73 | 
  | 
static | 
| 90 | 
  | 
  args_info->input_given = 0 ; | 
| 91 | 
  | 
  args_info->output_given = 0 ; | 
| 92 | 
  | 
  args_info->step_given = 0 ; | 
| 93 | 
< | 
  args_info->nrbins_given = 0 ; | 
| 93 | 
> | 
  args_info->nbins_given = 0 ; | 
| 94 | 
  | 
  args_info->nbins_x_given = 0 ; | 
| 95 | 
  | 
  args_info->nbins_y_given = 0 ; | 
| 96 | 
  | 
  args_info->nanglebins_given = 0 ; | 
| 97 | 
  | 
  args_info->length_given = 0 ; | 
| 51 | 
– | 
  args_info->LegendreL_given = 0 ; | 
| 98 | 
  | 
  args_info->rcut_given = 0 ; | 
| 99 | 
  | 
  args_info->zoffset_given = 0 ; | 
| 100 | 
  | 
  args_info->sele1_given = 0 ; | 
| 104 | 
  | 
  args_info->molname_given = 0 ; | 
| 105 | 
  | 
  args_info->begin_given = 0 ; | 
| 106 | 
  | 
  args_info->end_given = 0 ; | 
| 107 | 
+ | 
  args_info->radius_given = 0 ; | 
| 108 | 
  | 
  args_info->bo_given = 0 ; | 
| 109 | 
+ | 
  args_info->bor_given = 0 ; | 
| 110 | 
+ | 
  args_info->bad_given = 0 ; | 
| 111 | 
  | 
  args_info->gofr_given = 0 ; | 
| 112 | 
  | 
  args_info->r_theta_given = 0 ; | 
| 113 | 
  | 
  args_info->r_omega_given = 0 ; | 
| 119 | 
  | 
  args_info->density_given = 0 ; | 
| 120 | 
  | 
  args_info->slab_density_given = 0 ; | 
| 121 | 
  | 
  args_info->hxy_given = 0 ; | 
| 122 | 
+ | 
  args_info->rho_r_given = 0 ; | 
| 123 | 
+ | 
  args_info->hullvol_given = 0 ; | 
| 124 | 
  | 
  args_info->staticProps_group_counter = 0 ; | 
| 125 | 
  | 
} | 
| 126 | 
  | 
 | 
| 133 | 
  | 
  args_info->output_orig = NULL; | 
| 134 | 
  | 
  args_info->step_arg = 1; | 
| 135 | 
  | 
  args_info->step_orig = NULL; | 
| 136 | 
< | 
  args_info->nrbins_arg = 100; | 
| 137 | 
< | 
  args_info->nrbins_orig = NULL; | 
| 136 | 
> | 
  args_info->nbins_arg = 100; | 
| 137 | 
> | 
  args_info->nbins_orig = NULL; | 
| 138 | 
  | 
  args_info->nbins_x_arg = 100; | 
| 139 | 
  | 
  args_info->nbins_x_orig = NULL; | 
| 140 | 
  | 
  args_info->nbins_y_arg = 100; | 
| 142 | 
  | 
  args_info->nanglebins_arg = 50; | 
| 143 | 
  | 
  args_info->nanglebins_orig = NULL; | 
| 144 | 
  | 
  args_info->length_orig = NULL; | 
| 94 | 
– | 
  args_info->LegendreL_orig = NULL; | 
| 145 | 
  | 
  args_info->rcut_orig = NULL; | 
| 146 | 
  | 
  args_info->zoffset_arg = 0; | 
| 147 | 
  | 
  args_info->zoffset_orig = NULL; | 
| 157 | 
  | 
  args_info->molname_orig = NULL; | 
| 158 | 
  | 
  args_info->begin_orig = NULL; | 
| 159 | 
  | 
  args_info->end_orig = NULL; | 
| 160 | 
+ | 
  args_info->radius_orig = NULL; | 
| 161 | 
  | 
   | 
| 162 | 
  | 
} | 
| 163 | 
  | 
 | 
| 164 | 
+ | 
static | 
| 165 | 
+ | 
void init_args_info(struct gengetopt_args_info *args_info) | 
| 166 | 
+ | 
{ | 
| 167 | 
+ | 
  args_info->help_help = gengetopt_args_info_help[0] ; | 
| 168 | 
+ | 
  args_info->version_help = gengetopt_args_info_help[1] ; | 
| 169 | 
+ | 
  args_info->input_help = gengetopt_args_info_help[2] ; | 
| 170 | 
+ | 
  args_info->output_help = gengetopt_args_info_help[3] ; | 
| 171 | 
+ | 
  args_info->step_help = gengetopt_args_info_help[4] ; | 
| 172 | 
+ | 
  args_info->nbins_help = gengetopt_args_info_help[5] ; | 
| 173 | 
+ | 
  args_info->nbins_x_help = gengetopt_args_info_help[6] ; | 
| 174 | 
+ | 
  args_info->nbins_y_help = gengetopt_args_info_help[7] ; | 
| 175 | 
+ | 
  args_info->nanglebins_help = gengetopt_args_info_help[8] ; | 
| 176 | 
+ | 
  args_info->length_help = gengetopt_args_info_help[9] ; | 
| 177 | 
+ | 
  args_info->rcut_help = gengetopt_args_info_help[10] ; | 
| 178 | 
+ | 
  args_info->zoffset_help = gengetopt_args_info_help[11] ; | 
| 179 | 
+ | 
  args_info->sele1_help = gengetopt_args_info_help[12] ; | 
| 180 | 
+ | 
  args_info->sele2_help = gengetopt_args_info_help[13] ; | 
| 181 | 
+ | 
  args_info->sele3_help = gengetopt_args_info_help[14] ; | 
| 182 | 
+ | 
  args_info->refsele_help = gengetopt_args_info_help[15] ; | 
| 183 | 
+ | 
  args_info->molname_help = gengetopt_args_info_help[16] ; | 
| 184 | 
+ | 
  args_info->begin_help = gengetopt_args_info_help[17] ; | 
| 185 | 
+ | 
  args_info->end_help = gengetopt_args_info_help[18] ; | 
| 186 | 
+ | 
  args_info->radius_help = gengetopt_args_info_help[19] ; | 
| 187 | 
+ | 
  args_info->bo_help = gengetopt_args_info_help[20] ; | 
| 188 | 
+ | 
  args_info->bor_help = gengetopt_args_info_help[21] ; | 
| 189 | 
+ | 
  args_info->bad_help = gengetopt_args_info_help[22] ; | 
| 190 | 
+ | 
  args_info->gofr_help = gengetopt_args_info_help[23] ; | 
| 191 | 
+ | 
  args_info->r_theta_help = gengetopt_args_info_help[24] ; | 
| 192 | 
+ | 
  args_info->r_omega_help = gengetopt_args_info_help[25] ; | 
| 193 | 
+ | 
  args_info->theta_omega_help = gengetopt_args_info_help[26] ; | 
| 194 | 
+ | 
  args_info->gxyz_help = gengetopt_args_info_help[27] ; | 
| 195 | 
+ | 
  args_info->p2_help = gengetopt_args_info_help[28] ; | 
| 196 | 
+ | 
  args_info->rp2_help = gengetopt_args_info_help[29] ; | 
| 197 | 
+ | 
  args_info->scd_help = gengetopt_args_info_help[30] ; | 
| 198 | 
+ | 
  args_info->density_help = gengetopt_args_info_help[31] ; | 
| 199 | 
+ | 
  args_info->slab_density_help = gengetopt_args_info_help[32] ; | 
| 200 | 
+ | 
  args_info->hxy_help = gengetopt_args_info_help[33] ; | 
| 201 | 
+ | 
  args_info->rho_r_help = gengetopt_args_info_help[34] ; | 
| 202 | 
+ | 
  args_info->hullvol_help = gengetopt_args_info_help[35] ; | 
| 203 | 
+ | 
   | 
| 204 | 
+ | 
} | 
| 205 | 
+ | 
 | 
| 206 | 
  | 
void | 
| 207 | 
  | 
cmdline_parser_print_version (void) | 
| 208 | 
  | 
{ | 
| 212 | 
  | 
void | 
| 213 | 
  | 
cmdline_parser_print_help (void) | 
| 214 | 
  | 
{ | 
| 215 | 
+ | 
  int i = 0; | 
| 216 | 
  | 
  cmdline_parser_print_version (); | 
| 217 | 
< | 
  printf("\nUsage: StaticProps [OPTIONS]...\n\n"); | 
| 218 | 
< | 
  printf("%s\n","  -h, --help                    Print help and exit"); | 
| 219 | 
< | 
  printf("%s\n","  -V, --version                 Print version and exit"); | 
| 220 | 
< | 
  printf("%s\n","  -i, --input=filename          input dump file"); | 
| 221 | 
< | 
  printf("%s\n","  -o, --output=filename         output file name"); | 
| 222 | 
< | 
  printf("%s\n","  -n, --step=INT                process every n frame  (default=`1')"); | 
| 223 | 
< | 
  printf("%s\n","  -r, --nrbins=INT              number of bins for distance  (default=`100')"); | 
| 224 | 
< | 
  printf("%s\n","  -x, --nbins_x=INT             number of bins in x axis  (default=`100')"); | 
| 225 | 
< | 
  printf("%s\n","  -y, --nbins_y=INT             number of bins in y axis  (default=`100')"); | 
| 226 | 
< | 
  printf("%s\n","  -a, --nanglebins=INT          number of bins for cos(angle)  (default=`50')"); | 
| 227 | 
< | 
  printf("%s\n","      --length=DOUBLE           maximum length (Defaults to 1/2 smallest length \n                                  of first frame)"); | 
| 134 | 
< | 
  printf("%s\n","  -l, --LegendreL=INT           Order of Legendre Polynomial (used for Bond \n                                  Order calculations)"); | 
| 135 | 
< | 
  printf("%s\n","  -c, --rcut=DOUBLE             cutoff radius (rcut)"); | 
| 136 | 
< | 
  printf("%s\n","  -z, --zoffset=DOUBLE          Where to set the zero for the slab_density \n                                  calculation  (default=`0')"); | 
| 137 | 
< | 
  printf("%s\n","      --sele1=selection script  select the first stuntdouble set"); | 
| 138 | 
< | 
  printf("%s\n","      --sele2=selection script  select the second stuntdouble set"); | 
| 139 | 
< | 
  printf("%s\n","      --sele3=selection script  select the third stuntdouble set"); | 
| 140 | 
< | 
  printf("%s\n","      --refsele=selection script\n                                select reference (use and only use with --gxyz)"); | 
| 141 | 
< | 
  printf("%s\n","      --molname=STRING          molecule name"); | 
| 142 | 
< | 
  printf("%s\n","      --begin=INT               begin internal index"); | 
| 143 | 
< | 
  printf("%s\n","      --end=INT                 end internal index"); | 
| 144 | 
< | 
  printf("%s\n","\n Group: staticProps\n   an option of this group is required"); | 
| 145 | 
< | 
  printf("%s\n","  -b, --bo                      bond order parameter (--rcut and --LegendreL \n                                  must be specified"); | 
| 146 | 
< | 
  printf("%s\n","  -g, --gofr                    g(r)"); | 
| 147 | 
< | 
  printf("%s\n","      --r_theta                 g(r, cos(theta))"); | 
| 148 | 
< | 
  printf("%s\n","      --r_omega                 g(r, cos(omega))"); | 
| 149 | 
< | 
  printf("%s\n","      --theta_omega             g(cos(theta), cos(omega))"); | 
| 150 | 
< | 
  printf("%s\n","      --gxyz                    g(x, y, z)"); | 
| 151 | 
< | 
  printf("%s\n","  -p, --p2                      p2 order parameter (--sele1 and --sele2 must be \n                                  specified)"); | 
| 152 | 
< | 
  printf("%s\n","      --rp2                     rp2 order parameter (--sele1 and --sele2 must \n                                  be specified)"); | 
| 153 | 
< | 
  printf("%s\n","  -s, --scd                     scd order parameter (either --sele1, --sele2, \n                                  --sele3 are specified or --molname, --begin, \n                                  --end are specified)"); | 
| 154 | 
< | 
  printf("%s\n","  -d, --density                 density plot"); | 
| 155 | 
< | 
  printf("%s\n","      --slab_density            slab density"); | 
| 156 | 
< | 
  printf("%s\n","      --hxy                     hxy"); | 
| 157 | 
< | 
   | 
| 217 | 
> | 
 | 
| 218 | 
> | 
  if (strlen(gengetopt_args_info_purpose) > 0) | 
| 219 | 
> | 
    printf("\n%s\n", gengetopt_args_info_purpose); | 
| 220 | 
> | 
 | 
| 221 | 
> | 
  printf("\n%s\n\n", gengetopt_args_info_usage); | 
| 222 | 
> | 
 | 
| 223 | 
> | 
  if (strlen(gengetopt_args_info_description) > 0) | 
| 224 | 
> | 
    printf("%s\n", gengetopt_args_info_description); | 
| 225 | 
> | 
 | 
| 226 | 
> | 
  while (gengetopt_args_info_help[i]) | 
| 227 | 
> | 
    printf("%s\n", gengetopt_args_info_help[i++]); | 
| 228 | 
  | 
} | 
| 229 | 
  | 
 | 
| 230 | 
  | 
void | 
| 232 | 
  | 
{ | 
| 233 | 
  | 
  clear_given (args_info); | 
| 234 | 
  | 
  clear_args (args_info); | 
| 235 | 
+ | 
  init_args_info (args_info); | 
| 236 | 
+ | 
 | 
| 237 | 
+ | 
  args_info->inputs = NULL; | 
| 238 | 
+ | 
  args_info->inputs_num = 0; | 
| 239 | 
  | 
} | 
| 240 | 
  | 
 | 
| 241 | 
  | 
static void | 
| 242 | 
  | 
cmdline_parser_release (struct gengetopt_args_info *args_info) | 
| 243 | 
  | 
{ | 
| 244 | 
  | 
   | 
| 245 | 
+ | 
  unsigned int i; | 
| 246 | 
  | 
  if (args_info->input_arg) | 
| 247 | 
  | 
    { | 
| 248 | 
  | 
      free (args_info->input_arg); /* free previous argument */ | 
| 268 | 
  | 
      free (args_info->step_orig); /* free previous argument */ | 
| 269 | 
  | 
      args_info->step_orig = 0; | 
| 270 | 
  | 
    } | 
| 271 | 
< | 
  if (args_info->nrbins_orig) | 
| 271 | 
> | 
  if (args_info->nbins_orig) | 
| 272 | 
  | 
    { | 
| 273 | 
< | 
      free (args_info->nrbins_orig); /* free previous argument */ | 
| 274 | 
< | 
      args_info->nrbins_orig = 0; | 
| 273 | 
> | 
      free (args_info->nbins_orig); /* free previous argument */ | 
| 274 | 
> | 
      args_info->nbins_orig = 0; | 
| 275 | 
  | 
    } | 
| 276 | 
  | 
  if (args_info->nbins_x_orig) | 
| 277 | 
  | 
    { | 
| 293 | 
  | 
      free (args_info->length_orig); /* free previous argument */ | 
| 294 | 
  | 
      args_info->length_orig = 0; | 
| 295 | 
  | 
    } | 
| 221 | 
– | 
  if (args_info->LegendreL_orig) | 
| 222 | 
– | 
    { | 
| 223 | 
– | 
      free (args_info->LegendreL_orig); /* free previous argument */ | 
| 224 | 
– | 
      args_info->LegendreL_orig = 0; | 
| 225 | 
– | 
    } | 
| 296 | 
  | 
  if (args_info->rcut_orig) | 
| 297 | 
  | 
    { | 
| 298 | 
  | 
      free (args_info->rcut_orig); /* free previous argument */ | 
| 363 | 
  | 
      free (args_info->end_orig); /* free previous argument */ | 
| 364 | 
  | 
      args_info->end_orig = 0; | 
| 365 | 
  | 
    } | 
| 366 | 
+ | 
  if (args_info->radius_orig) | 
| 367 | 
+ | 
    { | 
| 368 | 
+ | 
      free (args_info->radius_orig); /* free previous argument */ | 
| 369 | 
+ | 
      args_info->radius_orig = 0; | 
| 370 | 
+ | 
    } | 
| 371 | 
  | 
   | 
| 372 | 
+ | 
  for (i = 0; i < args_info->inputs_num; ++i) | 
| 373 | 
+ | 
    free (args_info->inputs [i]); | 
| 374 | 
+ | 
   | 
| 375 | 
+ | 
  if (args_info->inputs_num) | 
| 376 | 
+ | 
    free (args_info->inputs); | 
| 377 | 
+ | 
   | 
| 378 | 
  | 
  clear_given (args_info); | 
| 379 | 
  | 
} | 
| 380 | 
  | 
 | 
| 419 | 
  | 
      fprintf(outfile, "%s\n", "step"); | 
| 420 | 
  | 
    } | 
| 421 | 
  | 
  } | 
| 422 | 
< | 
  if (args_info->nrbins_given) { | 
| 423 | 
< | 
    if (args_info->nrbins_orig) { | 
| 424 | 
< | 
      fprintf(outfile, "%s=\"%s\"\n", "nrbins", args_info->nrbins_orig); | 
| 422 | 
> | 
  if (args_info->nbins_given) { | 
| 423 | 
> | 
    if (args_info->nbins_orig) { | 
| 424 | 
> | 
      fprintf(outfile, "%s=\"%s\"\n", "nbins", args_info->nbins_orig); | 
| 425 | 
  | 
    } else { | 
| 426 | 
< | 
      fprintf(outfile, "%s\n", "nrbins"); | 
| 426 | 
> | 
      fprintf(outfile, "%s\n", "nbins"); | 
| 427 | 
  | 
    } | 
| 428 | 
  | 
  } | 
| 429 | 
  | 
  if (args_info->nbins_x_given) { | 
| 454 | 
  | 
      fprintf(outfile, "%s\n", "length"); | 
| 455 | 
  | 
    } | 
| 456 | 
  | 
  } | 
| 376 | 
– | 
  if (args_info->LegendreL_given) { | 
| 377 | 
– | 
    if (args_info->LegendreL_orig) { | 
| 378 | 
– | 
      fprintf(outfile, "%s=\"%s\"\n", "LegendreL", args_info->LegendreL_orig); | 
| 379 | 
– | 
    } else { | 
| 380 | 
– | 
      fprintf(outfile, "%s\n", "LegendreL"); | 
| 381 | 
– | 
    } | 
| 382 | 
– | 
  } | 
| 457 | 
  | 
  if (args_info->rcut_given) { | 
| 458 | 
  | 
    if (args_info->rcut_orig) { | 
| 459 | 
  | 
      fprintf(outfile, "%s=\"%s\"\n", "rcut", args_info->rcut_orig); | 
| 517 | 
  | 
      fprintf(outfile, "%s\n", "end"); | 
| 518 | 
  | 
    } | 
| 519 | 
  | 
  } | 
| 520 | 
+ | 
  if (args_info->radius_given) { | 
| 521 | 
+ | 
    if (args_info->radius_orig) { | 
| 522 | 
+ | 
      fprintf(outfile, "%s=\"%s\"\n", "radius", args_info->radius_orig); | 
| 523 | 
+ | 
    } else { | 
| 524 | 
+ | 
      fprintf(outfile, "%s\n", "radius"); | 
| 525 | 
+ | 
    } | 
| 526 | 
+ | 
  } | 
| 527 | 
  | 
  if (args_info->bo_given) { | 
| 528 | 
  | 
    fprintf(outfile, "%s\n", "bo"); | 
| 529 | 
  | 
  } | 
| 530 | 
+ | 
  if (args_info->bor_given) { | 
| 531 | 
+ | 
    fprintf(outfile, "%s\n", "bor"); | 
| 532 | 
+ | 
  } | 
| 533 | 
+ | 
  if (args_info->bad_given) { | 
| 534 | 
+ | 
    fprintf(outfile, "%s\n", "bad"); | 
| 535 | 
+ | 
  } | 
| 536 | 
  | 
  if (args_info->gofr_given) { | 
| 537 | 
  | 
    fprintf(outfile, "%s\n", "gofr"); | 
| 538 | 
  | 
  } | 
| 565 | 
  | 
  } | 
| 566 | 
  | 
  if (args_info->hxy_given) { | 
| 567 | 
  | 
    fprintf(outfile, "%s\n", "hxy"); | 
| 568 | 
+ | 
  } | 
| 569 | 
+ | 
  if (args_info->rho_r_given) { | 
| 570 | 
+ | 
    fprintf(outfile, "%s\n", "rho_r"); | 
| 571 | 
+ | 
  } | 
| 572 | 
+ | 
  if (args_info->hullvol_given) { | 
| 573 | 
+ | 
    fprintf(outfile, "%s\n", "hullvol"); | 
| 574 | 
  | 
  } | 
| 575 | 
  | 
   | 
| 576 | 
  | 
  fclose (outfile); | 
| 612 | 
  | 
    return; | 
| 613 | 
  | 
   | 
| 614 | 
  | 
  args_info->bo_given = 0 ; | 
| 615 | 
+ | 
  args_info->bor_given = 0 ; | 
| 616 | 
+ | 
  args_info->bad_given = 0 ; | 
| 617 | 
  | 
  args_info->gofr_given = 0 ; | 
| 618 | 
  | 
  args_info->r_theta_given = 0 ; | 
| 619 | 
  | 
  args_info->r_omega_given = 0 ; | 
| 625 | 
  | 
  args_info->density_given = 0 ; | 
| 626 | 
  | 
  args_info->slab_density_given = 0 ; | 
| 627 | 
  | 
  args_info->hxy_given = 0 ; | 
| 628 | 
+ | 
  args_info->rho_r_given = 0 ; | 
| 629 | 
+ | 
  args_info->hullvol_given = 0 ; | 
| 630 | 
  | 
 | 
| 631 | 
  | 
  args_info->staticProps_group_counter = 0; | 
| 632 | 
  | 
} | 
| 675 | 
  | 
{ | 
| 676 | 
  | 
  int error = 0; | 
| 677 | 
  | 
 | 
| 678 | 
+ | 
  /* checks for required options */ | 
| 679 | 
  | 
  if (! args_info->input_given) | 
| 680 | 
  | 
    { | 
| 681 | 
  | 
      fprintf (stderr, "%s: '--input' ('-i') option required%s\n", prog_name, (additional_error ? additional_error : "")); | 
| 682 | 
  | 
      error = 1; | 
| 683 | 
  | 
    } | 
| 684 | 
+ | 
   | 
| 685 | 
  | 
  if (args_info->staticProps_group_counter == 0) | 
| 686 | 
  | 
    { | 
| 687 | 
  | 
      fprintf (stderr, "%s: %d options of group staticProps were given. One is required.%s\n", prog_name, args_info->staticProps_group_counter, (additional_error ? additional_error : "")); | 
| 689 | 
  | 
    } | 
| 690 | 
  | 
   | 
| 691 | 
  | 
 | 
| 692 | 
+ | 
  /* checks for dependences among options */ | 
| 693 | 
+ | 
 | 
| 694 | 
  | 
  return error; | 
| 695 | 
  | 
} | 
| 696 | 
  | 
 | 
| 723 | 
  | 
        { "input",      1, NULL, 'i' }, | 
| 724 | 
  | 
        { "output",     1, NULL, 'o' }, | 
| 725 | 
  | 
        { "step",       1, NULL, 'n' }, | 
| 726 | 
< | 
        { "nrbins",     1, NULL, 'r' }, | 
| 726 | 
> | 
        { "nbins",      1, NULL, 'b' }, | 
| 727 | 
  | 
        { "nbins_x",    1, NULL, 'x' }, | 
| 728 | 
  | 
        { "nbins_y",    1, NULL, 'y' }, | 
| 729 | 
  | 
        { "nanglebins", 1, NULL, 'a' }, | 
| 730 | 
  | 
        { "length",     1, NULL, 0 }, | 
| 630 | 
– | 
        { "LegendreL",  1, NULL, 'l' }, | 
| 731 | 
  | 
        { "rcut",       1, NULL, 'c' }, | 
| 732 | 
  | 
        { "zoffset",    1, NULL, 'z' }, | 
| 733 | 
  | 
        { "sele1",      1, NULL, 0 }, | 
| 737 | 
  | 
        { "molname",    1, NULL, 0 }, | 
| 738 | 
  | 
        { "begin",      1, NULL, 0 }, | 
| 739 | 
  | 
        { "end",        1, NULL, 0 }, | 
| 740 | 
< | 
        { "bo", 0, NULL, 'b' }, | 
| 740 | 
> | 
        { "radius",     1, NULL, 0 }, | 
| 741 | 
> | 
        { "bo", 0, NULL, 0 }, | 
| 742 | 
> | 
        { "bor",        0, NULL, 0 }, | 
| 743 | 
> | 
        { "bad",        0, NULL, 0 }, | 
| 744 | 
  | 
        { "gofr",       0, NULL, 'g' }, | 
| 745 | 
  | 
        { "r_theta",    0, NULL, 0 }, | 
| 746 | 
  | 
        { "r_omega",    0, NULL, 0 }, | 
| 752 | 
  | 
        { "density",    0, NULL, 'd' }, | 
| 753 | 
  | 
        { "slab_density",       0, NULL, 0 }, | 
| 754 | 
  | 
        { "hxy",        0, NULL, 0 }, | 
| 755 | 
+ | 
        { "rho_r",      0, NULL, 0 }, | 
| 756 | 
+ | 
        { "hullvol",    0, NULL, 0 }, | 
| 757 | 
  | 
        { NULL, 0, NULL, 0 } | 
| 758 | 
  | 
      }; | 
| 759 | 
  | 
 | 
| 760 | 
  | 
      stop_char = 0; | 
| 761 | 
< | 
      c = getopt_long (argc, argv, "hVi:o:n:r:x:y:a:l:c:z:bgpsd", long_options, &option_index); | 
| 761 | 
> | 
      c = getopt_long (argc, argv, "hVi:o:n:b:x:y:a:c:z:gpsd", long_options, &option_index); | 
| 762 | 
  | 
 | 
| 763 | 
  | 
      if (c == -1) break;       /* Exit from `while (1)' loop.  */ | 
| 764 | 
  | 
 | 
| 830 | 
  | 
          args_info->step_orig = gengetopt_strdup (optarg); | 
| 831 | 
  | 
          break; | 
| 832 | 
  | 
 | 
| 833 | 
< | 
        case 'r':       /* number of bins for distance.  */ | 
| 834 | 
< | 
          if (local_args_info.nrbins_given) | 
| 833 | 
> | 
        case 'b':       /* number of bins (general purpose).  */ | 
| 834 | 
> | 
          if (local_args_info.nbins_given) | 
| 835 | 
  | 
            { | 
| 836 | 
< | 
              fprintf (stderr, "%s: `--nrbins' (`-r') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 836 | 
> | 
              fprintf (stderr, "%s: `--nbins' (`-b') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 837 | 
  | 
              goto failure; | 
| 838 | 
  | 
            } | 
| 839 | 
< | 
          if (args_info->nrbins_given && ! override) | 
| 839 | 
> | 
          if (args_info->nbins_given && ! override) | 
| 840 | 
  | 
            continue; | 
| 841 | 
< | 
          local_args_info.nrbins_given = 1; | 
| 842 | 
< | 
          args_info->nrbins_given = 1; | 
| 843 | 
< | 
          args_info->nrbins_arg = strtol (optarg, &stop_char, 0); | 
| 841 | 
> | 
          local_args_info.nbins_given = 1; | 
| 842 | 
> | 
          args_info->nbins_given = 1; | 
| 843 | 
> | 
          args_info->nbins_arg = strtol (optarg, &stop_char, 0); | 
| 844 | 
  | 
          if (!(stop_char && *stop_char == '\0')) { | 
| 845 | 
  | 
            fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); | 
| 846 | 
  | 
            goto failure; | 
| 847 | 
  | 
          } | 
| 848 | 
< | 
          if (args_info->nrbins_orig) | 
| 849 | 
< | 
            free (args_info->nrbins_orig); /* free previous string */ | 
| 850 | 
< | 
          args_info->nrbins_orig = gengetopt_strdup (optarg); | 
| 848 | 
> | 
          if (args_info->nbins_orig) | 
| 849 | 
> | 
            free (args_info->nbins_orig); /* free previous string */ | 
| 850 | 
> | 
          args_info->nbins_orig = gengetopt_strdup (optarg); | 
| 851 | 
  | 
          break; | 
| 852 | 
  | 
 | 
| 853 | 
  | 
        case 'x':       /* number of bins in x axis.  */ | 
| 910 | 
  | 
          args_info->nanglebins_orig = gengetopt_strdup (optarg); | 
| 911 | 
  | 
          break; | 
| 912 | 
  | 
 | 
| 808 | 
– | 
        case 'l':       /* Order of Legendre Polynomial (used for Bond Order calculations).  */ | 
| 809 | 
– | 
          if (local_args_info.LegendreL_given) | 
| 810 | 
– | 
            { | 
| 811 | 
– | 
              fprintf (stderr, "%s: `--LegendreL' (`-l') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 812 | 
– | 
              goto failure; | 
| 813 | 
– | 
            } | 
| 814 | 
– | 
          if (args_info->LegendreL_given && ! override) | 
| 815 | 
– | 
            continue; | 
| 816 | 
– | 
          local_args_info.LegendreL_given = 1; | 
| 817 | 
– | 
          args_info->LegendreL_given = 1; | 
| 818 | 
– | 
          args_info->LegendreL_arg = strtol (optarg, &stop_char, 0); | 
| 819 | 
– | 
          if (!(stop_char && *stop_char == '\0')) { | 
| 820 | 
– | 
            fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); | 
| 821 | 
– | 
            goto failure; | 
| 822 | 
– | 
          } | 
| 823 | 
– | 
          if (args_info->LegendreL_orig) | 
| 824 | 
– | 
            free (args_info->LegendreL_orig); /* free previous string */ | 
| 825 | 
– | 
          args_info->LegendreL_orig = gengetopt_strdup (optarg); | 
| 826 | 
– | 
          break; | 
| 827 | 
– | 
 | 
| 913 | 
  | 
        case 'c':       /* cutoff radius (rcut).  */ | 
| 914 | 
  | 
          if (local_args_info.rcut_given) | 
| 915 | 
  | 
            { | 
| 950 | 
  | 
          args_info->zoffset_orig = gengetopt_strdup (optarg); | 
| 951 | 
  | 
          break; | 
| 952 | 
  | 
 | 
| 868 | 
– | 
        case 'b':       /* bond order parameter (--rcut and --LegendreL must be specified.  */ | 
| 869 | 
– | 
          if (local_args_info.bo_given) | 
| 870 | 
– | 
            { | 
| 871 | 
– | 
              fprintf (stderr, "%s: `--bo' (`-b') option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 872 | 
– | 
              goto failure; | 
| 873 | 
– | 
            } | 
| 874 | 
– | 
          if (args_info->bo_given && ! override) | 
| 875 | 
– | 
            continue; | 
| 876 | 
– | 
          local_args_info.bo_given = 1; | 
| 877 | 
– | 
          args_info->bo_given = 1; | 
| 878 | 
– | 
          if (args_info->staticProps_group_counter && override) | 
| 879 | 
– | 
            reset_group_staticProps (args_info); | 
| 880 | 
– | 
          args_info->staticProps_group_counter += 1; | 
| 881 | 
– | 
          break; | 
| 882 | 
– | 
 | 
| 953 | 
  | 
        case 'g':       /* g(r).  */ | 
| 954 | 
  | 
          if (local_args_info.gofr_given) | 
| 955 | 
  | 
            { | 
| 1170 | 
  | 
              free (args_info->end_orig); /* free previous string */ | 
| 1171 | 
  | 
            args_info->end_orig = gengetopt_strdup (optarg); | 
| 1172 | 
  | 
          } | 
| 1173 | 
+ | 
          /* nanoparticle radius.  */ | 
| 1174 | 
+ | 
          else if (strcmp (long_options[option_index].name, "radius") == 0) | 
| 1175 | 
+ | 
          { | 
| 1176 | 
+ | 
            if (local_args_info.radius_given) | 
| 1177 | 
+ | 
              { | 
| 1178 | 
+ | 
                fprintf (stderr, "%s: `--radius' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1179 | 
+ | 
                goto failure; | 
| 1180 | 
+ | 
              } | 
| 1181 | 
+ | 
            if (args_info->radius_given && ! override) | 
| 1182 | 
+ | 
              continue; | 
| 1183 | 
+ | 
            local_args_info.radius_given = 1; | 
| 1184 | 
+ | 
            args_info->radius_given = 1; | 
| 1185 | 
+ | 
            args_info->radius_arg = strtod (optarg, &stop_char); | 
| 1186 | 
+ | 
            if (!(stop_char && *stop_char == '\0')) { | 
| 1187 | 
+ | 
              fprintf(stderr, "%s: invalid numeric value: %s\n", argv[0], optarg); | 
| 1188 | 
+ | 
              goto failure; | 
| 1189 | 
+ | 
            } | 
| 1190 | 
+ | 
            if (args_info->radius_orig) | 
| 1191 | 
+ | 
              free (args_info->radius_orig); /* free previous string */ | 
| 1192 | 
+ | 
            args_info->radius_orig = gengetopt_strdup (optarg); | 
| 1193 | 
+ | 
          } | 
| 1194 | 
+ | 
          /* bond order parameter (--rcut must be specified).  */ | 
| 1195 | 
+ | 
          else if (strcmp (long_options[option_index].name, "bo") == 0) | 
| 1196 | 
+ | 
          { | 
| 1197 | 
+ | 
            if (local_args_info.bo_given) | 
| 1198 | 
+ | 
              { | 
| 1199 | 
+ | 
                fprintf (stderr, "%s: `--bo' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1200 | 
+ | 
                goto failure; | 
| 1201 | 
+ | 
              } | 
| 1202 | 
+ | 
            if (args_info->bo_given && ! override) | 
| 1203 | 
+ | 
              continue; | 
| 1204 | 
+ | 
            local_args_info.bo_given = 1; | 
| 1205 | 
+ | 
            args_info->bo_given = 1; | 
| 1206 | 
+ | 
            if (args_info->staticProps_group_counter && override) | 
| 1207 | 
+ | 
              reset_group_staticProps (args_info); | 
| 1208 | 
+ | 
            args_info->staticProps_group_counter += 1; | 
| 1209 | 
+ | 
            break; | 
| 1210 | 
+ | 
          } | 
| 1211 | 
+ | 
          /* bond order parameter as a function of radius (--rcut must be specified).  */ | 
| 1212 | 
+ | 
          else if (strcmp (long_options[option_index].name, "bor") == 0) | 
| 1213 | 
+ | 
          { | 
| 1214 | 
+ | 
            if (local_args_info.bor_given) | 
| 1215 | 
+ | 
              { | 
| 1216 | 
+ | 
                fprintf (stderr, "%s: `--bor' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1217 | 
+ | 
                goto failure; | 
| 1218 | 
+ | 
              } | 
| 1219 | 
+ | 
            if (args_info->bor_given && ! override) | 
| 1220 | 
+ | 
              continue; | 
| 1221 | 
+ | 
            local_args_info.bor_given = 1; | 
| 1222 | 
+ | 
            args_info->bor_given = 1; | 
| 1223 | 
+ | 
            if (args_info->staticProps_group_counter && override) | 
| 1224 | 
+ | 
              reset_group_staticProps (args_info); | 
| 1225 | 
+ | 
            args_info->staticProps_group_counter += 1; | 
| 1226 | 
+ | 
            break; | 
| 1227 | 
+ | 
          } | 
| 1228 | 
+ | 
          /* N(theta) bond angle density within (--rcut must be specified).  */ | 
| 1229 | 
+ | 
          else if (strcmp (long_options[option_index].name, "bad") == 0) | 
| 1230 | 
+ | 
          { | 
| 1231 | 
+ | 
            if (local_args_info.bad_given) | 
| 1232 | 
+ | 
              { | 
| 1233 | 
+ | 
                fprintf (stderr, "%s: `--bad' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1234 | 
+ | 
                goto failure; | 
| 1235 | 
+ | 
              } | 
| 1236 | 
+ | 
            if (args_info->bad_given && ! override) | 
| 1237 | 
+ | 
              continue; | 
| 1238 | 
+ | 
            local_args_info.bad_given = 1; | 
| 1239 | 
+ | 
            args_info->bad_given = 1; | 
| 1240 | 
+ | 
            if (args_info->staticProps_group_counter && override) | 
| 1241 | 
+ | 
              reset_group_staticProps (args_info); | 
| 1242 | 
+ | 
            args_info->staticProps_group_counter += 1; | 
| 1243 | 
+ | 
            break; | 
| 1244 | 
+ | 
          } | 
| 1245 | 
  | 
          /* g(r, cos(theta)).  */ | 
| 1246 | 
  | 
          else if (strcmp (long_options[option_index].name, "r_theta") == 0) | 
| 1247 | 
  | 
          { | 
| 1361 | 
  | 
            args_info->staticProps_group_counter += 1; | 
| 1362 | 
  | 
            break; | 
| 1363 | 
  | 
          } | 
| 1364 | 
+ | 
          /* rho of R.  */ | 
| 1365 | 
+ | 
          else if (strcmp (long_options[option_index].name, "rho_r") == 0) | 
| 1366 | 
+ | 
          { | 
| 1367 | 
+ | 
            if (local_args_info.rho_r_given) | 
| 1368 | 
+ | 
              { | 
| 1369 | 
+ | 
                fprintf (stderr, "%s: `--rho_r' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1370 | 
+ | 
                goto failure; | 
| 1371 | 
+ | 
              } | 
| 1372 | 
+ | 
            if (args_info->rho_r_given && ! override) | 
| 1373 | 
+ | 
              continue; | 
| 1374 | 
+ | 
            local_args_info.rho_r_given = 1; | 
| 1375 | 
+ | 
            args_info->rho_r_given = 1; | 
| 1376 | 
+ | 
            if (args_info->staticProps_group_counter && override) | 
| 1377 | 
+ | 
              reset_group_staticProps (args_info); | 
| 1378 | 
+ | 
            args_info->staticProps_group_counter += 1; | 
| 1379 | 
+ | 
            break; | 
| 1380 | 
+ | 
          } | 
| 1381 | 
+ | 
          /* hull volume of nanoparticle.  */ | 
| 1382 | 
+ | 
          else if (strcmp (long_options[option_index].name, "hullvol") == 0) | 
| 1383 | 
+ | 
          { | 
| 1384 | 
+ | 
            if (local_args_info.hullvol_given) | 
| 1385 | 
+ | 
              { | 
| 1386 | 
+ | 
                fprintf (stderr, "%s: `--hullvol' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 1387 | 
+ | 
                goto failure; | 
| 1388 | 
+ | 
              } | 
| 1389 | 
+ | 
            if (args_info->hullvol_given && ! override) | 
| 1390 | 
+ | 
              continue; | 
| 1391 | 
+ | 
            local_args_info.hullvol_given = 1; | 
| 1392 | 
+ | 
            args_info->hullvol_given = 1; | 
| 1393 | 
+ | 
            if (args_info->staticProps_group_counter && override) | 
| 1394 | 
+ | 
              reset_group_staticProps (args_info); | 
| 1395 | 
+ | 
            args_info->staticProps_group_counter += 1; | 
| 1396 | 
+ | 
            break; | 
| 1397 | 
+ | 
          } | 
| 1398 | 
  | 
           | 
| 1399 | 
  | 
          break; | 
| 1400 | 
  | 
        case '?':       /* Invalid option.  */ | 
| 1425 | 
  | 
  if ( error ) | 
| 1426 | 
  | 
    return (EXIT_FAILURE); | 
| 1427 | 
  | 
 | 
| 1428 | 
+ | 
  if (optind < argc) | 
| 1429 | 
+ | 
    { | 
| 1430 | 
+ | 
      int i = 0 ; | 
| 1431 | 
+ | 
      int found_prog_name = 0; | 
| 1432 | 
+ | 
      /* whether program name, i.e., argv[0], is in the remaining args | 
| 1433 | 
+ | 
         (this may happen with some implementations of getopt, | 
| 1434 | 
+ | 
          but surely not with the one included by gengetopt) */ | 
| 1435 | 
+ | 
 | 
| 1436 | 
+ | 
      i = optind; | 
| 1437 | 
+ | 
      while (i < argc) | 
| 1438 | 
+ | 
        if (argv[i++] == argv[0]) { | 
| 1439 | 
+ | 
          found_prog_name = 1; | 
| 1440 | 
+ | 
          break; | 
| 1441 | 
+ | 
        } | 
| 1442 | 
+ | 
      i = 0; | 
| 1443 | 
+ | 
 | 
| 1444 | 
+ | 
      args_info->inputs_num = argc - optind - found_prog_name; | 
| 1445 | 
+ | 
      args_info->inputs = | 
| 1446 | 
+ | 
        (char **)(malloc ((args_info->inputs_num)*sizeof(char *))) ; | 
| 1447 | 
+ | 
      while (optind < argc) | 
| 1448 | 
+ | 
        if (argv[optind++] != argv[0]) | 
| 1449 | 
+ | 
          args_info->inputs[ i++ ] = gengetopt_strdup (argv[optind-1]) ; | 
| 1450 | 
+ | 
    } | 
| 1451 | 
+ | 
 | 
| 1452 | 
  | 
  return 0; | 
| 1453 | 
  | 
 | 
| 1454 | 
  | 
failure: |