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.3 -- select stuntdouble which internal index is 3\n" |
58 |
> |
" select DMPC.DMPC_RB_*.* --select atoms belong to rigid body inside DMPC molecule \n"); |
59 |
> |
printf(" --originsele=selection script select origin\n"); |
60 |
> |
printf(" --refsele=selection script select reference\n"); |
61 |
> |
printf(" --repeatX=INT The number of images to repeat in the x \n direction (default=`0')\n"); |
62 |
> |
printf(" --repeatY=INT The number of images to repeat in the y \n direction (default=`0')\n"); |
63 |
> |
printf(" --repeatZ=INT The number of images to repeat in the z \n direction (default=`0')\n"); |
64 |
|
} |
65 |
|
|
66 |
|
|
104 |
|
args_info->rigidbody_given = 0 ; |
105 |
|
args_info->watertype_given = 0 ; |
106 |
|
args_info->ignore_given = 0 ; |
107 |
+ |
args_info->selection_given = 0 ; |
108 |
+ |
args_info->originsele_given = 0 ; |
109 |
+ |
args_info->refsele_given = 0 ; |
110 |
|
args_info->repeatX_given = 0 ; |
111 |
|
args_info->repeatY_given = 0 ; |
112 |
|
args_info->repeatZ_given = 0 ; |
121 |
|
args_info->rigidbody_flag = 0;\ |
122 |
|
args_info->watertype_flag = 1;\ |
123 |
|
args_info->ignore_arg = NULL; \ |
124 |
+ |
args_info->selection_arg = NULL; \ |
125 |
+ |
args_info->originsele_arg = NULL; \ |
126 |
+ |
args_info->refsele_arg = NULL; \ |
127 |
|
args_info->repeatX_arg = 0 ;\ |
128 |
|
args_info->repeatY_arg = 0 ;\ |
129 |
|
args_info->repeatZ_arg = 0 ;\ |
153 |
|
{ "zconstraint", 0, NULL, 'z' }, |
154 |
|
{ "rigidbody", 0, NULL, 'r' }, |
155 |
|
{ "watertype", 0, NULL, 't' }, |
156 |
< |
{ "ignore", 1, NULL, 's' }, |
156 |
> |
{ "ignore", 1, NULL, 'g' }, |
157 |
> |
{ "selection", 1, NULL, 's' }, |
158 |
> |
{ "originsele", 1, NULL, 0 }, |
159 |
> |
{ "refsele", 1, NULL, 0 }, |
160 |
|
{ "repeatX", 1, NULL, 0 }, |
161 |
|
{ "repeatY", 1, NULL, 0 }, |
162 |
|
{ "repeatZ", 1, NULL, 0 }, |
164 |
|
}; |
165 |
|
|
166 |
|
stop_char = 0; |
167 |
< |
c = getopt_long (argc, argv, "hVi:o:n:dwmzrts:", long_options, &option_index); |
167 |
> |
c = getopt_long (argc, argv, "hVi:o:n:dwmzrtg:s:", long_options, &option_index); |
168 |
|
|
169 |
|
if (c == -1) break; /* Exit from `while (1)' loop. */ |
170 |
|
|
279 |
|
args_info->watertype_flag = !(args_info->watertype_flag); |
280 |
|
break; |
281 |
|
|
282 |
< |
case 's': /* ignore the atom types. */ |
282 |
> |
case 'g': /* ignore the atom types. */ |
283 |
|
args_info->ignore_given++; |
284 |
|
ignore_new = (struct ignore_list *) malloc (sizeof (struct ignore_list)); |
285 |
|
ignore_new->next = ignore_list; |
287 |
|
ignore_new->ignore_arg = gengetopt_strdup (optarg); |
288 |
|
break; |
289 |
|
|
290 |
+ |
case 's': /* general selection syntax(now only support select atoms within a specified range). */ |
291 |
+ |
if (args_info->selection_given) |
292 |
+ |
{ |
293 |
+ |
fprintf (stderr, "%s: `--selection' (`-s') option given more than once\n", CMDLINE_PARSER_PACKAGE); |
294 |
+ |
clear_args (); |
295 |
+ |
exit (EXIT_FAILURE); |
296 |
+ |
} |
297 |
+ |
args_info->selection_given = 1; |
298 |
+ |
args_info->selection_arg = gengetopt_strdup (optarg); |
299 |
+ |
break; |
300 |
|
|
301 |
+ |
|
302 |
|
case 0: /* Long option with no short option */ |
303 |
+ |
/* select origin. */ |
304 |
+ |
if (strcmp (long_options[option_index].name, "originsele") == 0) |
305 |
+ |
{ |
306 |
+ |
if (args_info->originsele_given) |
307 |
+ |
{ |
308 |
+ |
fprintf (stderr, "%s: `--originsele' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
309 |
+ |
clear_args (); |
310 |
+ |
exit (EXIT_FAILURE); |
311 |
+ |
} |
312 |
+ |
args_info->originsele_given = 1; |
313 |
+ |
args_info->originsele_arg = gengetopt_strdup (optarg); |
314 |
+ |
break; |
315 |
+ |
} |
316 |
+ |
|
317 |
+ |
/* select reference. */ |
318 |
+ |
else if (strcmp (long_options[option_index].name, "refsele") == 0) |
319 |
+ |
{ |
320 |
+ |
if (args_info->refsele_given) |
321 |
+ |
{ |
322 |
+ |
fprintf (stderr, "%s: `--refsele' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
323 |
+ |
clear_args (); |
324 |
+ |
exit (EXIT_FAILURE); |
325 |
+ |
} |
326 |
+ |
args_info->refsele_given = 1; |
327 |
+ |
args_info->refsele_arg = gengetopt_strdup (optarg); |
328 |
+ |
break; |
329 |
+ |
} |
330 |
+ |
|
331 |
|
/* The number of images to repeat in the x direction. */ |
332 |
< |
if (strcmp (long_options[option_index].name, "repeatX") == 0) |
332 |
> |
else if (strcmp (long_options[option_index].name, "repeatX") == 0) |
333 |
|
{ |
334 |
|
if (args_info->repeatX_given) |
335 |
|
{ |