# | Line 43 | Line 43 | cmdline_parser_print_help (void) | |
---|---|---|
43 | printf(" -r, --nrbins=INT number of bins for distance (default=`100')\n"); | |
44 | printf(" -a, --nanglebins=INT number of bins for cos(angle) (default=\n `50')\n"); | |
45 | printf(" -l, --length=DOUBLE maximum length (Defaults to 1/2 smallest \n length of first frame)\n"); | |
46 | < | printf(" --sele1=selection script select first stuntdouble set\n"); |
47 | < | printf(" --sele2=selection script select second stuntdouble set\n"); |
46 | > | printf(" --sele1=selection script select the first stuntdouble set\n"); |
47 | > | printf(" --sele2=selection script select the second stuntdouble set\n"); |
48 | > | printf(" --sele3=selection script select the third stuntdouble set\n"); |
49 | printf(" --refsele=selection script select reference (use and only use with \n --gxyz)\n"); | |
50 | + | printf(" --molname=STRING molecule name\n"); |
51 | + | printf(" --begin=INT begin interanl index\n"); |
52 | + | printf(" --end=INT end internal index\n"); |
53 | printf("\n"); | |
54 | printf(" Group: staticProps an option of this group is required\n"); | |
55 | printf(" --gofr g(r)\n"); | |
# | Line 53 | Line 57 | cmdline_parser_print_help (void) | |
57 | printf(" --r_omega g(r, cos(omega))\n"); | |
58 | printf(" --theta_omega g(cos(theta), cos(omega))\n"); | |
59 | printf(" --gxyz g(x, y, z)\n"); | |
60 | < | printf(" --p2 p2 order parameter\n"); |
60 | > | printf(" --p2 p2 order parameter (--sele1 and --sele2 must \n be specified)\n"); |
61 | > | printf(" --scd scd order parameter(either --sele1, --sele2, \n --sele3 are specified or --molname, \n --begin, --end are specified)\n"); |
62 | > | printf(" --density density plot (--sele1 must be specified)\n"); |
63 | } | |
64 | ||
65 | ||
# | Line 89 | Line 95 | cmdline_parser (int argc, char * const *argv, struct g | |
95 | args_info->length_given = 0 ; | |
96 | args_info->sele1_given = 0 ; | |
97 | args_info->sele2_given = 0 ; | |
98 | + | args_info->sele3_given = 0 ; |
99 | args_info->refsele_given = 0 ; | |
100 | + | args_info->molname_given = 0 ; |
101 | + | args_info->begin_given = 0 ; |
102 | + | args_info->end_given = 0 ; |
103 | args_info->gofr_given = 0 ; | |
104 | args_info->r_theta_given = 0 ; | |
105 | args_info->r_omega_given = 0 ; | |
106 | args_info->theta_omega_given = 0 ; | |
107 | args_info->gxyz_given = 0 ; | |
108 | args_info->p2_given = 0 ; | |
109 | + | args_info->scd_given = 0 ; |
110 | + | args_info->density_given = 0 ; |
111 | #define clear_args() { \ | |
112 | args_info->input_arg = NULL; \ | |
113 | args_info->output_arg = NULL; \ | |
# | Line 104 | Line 116 | cmdline_parser (int argc, char * const *argv, struct g | |
116 | args_info->nanglebins_arg = 50 ;\ | |
117 | args_info->sele1_arg = NULL; \ | |
118 | args_info->sele2_arg = NULL; \ | |
119 | + | args_info->sele3_arg = NULL; \ |
120 | args_info->refsele_arg = NULL; \ | |
121 | + | args_info->molname_arg = NULL; \ |
122 | } | |
123 | ||
124 | clear_args(); | |
# | Line 130 | Line 144 | cmdline_parser (int argc, char * const *argv, struct g | |
144 | { "length", 1, NULL, 'l' }, | |
145 | { "sele1", 1, NULL, 0 }, | |
146 | { "sele2", 1, NULL, 0 }, | |
147 | + | { "sele3", 1, NULL, 0 }, |
148 | { "refsele", 1, NULL, 0 }, | |
149 | + | { "molname", 1, NULL, 0 }, |
150 | + | { "begin", 1, NULL, 0 }, |
151 | + | { "end", 1, NULL, 0 }, |
152 | { "gofr", 0, NULL, 0 }, | |
153 | { "r_theta", 0, NULL, 0 }, | |
154 | { "r_omega", 0, NULL, 0 }, | |
155 | { "theta_omega", 0, NULL, 0 }, | |
156 | { "gxyz", 0, NULL, 0 }, | |
157 | { "p2", 0, NULL, 0 }, | |
158 | + | { "scd", 0, NULL, 0 }, |
159 | + | { "density", 0, NULL, 0 }, |
160 | { NULL, 0, NULL, 0 } | |
161 | }; | |
162 | ||
# | Line 225 | Line 245 | cmdline_parser (int argc, char * const *argv, struct g | |
245 | ||
246 | ||
247 | case 0: /* Long option with no short option */ | |
248 | < | /* select first stuntdouble set. */ |
248 | > | /* select the first stuntdouble set. */ |
249 | if (strcmp (long_options[option_index].name, "sele1") == 0) | |
250 | { | |
251 | if (args_info->sele1_given) | |
# | Line 239 | Line 259 | cmdline_parser (int argc, char * const *argv, struct g | |
259 | break; | |
260 | } | |
261 | ||
262 | < | /* select second stuntdouble set. */ |
262 | > | /* select the second stuntdouble set. */ |
263 | else if (strcmp (long_options[option_index].name, "sele2") == 0) | |
264 | { | |
265 | if (args_info->sele2_given) | |
# | Line 253 | Line 273 | cmdline_parser (int argc, char * const *argv, struct g | |
273 | break; | |
274 | } | |
275 | ||
276 | + | /* select the third stuntdouble set. */ |
277 | + | else if (strcmp (long_options[option_index].name, "sele3") == 0) |
278 | + | { |
279 | + | if (args_info->sele3_given) |
280 | + | { |
281 | + | fprintf (stderr, "%s: `--sele3' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
282 | + | clear_args (); |
283 | + | exit (EXIT_FAILURE); |
284 | + | } |
285 | + | args_info->sele3_given = 1; |
286 | + | args_info->sele3_arg = gengetopt_strdup (optarg); |
287 | + | break; |
288 | + | } |
289 | + | |
290 | /* select reference (use and only use with --gxyz). */ | |
291 | else if (strcmp (long_options[option_index].name, "refsele") == 0) | |
292 | { | |
# | Line 264 | Line 298 | cmdline_parser (int argc, char * const *argv, struct g | |
298 | } | |
299 | args_info->refsele_given = 1; | |
300 | args_info->refsele_arg = gengetopt_strdup (optarg); | |
301 | + | break; |
302 | + | } |
303 | + | |
304 | + | /* molecule name. */ |
305 | + | else if (strcmp (long_options[option_index].name, "molname") == 0) |
306 | + | { |
307 | + | if (args_info->molname_given) |
308 | + | { |
309 | + | fprintf (stderr, "%s: `--molname' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
310 | + | clear_args (); |
311 | + | exit (EXIT_FAILURE); |
312 | + | } |
313 | + | args_info->molname_given = 1; |
314 | + | args_info->molname_arg = gengetopt_strdup (optarg); |
315 | + | break; |
316 | + | } |
317 | + | |
318 | + | /* begin interanl index. */ |
319 | + | else if (strcmp (long_options[option_index].name, "begin") == 0) |
320 | + | { |
321 | + | if (args_info->begin_given) |
322 | + | { |
323 | + | fprintf (stderr, "%s: `--begin' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
324 | + | clear_args (); |
325 | + | exit (EXIT_FAILURE); |
326 | + | } |
327 | + | args_info->begin_given = 1; |
328 | + | args_info->begin_arg = strtol (optarg,&stop_char,0); |
329 | break; | |
330 | } | |
331 | ||
332 | + | /* end internal index. */ |
333 | + | else if (strcmp (long_options[option_index].name, "end") == 0) |
334 | + | { |
335 | + | if (args_info->end_given) |
336 | + | { |
337 | + | fprintf (stderr, "%s: `--end' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
338 | + | clear_args (); |
339 | + | exit (EXIT_FAILURE); |
340 | + | } |
341 | + | args_info->end_given = 1; |
342 | + | args_info->end_arg = strtol (optarg,&stop_char,0); |
343 | + | break; |
344 | + | } |
345 | + | |
346 | /* g(r). */ | |
347 | else if (strcmp (long_options[option_index].name, "gofr") == 0) | |
348 | { | |
# | Line 337 | Line 413 | cmdline_parser (int argc, char * const *argv, struct g | |
413 | break; | |
414 | } | |
415 | ||
416 | < | /* p2 order parameter. */ |
416 | > | /* p2 order parameter (--sele1 and --sele2 must be specified). */ |
417 | else if (strcmp (long_options[option_index].name, "p2") == 0) | |
418 | { | |
419 | if (args_info->p2_given) | |
# | Line 351 | Line 427 | cmdline_parser (int argc, char * const *argv, struct g | |
427 | break; | |
428 | } | |
429 | ||
430 | + | /* scd order parameter(either --sele1, --sele2, --sele3 are specified or --molname, --begin, --end are specified). */ |
431 | + | else if (strcmp (long_options[option_index].name, "scd") == 0) |
432 | + | { |
433 | + | if (args_info->scd_given) |
434 | + | { |
435 | + | fprintf (stderr, "%s: `--scd' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
436 | + | clear_args (); |
437 | + | exit (EXIT_FAILURE); |
438 | + | } |
439 | + | args_info->scd_given = 1; staticProps_group_counter += 1; |
440 | + | |
441 | + | break; |
442 | + | } |
443 | + | |
444 | + | /* density plot (--sele1 must be specified). */ |
445 | + | else if (strcmp (long_options[option_index].name, "density") == 0) |
446 | + | { |
447 | + | if (args_info->density_given) |
448 | + | { |
449 | + | fprintf (stderr, "%s: `--density' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
450 | + | clear_args (); |
451 | + | exit (EXIT_FAILURE); |
452 | + | } |
453 | + | args_info->density_given = 1; staticProps_group_counter += 1; |
454 | + | |
455 | + | break; |
456 | + | } |
457 | + | |
458 | ||
459 | case '?': /* Invalid option. */ | |
460 | /* `getopt_long' already printed an error message. */ |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |