| 1 |  | /* | 
| 2 | < | File autogenerated by gengetopt version 2.15 | 
| 2 | > | File autogenerated by gengetopt version 2.19.1 | 
| 3 |  | generated with the following command: | 
| 4 | < | gengetopt -i DynamicProps.ggo --file-name=DynamicPropsCmd | 
| 4 | > | gengetopt -F DynamicPropsCmd | 
| 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 "DynamicPropsCmd.h" | 
| 23 |  |  | 
| 24 | + | const char *gengetopt_args_info_purpose = ""; | 
| 25 | + |  | 
| 26 | + | const char *gengetopt_args_info_usage = "Usage: DynamicProps [OPTIONS]..."; | 
| 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 | + | "      --sele1=selection script  select first stuntdouble set", | 
| 36 | + | "      --sele2=selection script  select second stuntdouble set (if sele2 is not \n                                  set, use script from sele1)", | 
| 37 | + | "      --order=INT               Lengendre Polynomial Order", | 
| 38 | + | "\n Group: dynamicProps\n   an option of this group is required", | 
| 39 | + | "  -r, --rcorr                   rmsd", | 
| 40 | + | "  -v, --vcorr                   velocity correlation function", | 
| 41 | + | "  -d, --dcorr                   dipole correlation function", | 
| 42 | + | "  -l, --lcorr                   Lengendre correlation function", | 
| 43 | + | "      --r_rcorr                 Radial rmsd", | 
| 44 | + | "      --thetacorr               Angular rmsd", | 
| 45 | + | "      --drcorr                  Directional rmsd for particles with unit \n                                  vectors", | 
| 46 | + | 0 | 
| 47 | + | }; | 
| 48 | + |  | 
| 49 |  | static | 
| 50 |  | void clear_given (struct gengetopt_args_info *args_info); | 
| 51 |  | static | 
| 75 |  | args_info->dcorr_given = 0 ; | 
| 76 |  | args_info->lcorr_given = 0 ; | 
| 77 |  | args_info->r_rcorr_given = 0 ; | 
| 78 | + | args_info->thetacorr_given = 0 ; | 
| 79 | + | args_info->drcorr_given = 0 ; | 
| 80 |  | args_info->dynamicProps_group_counter = 0 ; | 
| 81 |  | } | 
| 82 |  |  | 
| 95 |  |  | 
| 96 |  | } | 
| 97 |  |  | 
| 98 | + | static | 
| 99 | + | void init_args_info(struct gengetopt_args_info *args_info) | 
| 100 | + | { | 
| 101 | + | args_info->help_help = gengetopt_args_info_help[0] ; | 
| 102 | + | args_info->version_help = gengetopt_args_info_help[1] ; | 
| 103 | + | args_info->input_help = gengetopt_args_info_help[2] ; | 
| 104 | + | args_info->output_help = gengetopt_args_info_help[3] ; | 
| 105 | + | args_info->sele1_help = gengetopt_args_info_help[4] ; | 
| 106 | + | args_info->sele2_help = gengetopt_args_info_help[5] ; | 
| 107 | + | args_info->order_help = gengetopt_args_info_help[6] ; | 
| 108 | + | args_info->rcorr_help = gengetopt_args_info_help[7] ; | 
| 109 | + | args_info->vcorr_help = gengetopt_args_info_help[8] ; | 
| 110 | + | args_info->dcorr_help = gengetopt_args_info_help[9] ; | 
| 111 | + | args_info->lcorr_help = gengetopt_args_info_help[10] ; | 
| 112 | + | args_info->r_rcorr_help = gengetopt_args_info_help[11] ; | 
| 113 | + | args_info->thetacorr_help = gengetopt_args_info_help[12] ; | 
| 114 | + | args_info->drcorr_help = gengetopt_args_info_help[13] ; | 
| 115 | + |  | 
| 116 | + | } | 
| 117 | + |  | 
| 118 |  | void | 
| 119 |  | cmdline_parser_print_version (void) | 
| 120 |  | { | 
| 124 |  | void | 
| 125 |  | cmdline_parser_print_help (void) | 
| 126 |  | { | 
| 127 | + | int i = 0; | 
| 128 |  | cmdline_parser_print_version (); | 
| 129 | < | printf("\nUsage: DynamicProps [OPTIONS]...\n\n"); | 
| 130 | < | printf("%s\n","  -h, --help                    Print help and exit"); | 
| 131 | < | printf("%s\n","  -V, --version                 Print version and exit"); | 
| 132 | < | printf("%s\n","  -i, --input=filename          input dump file"); | 
| 133 | < | printf("%s\n","  -o, --output=filename         output file name"); | 
| 134 | < | printf("%s\n","      --sele1=selection script  select first stuntdouble set"); | 
| 135 | < | printf("%s\n","      --sele2=selection script  select second stuntdouble set (if sele2 is not \n                                  set, use script from sele1)"); | 
| 136 | < | printf("%s\n","      --order=INT               Lengendre Polynomial Order"); | 
| 137 | < | printf("%s\n","\n Group: dynamicProps\n   an option of this group is required"); | 
| 138 | < | printf("%s\n","  -r, --rcorr                   rmsd"); | 
| 139 | < | printf("%s\n","  -v, --vcorr                   velocity correlation function"); | 
| 92 | < | printf("%s\n","  -d, --dcorr                   dipole correlation function"); | 
| 93 | < | printf("%s\n","  -l, --lcorr                   Lengendre correlation function"); | 
| 94 | < | printf("%s\n","      --r_rcorr                 Radial rmsd"); | 
| 95 | < |  | 
| 129 | > |  | 
| 130 | > | if (strlen(gengetopt_args_info_purpose) > 0) | 
| 131 | > | printf("\n%s\n", gengetopt_args_info_purpose); | 
| 132 | > |  | 
| 133 | > | printf("\n%s\n\n", gengetopt_args_info_usage); | 
| 134 | > |  | 
| 135 | > | if (strlen(gengetopt_args_info_description) > 0) | 
| 136 | > | printf("%s\n", gengetopt_args_info_description); | 
| 137 | > |  | 
| 138 | > | while (gengetopt_args_info_help[i]) | 
| 139 | > | printf("%s\n", gengetopt_args_info_help[i++]); | 
| 140 |  | } | 
| 141 |  |  | 
| 142 |  | void | 
| 144 |  | { | 
| 145 |  | clear_given (args_info); | 
| 146 |  | clear_args (args_info); | 
| 147 | + | init_args_info (args_info); | 
| 148 |  | } | 
| 149 |  |  | 
| 150 |  | static void | 
| 269 |  | } | 
| 270 |  | if (args_info->r_rcorr_given) { | 
| 271 |  | fprintf(outfile, "%s\n", "r_rcorr"); | 
| 272 | + | } | 
| 273 | + | if (args_info->thetacorr_given) { | 
| 274 | + | fprintf(outfile, "%s\n", "thetacorr"); | 
| 275 |  | } | 
| 276 | + | if (args_info->drcorr_given) { | 
| 277 | + | fprintf(outfile, "%s\n", "drcorr"); | 
| 278 | + | } | 
| 279 |  |  | 
| 280 |  | fclose (outfile); | 
| 281 |  |  | 
| 320 |  | args_info->dcorr_given = 0 ; | 
| 321 |  | args_info->lcorr_given = 0 ; | 
| 322 |  | args_info->r_rcorr_given = 0 ; | 
| 323 | + | args_info->thetacorr_given = 0 ; | 
| 324 | + | args_info->drcorr_given = 0 ; | 
| 325 |  |  | 
| 326 |  | args_info->dynamicProps_group_counter = 0; | 
| 327 |  | } | 
| 370 |  | { | 
| 371 |  | int error = 0; | 
| 372 |  |  | 
| 373 | + | /* checks for required options */ | 
| 374 |  | if (! args_info->input_given) | 
| 375 |  | { | 
| 376 |  | fprintf (stderr, "%s: '--input' ('-i') option required%s\n", prog_name, (additional_error ? additional_error : "")); | 
| 377 |  | error = 1; | 
| 378 |  | } | 
| 379 | + |  | 
| 380 |  | if (args_info->dynamicProps_group_counter == 0) | 
| 381 |  | { | 
| 382 |  | fprintf (stderr, "%s: %d options of group dynamicProps were given. One is required.%s\n", prog_name, args_info->dynamicProps_group_counter, (additional_error ? additional_error : "")); | 
| 384 |  | } | 
| 385 |  |  | 
| 386 |  |  | 
| 387 | + | /* checks for dependences among options */ | 
| 388 | + |  | 
| 389 |  | return error; | 
| 390 |  | } | 
| 391 |  |  | 
| 403 |  | cmdline_parser_init (&local_args_info); | 
| 404 |  |  | 
| 405 |  | optarg = 0; | 
| 406 | < | optind = 1; | 
| 406 | > | optind = 0; | 
| 407 |  | opterr = 1; | 
| 408 |  | optopt = '?'; | 
| 409 |  |  | 
| 425 |  | { "dcorr",      0, NULL, 'd' }, | 
| 426 |  | { "lcorr",      0, NULL, 'l' }, | 
| 427 |  | { "r_rcorr",    0, NULL, 0 }, | 
| 428 | + | { "thetacorr",  0, NULL, 0 }, | 
| 429 | + | { "drcorr",     0, NULL, 0 }, | 
| 430 |  | { NULL, 0, NULL, 0 } | 
| 431 |  | }; | 
| 432 |  |  | 
| 616 |  | continue; | 
| 617 |  | local_args_info.r_rcorr_given = 1; | 
| 618 |  | args_info->r_rcorr_given = 1; | 
| 619 | + | if (args_info->dynamicProps_group_counter && override) | 
| 620 | + | reset_group_dynamicProps (args_info); | 
| 621 | + | args_info->dynamicProps_group_counter += 1; | 
| 622 | + | break; | 
| 623 | + | } | 
| 624 | + | /* Angular rmsd.  */ | 
| 625 | + | else if (strcmp (long_options[option_index].name, "thetacorr") == 0) | 
| 626 | + | { | 
| 627 | + | if (local_args_info.thetacorr_given) | 
| 628 | + | { | 
| 629 | + | fprintf (stderr, "%s: `--thetacorr' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 630 | + | goto failure; | 
| 631 | + | } | 
| 632 | + | if (args_info->thetacorr_given && ! override) | 
| 633 | + | continue; | 
| 634 | + | local_args_info.thetacorr_given = 1; | 
| 635 | + | args_info->thetacorr_given = 1; | 
| 636 |  | if (args_info->dynamicProps_group_counter && override) | 
| 637 |  | reset_group_dynamicProps (args_info); | 
| 638 |  | args_info->dynamicProps_group_counter += 1; | 
| 639 |  | break; | 
| 640 |  | } | 
| 641 | + | /* Directional rmsd for particles with unit vectors.  */ | 
| 642 | + | else if (strcmp (long_options[option_index].name, "drcorr") == 0) | 
| 643 | + | { | 
| 644 | + | if (local_args_info.drcorr_given) | 
| 645 | + | { | 
| 646 | + | fprintf (stderr, "%s: `--drcorr' option given more than once%s\n", argv[0], (additional_error ? additional_error : "")); | 
| 647 | + | goto failure; | 
| 648 | + | } | 
| 649 | + | if (args_info->drcorr_given && ! override) | 
| 650 | + | continue; | 
| 651 | + | local_args_info.drcorr_given = 1; | 
| 652 | + | args_info->drcorr_given = 1; | 
| 653 | + | if (args_info->dynamicProps_group_counter && override) | 
| 654 | + | reset_group_dynamicProps (args_info); | 
| 655 | + | args_info->dynamicProps_group_counter += 1; | 
| 656 | + | break; | 
| 657 | + | } | 
| 658 |  |  | 
| 659 |  | break; | 
| 660 |  | case '?':       /* Invalid option.  */ |