| 1 |
|
/* |
| 2 |
|
File autogenerated by gengetopt version 2.11 |
| 3 |
|
generated with the following command: |
| 4 |
< |
/home/maul/gezelter/tim/program/gengetopt-2.11/src/gengetopt --file-name=Dump2XYZCmd |
| 4 |
> |
/home/maul/gezelter/tim/bin/gengetopt -F Dump2XYZCmd |
| 5 |
|
|
| 6 |
|
The developers of gengetopt consider the fixed text that goes in all |
| 7 |
|
gengetopt output files to be in the public domain: |
| 18 |
|
#include "config.h" |
| 19 |
|
#endif |
| 20 |
|
|
| 21 |
– |
|
| 21 |
|
#include "getopt.h" |
| 22 |
|
|
| 23 |
< |
#include "applications/dump2Xyz/Dump2XYZCmd.h" |
| 23 |
> |
#include "Dump2XYZCmd.h" |
| 24 |
|
|
| 25 |
|
void |
| 26 |
|
cmdline_parser_print_version (void) |
| 35 |
|
printf("\n" |
| 36 |
|
"Usage: %s [OPTIONS]...\n", CMDLINE_PARSER_PACKAGE); |
| 37 |
|
printf("\n"); |
| 38 |
< |
printf(" -h, --help Print help and exit\n"); |
| 39 |
< |
printf(" -V, --version Print version and exit\n"); |
| 40 |
< |
printf(" -i, --input=filename input dump file\n"); |
| 41 |
< |
printf(" -o, --output=filename output file name\n"); |
| 42 |
< |
printf(" -n, --frame=INT print every n frame (default=`1')\n"); |
| 43 |
< |
printf(" -d, --dipole print the dipole moments (default=off)\n"); |
| 44 |
< |
printf(" -w, --water skip the the waters (default=off)\n"); |
| 45 |
< |
printf(" -m, --periodicBox map to the periodic box (default=off)\n"); |
| 46 |
< |
printf(" -z, --zconstraint replace the atom types of zconstraint molecules \n (default=off)\n"); |
| 47 |
< |
printf(" -r, --rigidbody add a pseudo COM atom to rigidbody (default=off)\n"); |
| 48 |
< |
printf(" -t, --watertype replace the atom type of water model (default=on)\n"); |
| 49 |
< |
printf(" -s, --ignore=atomtype ignore the atom types\n"); |
| 50 |
< |
printf(" --repeatX=INT The number of images to repeat in the x direction \n (default=`0')\n"); |
| 51 |
< |
printf(" --repeatY=INT The number of images to repeat in the y direction \n (default=`0')\n"); |
| 52 |
< |
printf(" --repeatZ=INT The number of images to repeat in the z direction \n (default=`0')\n"); |
| 38 |
> |
printf(" -h, --help Print help and exit\n"); |
| 39 |
> |
printf(" -V, --version Print version and exit\n"); |
| 40 |
> |
printf(" -i, --input=filename input dump file\n"); |
| 41 |
> |
printf(" -o, --output=filename output file name\n"); |
| 42 |
> |
printf(" -n, --frame=INT print every n frame (default=`1')\n"); |
| 43 |
> |
printf(" -d, --dipole print the dipole moments (default=off)\n"); |
| 44 |
> |
printf(" -w, --water skip the the waters (default=off)\n"); |
| 45 |
> |
printf(" -m, --periodicBox map to the periodic box (default=off)\n"); |
| 46 |
> |
printf(" -z, --zconstraint replace the atom types of zconstraint \n molecules (default=off)\n"); |
| 47 |
> |
printf(" -r, --rigidbody add a pseudo COM atom to rigidbody \n (default=off)\n"); |
| 48 |
> |
printf(" -t, --watertype replace the atom type of water model \n (default=on)\n"); |
| 49 |
> |
printf(" -g, --ignore=atomtype ignore the atom types\n"); |
| 50 |
> |
printf(" -s, --selection=selection script selection syntax:\n" |
| 51 |
> |
" select DMPC -- select DMPC molecule\n" |
| 52 |
> |
" select DMPC.* -- select all atoms and all rigidbodies belong to DMPC molecule(same as above)\n" |
| 53 |
> |
" select not DMPC -- select all atoms and all rigidbodies do not belong to DMPC molecule\n" |
| 54 |
> |
" select C* and 4 to 7 -- select stuntdoubles which match C* and which index is between [4, 7)\n" |
| 55 |
> |
" select 5 -- select stuntdobule whose global index is 5\n" |
| 56 |
> |
" select within (5.0, HDP or PO4) -- select stuntdoubles which is within 5 A to HDP or PO4\n" |
| 57 |
> |
" select DMPC.DMPC_RB_*.* --select atoms belong to rigid body inside DMPC molecule \n"); |
| 58 |
> |
printf(" --repeatX=INT The number of images to repeat in the x \n direction (default=`0')\n"); |
| 59 |
> |
printf(" --repeatY=INT The number of images to repeat in the y \n direction (default=`0')\n"); |
| 60 |
> |
printf(" --repeatZ=INT The number of images to repeat in the z \n direction (default=`0')\n"); |
| 61 |
|
} |
| 62 |
|
|
| 63 |
|
|
| 101 |
|
args_info->rigidbody_given = 0 ; |
| 102 |
|
args_info->watertype_given = 0 ; |
| 103 |
|
args_info->ignore_given = 0 ; |
| 104 |
+ |
args_info->selection_given = 0 ; |
| 105 |
|
args_info->repeatX_given = 0 ; |
| 106 |
|
args_info->repeatY_given = 0 ; |
| 107 |
|
args_info->repeatZ_given = 0 ; |
| 116 |
|
args_info->rigidbody_flag = 0;\ |
| 117 |
|
args_info->watertype_flag = 1;\ |
| 118 |
|
args_info->ignore_arg = NULL; \ |
| 119 |
+ |
args_info->selection_arg = NULL; \ |
| 120 |
|
args_info->repeatX_arg = 0 ;\ |
| 121 |
|
args_info->repeatY_arg = 0 ;\ |
| 122 |
|
args_info->repeatZ_arg = 0 ;\ |
| 146 |
|
{ "zconstraint", 0, NULL, 'z' }, |
| 147 |
|
{ "rigidbody", 0, NULL, 'r' }, |
| 148 |
|
{ "watertype", 0, NULL, 't' }, |
| 149 |
< |
{ "ignore", 1, NULL, 's' }, |
| 149 |
> |
{ "ignore", 1, NULL, 'g' }, |
| 150 |
> |
{ "selection", 1, NULL, 's' }, |
| 151 |
|
{ "repeatX", 1, NULL, 0 }, |
| 152 |
|
{ "repeatY", 1, NULL, 0 }, |
| 153 |
|
{ "repeatZ", 1, NULL, 0 }, |
| 155 |
|
}; |
| 156 |
|
|
| 157 |
|
stop_char = 0; |
| 158 |
< |
c = getopt_long (argc, argv, "hVi:o:n:dwmzrts:", long_options, &option_index); |
| 158 |
> |
c = getopt_long (argc, argv, "hVi:o:n:dwmzrtg:s:", long_options, &option_index); |
| 159 |
|
|
| 160 |
|
if (c == -1) break; /* Exit from `while (1)' loop. */ |
| 161 |
|
|
| 270 |
|
args_info->watertype_flag = !(args_info->watertype_flag); |
| 271 |
|
break; |
| 272 |
|
|
| 273 |
< |
case 's': /* ignore the atom types. */ |
| 273 |
> |
case 'g': /* ignore the atom types. */ |
| 274 |
|
args_info->ignore_given++; |
| 275 |
|
ignore_new = (struct ignore_list *) malloc (sizeof (struct ignore_list)); |
| 276 |
|
ignore_new->next = ignore_list; |
| 278 |
|
ignore_new->ignore_arg = gengetopt_strdup (optarg); |
| 279 |
|
break; |
| 280 |
|
|
| 281 |
+ |
case 's': /* general selection syntax:\n |
| 282 |
+ |
select DMPC -- select DMPC molecule\n \ |
| 283 |
+ |
select DMPC.* -- select all atoms and all rigidbodies belong to DMPC molecule\n \ |
| 284 |
+ |
select 5 -- select stuntdobule whose global index is 5\n \ |
| 285 |
+ |
select within (5.0, HDP or PO4) -- select stuntdoubles which is within 5 A to HDP or PO4\n \ |
| 286 |
+ |
select DMPC.DMPC_RB_*.* --select atoms belong to rigid body inside DMPC molecule . */ |
| 287 |
+ |
if (args_info->selection_given) |
| 288 |
+ |
{ |
| 289 |
+ |
fprintf (stderr, "%s: `--selection' (`-s') option given more than once\n", CMDLINE_PARSER_PACKAGE); |
| 290 |
+ |
clear_args (); |
| 291 |
+ |
exit (EXIT_FAILURE); |
| 292 |
+ |
} |
| 293 |
+ |
args_info->selection_given = 1; |
| 294 |
+ |
args_info->selection_arg = gengetopt_strdup (optarg); |
| 295 |
+ |
break; |
| 296 |
|
|
| 297 |
+ |
|
| 298 |
|
case 0: /* Long option with no short option */ |
| 299 |
|
/* The number of images to repeat in the x direction. */ |
| 300 |
|
if (strcmp (long_options[option_index].name, "repeatX") == 0) |