21#define FIX_UNUSED(X) (void) (X)
27const char *gengetopt_args_info_purpose =
"Computes a time history of static properties from a dump file.";
29const char *gengetopt_args_info_usage =
"Usage: SequentialProps [OPTION]... [FILE]...";
31const char *gengetopt_args_info_versiontext =
"";
33const char *gengetopt_args_info_description =
"";
35const char *gengetopt_args_info_help[] = {
36 " -h, --help Print help and exit",
37 " -V, --version Print version and exit",
38 " -i, --input=filename input dump file (mandatory)",
39 " -o, --output=filename output file name",
40 " --sele1=selection script select first stuntdouble set",
41 " --sele2=selection script select second stuntdouble set (if sele2 is not\n set, use script from sele1)",
42 " -b, --nbins=INT number of bins (general purpose)\n (default=`100')",
43 " --nbins_z=INT number of bins in z axis (default=`100')",
44 " --privilegedAxis=ENUM which axis is special for spatial analysis\n (default = z axis) (possible values=\"x\",\n \"y\", \"z\" default=`z')",
45 " -x, --centroidX=DOUBLE Location of droplet centroid in x",
46 " -y, --centroidY=DOUBLE Location of droplet centroid in y",
47 " -z, --referenceZ=DOUBLE Reference z-height of solid surface",
48 " -r, --dropletR=DOUBLE Droplet radius in angstroms",
49 " --threshDens=DOUBLE Threshold Density in g/cm^3",
50 " --bufferLength=DOUBLE Buffer length in angstroms",
51 " --rcut=DOUBLE cutoff radius (rcut)",
52 " --voxelSize=DOUBLE voxel size for coarse graining (Angstroms)\n (default=`2.0')",
53 " --gaussWidth=DOUBLE Gaussian width for coarse graining (Angstroms)\n (default=`3.0')",
54 "\n Group: sequentialProps\n an option of this group is required",
55 " -c, --com selection center of mass",
56 " -v, --comvel selection center of mass velocity",
57 " --deltaCount difference in counts between two selections",
58 " --fluxOut number flux out of a selection",
59 " --ca1 contact angle of selection (using center of\n mass)",
60 " --ca2 contact angle of selection (using density\n profile)",
61 " --gcn Generalized Coordinate Number",
62 " -t, --testequi Temperature using all componets of linear and\n angular momentum",
63 " --qsurf tetrahedrality Q field as OpenDX volumetric\n files",
72} cmdline_parser_arg_type;
84cmdline_parser_required2 (
struct gengetopt_args_info *args_info,
const char *prog_name,
const char *additional_error);
86const char *cmdline_parser_privilegedAxis_values[] = {
"x",
"y",
"z", 0};
89gengetopt_strdup (
const char *s);
127 FIX_UNUSED (args_info);
161 args_info->
help_help = gengetopt_args_info_help[0] ;
163 args_info->
input_help = gengetopt_args_info_help[2] ;
164 args_info->
output_help = gengetopt_args_info_help[3] ;
165 args_info->
sele1_help = gengetopt_args_info_help[4] ;
166 args_info->
sele2_help = gengetopt_args_info_help[5] ;
167 args_info->
nbins_help = gengetopt_args_info_help[6] ;
176 args_info->
rcut_help = gengetopt_args_info_help[15] ;
179 args_info->
com_help = gengetopt_args_info_help[19] ;
180 args_info->
comvel_help = gengetopt_args_info_help[20] ;
182 args_info->
fluxOut_help = gengetopt_args_info_help[22] ;
183 args_info->
ca1_help = gengetopt_args_info_help[23] ;
184 args_info->
ca2_help = gengetopt_args_info_help[24] ;
185 args_info->
gcn_help = gengetopt_args_info_help[25] ;
187 args_info->
qsurf_help = gengetopt_args_info_help[27] ;
198 if (strlen(gengetopt_args_info_versiontext) > 0)
199 printf(
"\n%s\n", gengetopt_args_info_versiontext);
202static void print_help_common(
void)
204 size_t len_purpose = strlen(gengetopt_args_info_purpose);
205 size_t len_usage = strlen(gengetopt_args_info_usage);
208 printf(
"%s\n", gengetopt_args_info_usage);
210 if (len_purpose > 0) {
211 printf(
"%s\n", gengetopt_args_info_purpose);
214 if (len_usage || len_purpose) {
218 if (strlen(gengetopt_args_info_description) > 0) {
219 printf(
"%s\n\n", gengetopt_args_info_description);
228 while (gengetopt_args_info_help[i])
229 printf(
"%s\n", gengetopt_args_info_help[i++]);
235 clear_given (args_info);
236 clear_args (args_info);
237 init_args_info (args_info);
266free_string_field (
char **s)
280 free_string_field (&(args_info->
input_arg));
284 free_string_field (&(args_info->
sele1_arg));
286 free_string_field (&(args_info->
sele2_arg));
297 free_string_field (&(args_info->
rcut_orig));
303 free (args_info->
inputs [i]);
308 clear_given (args_info);
319check_possible_values(
const char *val,
const char *values[])
329 for (i = 0, len = strlen(val); values[i]; ++i)
331 if (strncmp(val, values[i], len) == 0)
335 if (strlen(values[i]) == len)
343 return (found ? -2 : -1);
348write_into_file(FILE *outfile,
const char *opt,
const char *arg,
const char *values[])
353 found = check_possible_values(arg, values);
356 fprintf(outfile,
"%s=\"%s\" # %s\n", opt, arg, values[found]);
358 fprintf(outfile,
"%s=\"%s\"\n", opt, arg);
360 fprintf(outfile,
"%s\n", opt);
377 write_into_file(outfile,
"help", 0, 0 );
379 write_into_file(outfile,
"version", 0, 0 );
381 write_into_file(outfile,
"input", args_info->
input_orig, 0);
383 write_into_file(outfile,
"output", args_info->
output_orig, 0);
385 write_into_file(outfile,
"sele1", args_info->
sele1_orig, 0);
387 write_into_file(outfile,
"sele2", args_info->
sele2_orig, 0);
389 write_into_file(outfile,
"nbins", args_info->
nbins_orig, 0);
391 write_into_file(outfile,
"nbins_z", args_info->
nbins_z_orig, 0);
393 write_into_file(outfile,
"privilegedAxis", args_info->
privilegedAxis_orig, cmdline_parser_privilegedAxis_values);
395 write_into_file(outfile,
"centroidX", args_info->
centroidX_orig, 0);
397 write_into_file(outfile,
"centroidY", args_info->
centroidY_orig, 0);
401 write_into_file(outfile,
"dropletR", args_info->
dropletR_orig, 0);
407 write_into_file(outfile,
"rcut", args_info->
rcut_orig, 0);
409 write_into_file(outfile,
"voxelSize", args_info->
voxelSize_orig, 0);
413 write_into_file(outfile,
"com", 0, 0 );
415 write_into_file(outfile,
"comvel", 0, 0 );
417 write_into_file(outfile,
"deltaCount", 0, 0 );
419 write_into_file(outfile,
"fluxOut", 0, 0 );
421 write_into_file(outfile,
"ca1", 0, 0 );
423 write_into_file(outfile,
"ca2", 0, 0 );
425 write_into_file(outfile,
"gcn", 0, 0 );
427 write_into_file(outfile,
"testequi", 0, 0 );
429 write_into_file(outfile,
"qsurf", 0, 0 );
442 outfile = fopen(filename,
"w");
459 cmdline_parser_release (args_info);
464gengetopt_strdup (
const char *s)
470 result = (
char*)malloc(strlen(s) + 1);
471 if (result == (
char*)0)
507 result = cmdline_parser_internal (argc, argv, args_info, params, 0);
524 result = cmdline_parser_internal (argc, argv, args_info, ¶ms, 0);
532 int result = EXIT_SUCCESS;
534 if (cmdline_parser_required2(args_info, prog_name, 0) > 0)
535 result = EXIT_FAILURE;
541cmdline_parser_required2 (
struct gengetopt_args_info *args_info,
const char *prog_name,
const char *additional_error)
543 int error_occurred = 0;
544 FIX_UNUSED (additional_error);
549 fprintf (stderr,
"%s: '--input' ('-i') option required%s\n", prog_name, (additional_error ? additional_error :
""));
555 fprintf (stderr,
"%s: %d options of group sequentialProps were given. One is required%s.\n", prog_name, args_info->
sequentialProps_group_counter, (additional_error ? additional_error :
""));
562 return error_occurred;
620#ifndef required_argument
621#define required_argument 1
624#ifndef optional_argument
625#define optional_argument 2
628struct custom_getopt_data {
670static char *custom_optarg;
687static int custom_optind = 1;
693static int custom_opterr = 1;
699static int custom_optopt =
'?';
709static void exchange(
char **argv,
struct custom_getopt_data *d)
711 int bottom = d->first_nonopt;
712 int middle = d->last_nonopt;
713 int top = d->custom_optind;
722 while (top > middle && middle > bottom) {
723 if (top - middle > middle - bottom) {
725 int len = middle - bottom;
729 for (i = 0; i < len; i++) {
730 tem = argv[bottom + i];
732 argv[top - (middle - bottom) + i];
733 argv[top - (middle - bottom) + i] = tem;
739 int len = top - middle;
743 for (i = 0; i < len; i++) {
744 tem = argv[bottom + i];
745 argv[bottom + i] = argv[middle + i];
746 argv[middle + i] = tem;
753 d->first_nonopt += (d->custom_optind - d->last_nonopt);
754 d->last_nonopt = d->custom_optind;
758static void custom_getopt_initialize(
struct custom_getopt_data *d)
765 d->first_nonopt = d->last_nonopt = d->custom_optind;
770#define NONOPTION_P (argv[d->custom_optind][0] != '-' || argv[d->custom_optind][1] == '\0')
773static int shuffle_argv(
int argc,
char *
const *argv,
const struct option *longopts,
774 struct custom_getopt_data *d)
780 if (d->last_nonopt > d->custom_optind)
781 d->last_nonopt = d->custom_optind;
782 if (d->first_nonopt > d->custom_optind)
783 d->first_nonopt = d->custom_optind;
788 if (d->first_nonopt != d->last_nonopt &&
789 d->last_nonopt != d->custom_optind)
790 exchange((
char **) argv, d);
791 else if (d->last_nonopt != d->custom_optind)
792 d->first_nonopt = d->custom_optind;
797 while (d->custom_optind < argc && NONOPTION_P)
799 d->last_nonopt = d->custom_optind;
805 if (d->custom_optind != argc && !strcmp(argv[d->custom_optind],
"--")) {
807 if (d->first_nonopt != d->last_nonopt
808 && d->last_nonopt != d->custom_optind)
809 exchange((
char **) argv, d);
810 else if (d->first_nonopt == d->last_nonopt)
811 d->first_nonopt = d->custom_optind;
812 d->last_nonopt = argc;
813 d->custom_optind = argc;
819 if (d->custom_optind == argc) {
824 if (d->first_nonopt != d->last_nonopt)
825 d->custom_optind = d->first_nonopt;
833 d->custom_optarg = argv[d->custom_optind++];
840 d->nextchar = (argv[d->custom_optind] + 1 + (longopts != NULL && argv[d->custom_optind][1] ==
'-'));
854static int check_long_opt(
int argc,
char *
const *argv,
const char *optstring,
855 const struct option *longopts,
int *longind,
856 int print_errors,
struct custom_getopt_data *d)
859 const struct option *p;
860 const struct option *pfound = NULL;
866 for (nameend = d->nextchar; *nameend && *nameend !=
'='; nameend++)
870 for (p = longopts, option_index = 0; p->name; p++, option_index++)
871 if (!strncmp(p->name, d->nextchar, nameend - d->nextchar)) {
872 if ((
unsigned int) (nameend - d->nextchar)
873 == (
unsigned int) strlen(p->name)) {
876 indfound = option_index;
879 }
else if (pfound == NULL) {
882 indfound = option_index;
883 }
else if (pfound->has_arg != p->has_arg
884 || pfound->flag != p->flag
885 || pfound->val != p->val)
889 if (ambig && !exact) {
892 "%s: option `%s' is ambiguous\n",
893 argv[0], argv[d->custom_optind]);
895 d->nextchar += strlen(d->nextchar);
897 d->custom_optopt = 0;
901 option_index = indfound;
904 if (pfound->has_arg != no_argument)
905 d->custom_optarg = nameend + 1;
908 if (argv[d->custom_optind - 1][1] ==
'-') {
910 fprintf(stderr,
"%s: option `--%s' doesn't allow an argument\n",
911 argv[0], pfound->name);
914 fprintf(stderr,
"%s: option `%c%s' doesn't allow an argument\n",
915 argv[0], argv[d->custom_optind - 1][0], pfound->name);
919 d->nextchar += strlen(d->nextchar);
920 d->custom_optopt = pfound->val;
923 }
else if (pfound->has_arg == required_argument) {
924 if (d->custom_optind < argc)
925 d->custom_optarg = argv[d->custom_optind++];
929 "%s: option `%s' requires an argument\n",
931 argv[d->custom_optind - 1]);
933 d->nextchar += strlen(d->nextchar);
934 d->custom_optopt = pfound->val;
935 return optstring[0] ==
':' ?
':' :
'?';
938 d->nextchar += strlen(d->nextchar);
940 *longind = option_index;
942 *(pfound->flag) = pfound->val;
953 if (argv[d->custom_optind][1] ==
'-') {
956 "%s: unrecognized option `--%s'\n",
957 argv[0], d->nextchar);
961 "%s: unrecognized option `%c%s'\n",
962 argv[0], argv[d->custom_optind][0],
966 d->nextchar = (
char *)
"";
968 d->custom_optopt = 0;
972static int check_short_opt(
int argc,
char *
const *argv,
const char *optstring,
973 int print_errors,
struct custom_getopt_data *d)
975 char c = *d->nextchar++;
976 const char *temp = strchr(optstring, c);
979 if (*d->nextchar ==
'\0')
981 if (!temp || c ==
':') {
983 fprintf(stderr,
"%s: invalid option -- %c\n", argv[0], c);
985 d->custom_optopt = c;
988 if (temp[1] ==
':') {
989 if (temp[2] ==
':') {
991 if (*d->nextchar !=
'\0') {
992 d->custom_optarg = d->nextchar;
995 d->custom_optarg = NULL;
999 if (*d->nextchar !=
'\0') {
1000 d->custom_optarg = d->nextchar;
1007 }
else if (d->custom_optind == argc) {
1010 "%s: option requires an argument -- %c\n",
1013 d->custom_optopt = c;
1014 if (optstring[0] ==
':')
1024 d->custom_optarg = argv[d->custom_optind++];
1101static int getopt_internal_r(
int argc,
char *
const *argv,
const char *optstring,
1102 const struct option *longopts,
int *longind,
1103 struct custom_getopt_data *d)
1105 int ret, print_errors = d->custom_opterr;
1107 if (optstring[0] ==
':')
1111 d->custom_optarg = NULL;
1117 if (d->custom_optind == 0 || !d->initialized) {
1118 if (d->custom_optind == 0)
1119 d->custom_optind = 1;
1120 custom_getopt_initialize(d);
1122 if (d->nextchar == NULL || *d->nextchar ==
'\0') {
1123 ret = shuffle_argv(argc, argv, longopts, d);
1127 if (longopts && (argv[d->custom_optind][1] ==
'-' ))
1128 return check_long_opt(argc, argv, optstring, longopts,
1129 longind, print_errors, d);
1130 return check_short_opt(argc, argv, optstring, print_errors, d);
1133static int custom_getopt_internal(
int argc,
char *
const *argv,
const char *optstring,
1134 const struct option *longopts,
int *longind)
1138 static struct custom_getopt_data d;
1140 d.custom_optind = custom_optind;
1141 d.custom_opterr = custom_opterr;
1142 result = getopt_internal_r(argc, argv, optstring, longopts,
1144 custom_optind = d.custom_optind;
1145 custom_optarg = d.custom_optarg;
1146 custom_optopt = d.custom_optopt;
1150static int custom_getopt_long (
int argc,
char *
const *argv,
const char *options,
1151 const struct option *long_options,
int *opt_index)
1153 return custom_getopt_internal(argc, argv, options, long_options,
1158static char *package_name = 0;
1179int update_arg(
void *field,
char **orig_field,
1180 unsigned int *field_given,
unsigned int *prev_given,
1181 char *value,
const char *possible_values[],
1182 const char *default_value,
1183 cmdline_parser_arg_type arg_type,
1184 int check_ambiguity,
int override,
1185 int no_free,
int multiple_option,
1186 const char *long_opt,
char short_opt,
1187 const char *additional_error)
1189 char *stop_char = 0;
1190 const char *val = value;
1192 char **string_field;
1198 if (!multiple_option && prev_given && (*prev_given || (check_ambiguity && *field_given)))
1200 if (short_opt !=
'-')
1201 fprintf (stderr,
"%s: `--%s' (`-%c') option given more than once%s\n",
1202 package_name, long_opt, short_opt,
1203 (additional_error ? additional_error :
""));
1205 fprintf (stderr,
"%s: `--%s' option given more than once%s\n",
1206 package_name, long_opt,
1207 (additional_error ? additional_error :
""));
1211 if (possible_values && (found = check_possible_values((value ? value : default_value), possible_values)) < 0)
1213 if (short_opt !=
'-')
1214 fprintf (stderr,
"%s: %s argument, \"%s\", for option `--%s' (`-%c')%s\n",
1215 package_name, (found == -2) ?
"ambiguous" :
"invalid", value, long_opt, short_opt,
1216 (additional_error ? additional_error :
""));
1218 fprintf (stderr,
"%s: %s argument, \"%s\", for option `--%s'%s\n",
1219 package_name, (found == -2) ?
"ambiguous" :
"invalid", value, long_opt,
1220 (additional_error ? additional_error :
""));
1224 if (field_given && *field_given && !
override)
1230 if (possible_values)
1231 val = possible_values[found];
1235 if (val) *((
int *)field) = strtol (val, &stop_char, 0);
1238 if (val) *((
double *)field) = strtod (val, &stop_char);
1241 if (val) *((
int *)field) = found;
1245 string_field = (
char **)field;
1246 if (!no_free && *string_field)
1247 free (*string_field);
1248 *string_field = gengetopt_strdup (val);
1259 if (val && !(stop_char && *stop_char ==
'\0')) {
1260 fprintf(stderr,
"%s: invalid numeric value: %s\n", package_name, val);
1273 if (value && orig_field) {
1275 *orig_field = value;
1279 *orig_field = gengetopt_strdup (value);
1289cmdline_parser_internal (
1295 int error_occurred = 0;
1301 int check_ambiguity;
1308 package_name = argv[0];
1312 FIX_UNUSED(
override);
1319 FIX_UNUSED(check_ambiguity);
1333 int option_index = 0;
1335 static struct option long_options[] = {
1336 {
"help", 0, NULL,
'h' },
1337 {
"version", 0, NULL,
'V' },
1338 {
"input", 1, NULL,
'i' },
1339 {
"output", 1, NULL,
'o' },
1340 {
"sele1", 1, NULL, 0 },
1341 {
"sele2", 1, NULL, 0 },
1342 {
"nbins", 1, NULL,
'b' },
1343 {
"nbins_z", 1, NULL, 0 },
1344 {
"privilegedAxis", 1, NULL, 0 },
1345 {
"centroidX", 1, NULL,
'x' },
1346 {
"centroidY", 1, NULL,
'y' },
1347 {
"referenceZ", 1, NULL,
'z' },
1348 {
"dropletR", 1, NULL,
'r' },
1349 {
"threshDens", 1, NULL, 0 },
1350 {
"bufferLength", 1, NULL, 0 },
1351 {
"rcut", 1, NULL, 0 },
1352 {
"voxelSize", 1, NULL, 0 },
1353 {
"gaussWidth", 1, NULL, 0 },
1354 {
"com", 0, NULL,
'c' },
1355 {
"comvel", 0, NULL,
'v' },
1356 {
"deltaCount", 0, NULL, 0 },
1357 {
"fluxOut", 0, NULL, 0 },
1358 {
"ca1", 0, NULL, 0 },
1359 {
"ca2", 0, NULL, 0 },
1360 {
"gcn", 0, NULL, 0 },
1361 {
"testequi", 0, NULL,
't' },
1362 {
"qsurf", 0, NULL, 0 },
1366 custom_optarg = optarg;
1367 custom_optind = optind;
1368 custom_opterr = opterr;
1369 custom_optopt = optopt;
1371 c = custom_getopt_long (argc, argv,
"hVi:o:b:x:y:z:r:cvt", long_options, &option_index);
1373 optarg = custom_optarg;
1374 optind = custom_optind;
1375 opterr = custom_opterr;
1376 optopt = custom_optopt;
1384 cmdline_parser_free (&local_args_info);
1385 exit (EXIT_SUCCESS);
1389 cmdline_parser_free (&local_args_info);
1390 exit (EXIT_SUCCESS);
1395 if (update_arg( (
void *)&(args_info->
input_arg),
1397 &(local_args_info.input_given), optarg, 0, 0, ARG_STRING,
1398 check_ambiguity,
override, 0, 0,
1407 if (update_arg( (
void *)&(args_info->
output_arg),
1409 &(local_args_info.output_given), optarg, 0, 0, ARG_STRING,
1410 check_ambiguity,
override, 0, 0,
1419 if (update_arg( (
void *)&(args_info->
nbins_arg),
1421 &(local_args_info.nbins_given), optarg, 0,
"100", ARG_INT,
1422 check_ambiguity,
override, 0, 0,
1433 &(local_args_info.centroidX_given), optarg, 0, 0, ARG_DOUBLE,
1434 check_ambiguity,
override, 0, 0,
1445 &(local_args_info.centroidY_given), optarg, 0, 0, ARG_DOUBLE,
1446 check_ambiguity,
override, 0, 0,
1457 &(local_args_info.referenceZ_given), optarg, 0, 0, ARG_DOUBLE,
1458 check_ambiguity,
override, 0, 0,
1469 &(local_args_info.dropletR_given), optarg, 0, 0, ARG_DOUBLE,
1470 check_ambiguity,
override, 0, 0,
1479 reset_group_sequentialProps (args_info);
1484 &(local_args_info.com_given), optarg, 0, 0, ARG_NO,
1485 check_ambiguity,
override, 0, 0,
1494 reset_group_sequentialProps (args_info);
1499 &(local_args_info.comvel_given), optarg, 0, 0, ARG_NO,
1500 check_ambiguity,
override, 0, 0,
1509 reset_group_sequentialProps (args_info);
1514 &(local_args_info.testequi_given), optarg, 0, 0, ARG_NO,
1515 check_ambiguity,
override, 0, 0,
1524 if (strcmp (long_options[option_index].name,
"sele1") == 0)
1528 if (update_arg( (
void *)&(args_info->
sele1_arg),
1530 &(local_args_info.sele1_given), optarg, 0, 0, ARG_STRING,
1531 check_ambiguity,
override, 0, 0,
1538 else if (strcmp (long_options[option_index].name,
"sele2") == 0)
1542 if (update_arg( (
void *)&(args_info->
sele2_arg),
1544 &(local_args_info.sele2_given), optarg, 0, 0, ARG_STRING,
1545 check_ambiguity,
override, 0, 0,
1552 else if (strcmp (long_options[option_index].name,
"nbins_z") == 0)
1556 if (update_arg( (
void *)&(args_info->
nbins_z_arg),
1558 &(local_args_info.nbins_z_given), optarg, 0,
"100", ARG_INT,
1559 check_ambiguity,
override, 0, 0,
1566 else if (strcmp (long_options[option_index].name,
"privilegedAxis") == 0)
1572 &(local_args_info.privilegedAxis_given), optarg, cmdline_parser_privilegedAxis_values,
"z", ARG_ENUM,
1573 check_ambiguity,
override, 0, 0,
1574 "privilegedAxis",
'-',
1580 else if (strcmp (long_options[option_index].name,
"threshDens") == 0)
1586 &(local_args_info.threshDens_given), optarg, 0, 0, ARG_DOUBLE,
1587 check_ambiguity,
override, 0, 0,
1594 else if (strcmp (long_options[option_index].name,
"bufferLength") == 0)
1600 &(local_args_info.bufferLength_given), optarg, 0, 0, ARG_DOUBLE,
1601 check_ambiguity,
override, 0, 0,
1602 "bufferLength",
'-',
1608 else if (strcmp (long_options[option_index].name,
"rcut") == 0)
1612 if (update_arg( (
void *)&(args_info->
rcut_arg),
1614 &(local_args_info.rcut_given), optarg, 0, 0, ARG_DOUBLE,
1615 check_ambiguity,
override, 0, 0,
1622 else if (strcmp (long_options[option_index].name,
"voxelSize") == 0)
1628 &(local_args_info.voxelSize_given), optarg, 0,
"2.0", ARG_DOUBLE,
1629 check_ambiguity,
override, 0, 0,
1636 else if (strcmp (long_options[option_index].name,
"gaussWidth") == 0)
1642 &(local_args_info.gaussWidth_given), optarg, 0,
"3.0", ARG_DOUBLE,
1643 check_ambiguity,
override, 0, 0,
1650 else if (strcmp (long_options[option_index].name,
"deltaCount") == 0)
1654 reset_group_sequentialProps (args_info);
1659 &(local_args_info.deltaCount_given), optarg, 0, 0, ARG_NO,
1660 check_ambiguity,
override, 0, 0,
1667 else if (strcmp (long_options[option_index].name,
"fluxOut") == 0)
1671 reset_group_sequentialProps (args_info);
1676 &(local_args_info.fluxOut_given), optarg, 0, 0, ARG_NO,
1677 check_ambiguity,
override, 0, 0,
1684 else if (strcmp (long_options[option_index].name,
"ca1") == 0)
1688 reset_group_sequentialProps (args_info);
1693 &(local_args_info.ca1_given), optarg, 0, 0, ARG_NO,
1694 check_ambiguity,
override, 0, 0,
1701 else if (strcmp (long_options[option_index].name,
"ca2") == 0)
1705 reset_group_sequentialProps (args_info);
1710 &(local_args_info.ca2_given), optarg, 0, 0, ARG_NO,
1711 check_ambiguity,
override, 0, 0,
1718 else if (strcmp (long_options[option_index].name,
"gcn") == 0)
1722 reset_group_sequentialProps (args_info);
1727 &(local_args_info.gcn_given), optarg, 0, 0, ARG_NO,
1728 check_ambiguity,
override, 0, 0,
1735 else if (strcmp (long_options[option_index].name,
"qsurf") == 0)
1739 reset_group_sequentialProps (args_info);
1744 &(local_args_info.qsurf_given), optarg, 0, 0, ARG_NO,
1745 check_ambiguity,
override, 0, 0,
1758 fprintf (stderr,
"%s: option unknown: %c%s\n",
CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error :
""));
1765 fprintf (stderr,
"%s: %d options of group sequentialProps were given. One is required%s.\n", argv[0], args_info->
sequentialProps_group_counter, (additional_error ? additional_error :
""));
1773 error_occurred += cmdline_parser_required2 (args_info, argv[0], additional_error);
1776 cmdline_parser_release (&local_args_info);
1778 if ( error_occurred )
1779 return (EXIT_FAILURE);
1784 int found_prog_name = 0;
1790 args_info->
inputs_num = argc - optind - found_prog_name;
1792 (
char **)(malloc ((args_info->
inputs_num)*
sizeof(
char *))) ;
1793 while (optind < argc)
1794 args_info->
inputs[ i++ ] = gengetopt_strdup (argv[optind++]) ;
1801 cmdline_parser_release (&local_args_info);
1802 return (EXIT_FAILURE);
#define CMDLINE_PARSER_VERSION
the program version
void cmdline_parser_print_version(void)
Print the version.
struct cmdline_parser_params * cmdline_parser_params_create(void)
Allocates dynamically a cmdline_parser_params structure and initializes all its fields to their defau...
void cmdline_parser_print_help(void)
Print the help.
#define CMDLINE_PARSER_PACKAGE_NAME
the complete program name (used for help and version)
#define CMDLINE_PARSER_PACKAGE
the program name (used for printing errors)
The header file for the command line option parser generated by GNU Gengetopt version 2....
The additional parameters to pass to parser functions.
int print_errors
whether getopt_long should print an error message for a bad option (default 1)
int check_required
whether to check that all required options were provided (default 1)
int check_ambiguity
whether to check for options already specified in the option structure gengetopt_args_info (default 0...
int initialize
whether to initialize the option structure gengetopt_args_info (default 1)
int override
whether to override possibly already present options (default 0)
Where the command line options are stored.
unsigned int comvel_given
Whether comvel was given.
char * sele2_arg
select second stuntdouble set (if sele2 is not set, use script from sele1).
char * nbins_orig
Number of bins original value given at command line.
const char * comvel_help
selection center of mass velocity help description.
unsigned int output_given
Whether output was given.
double gaussWidth_arg
Gaussian width for coarse graining (Angstroms) (default='3.0').
unsigned int privilegedAxis_given
Whether privilegedAxis was given.
double centroidX_arg
Location of droplet centroid in x.
unsigned int referenceZ_given
Whether referenceZ was given.
const char * rcut_help
cutoff radius (angstroms) help description.
unsigned int dropletR_given
Whether dropletR was given.
unsigned int fluxOut_given
Whether fluxOut was given.
unsigned int threshDens_given
Whether threshDens was given.
char * output_orig
output file name original value given at command line.
const char * output_help
output file name help description.
const char * nbins_help
Number of bins help description.
const char * ca1_help
contact angle of selection (using center of mass) help description.
double bufferLength_arg
Buffer length in angstroms.
char * referenceZ_orig
Reference z-height of solid surface original value given at command line.
const char * sele1_help
select first stuntdouble set help description.
unsigned int voxelSize_given
Whether voxelSize was given.
char * bufferLength_orig
Buffer length in angstroms original value given at command line.
double referenceZ_arg
Reference z-height of solid surface.
const char * sele2_help
select second stuntdouble set (if sele2 is not set, use script from sele1) help description.
unsigned inputs_num
unamed options number
const char * qsurf_help
tetrahedrality Q field as OpenDX volumetric files help description.
char * privilegedAxis_orig
which axis is special for spatial analysis (default = z axis) original value given at command line.
const char * gcn_help
Generalized Coordinate Number help description.
unsigned int ca2_given
Whether ca2 was given.
const char * ca2_help
contact angle of selection (using density profile) help description.
const char * deltaCount_help
difference in counts between two selections help description.
const char * referenceZ_help
Reference z-height of solid surface help description.
unsigned int gaussWidth_given
Whether gaussWidth was given.
const char * help_help
Print help and exit help description.
char * threshDens_orig
Threshold Density in g/cm^3 original value given at command line.
char * output_arg
output file name.
unsigned int centroidY_given
Whether centroidY was given.
const char * centroidX_help
Location of droplet centroid in x help description.
const char * threshDens_help
Threshold Density in g/cm^3 help description.
char ** inputs
unamed options (options without names)
const char * centroidY_help
Location of droplet centroid in y help description.
const char * com_help
selection center of mass help description.
unsigned int testequi_given
Whether testequi was given.
char * input_arg
input dump file.
char * nbins_z_orig
number of bins in z axis original value given at command line.
int nbins_z_arg
number of bins in z axis (default='100').
unsigned int sele1_given
Whether sele1 was given.
unsigned int gcn_given
Whether gcn was given.
char * dropletR_orig
Droplet radius in angstroms original value given at command line.
unsigned int com_given
Whether com was given.
double rcut_arg
cutoff radius (angstroms).
const char * voxelSize_help
voxel size for coarse graining (Angstroms) help description.
int sequentialProps_group_counter
Counter for group sequentialProps.
const char * privilegedAxis_help
which axis is special for spatial analysis (default = z axis) help description.
char * sele2_orig
select second stuntdouble set (if sele2 is not set, use script from sele1) original value given at co...
unsigned int deltaCount_given
Whether deltaCount was given.
char * sele1_orig
select first stuntdouble set original value given at command line.
unsigned int ca1_given
Whether ca1 was given.
char * centroidX_orig
Location of droplet centroid in x original value given at command line.
double voxelSize_arg
voxel size for coarse graining (Angstroms) (default='2.0').
char * sele1_arg
select first stuntdouble set.
double centroidY_arg
Location of droplet centroid in y.
const char * bufferLength_help
Buffer length in angstroms help description.
unsigned int rcut_given
Whether rcut was given.
unsigned int bufferLength_given
Whether bufferLength was given.
unsigned int help_given
Whether help was given.
const char * dropletR_help
Droplet radius in angstroms help description.
double threshDens_arg
Threshold Density in g/cm^3.
unsigned int qsurf_given
Whether qsurf was given.
unsigned int input_given
Whether input was given.
char * voxelSize_orig
voxel size for coarse graining (Angstroms) original value given at command line.
int nbins_arg
Number of bins (default='100').
const char * testequi_help
Temperature using all componets of linear and angular momentum help description.
enum enum_privilegedAxis privilegedAxis_arg
which axis is special for spatial analysis (default = z axis) (default='z').
unsigned int centroidX_given
Whether centroidX was given.
unsigned int version_given
Whether version was given.
unsigned int sele2_given
Whether sele2 was given.
const char * version_help
Print version and exit help description.
char * centroidY_orig
Location of droplet centroid in y original value given at command line.
char * input_orig
input dump file original value given at command line.
unsigned int nbins_given
Whether nbins was given.
const char * nbins_z_help
number of bins in z axis help description.
const char * gaussWidth_help
Gaussian width for coarse graining (Angstroms) help description.
double dropletR_arg
Droplet radius in angstroms.
unsigned int nbins_z_given
Whether nbins_z was given.
char * rcut_orig
cutoff radius (angstroms) original value given at command line.
const char * fluxOut_help
number flux out of a selection help description.
const char * input_help
input dump file help description.
char * gaussWidth_orig
Gaussian width for coarse graining (Angstroms) original value given at command line.
int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
Save the contents of the option struct into an already open FILE stream.
int cmdline_parser(int argc, char **argv, struct gengetopt_args_info *args_info)
The command line parser.
int cmdline_parser_file_save(const char *filename, struct gengetopt_args_info *args_info)
Save the contents of the option struct into a (text) file.
int cmdline_parser2(int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
The command line parser (version with additional parameters - deprecated).
int cmdline_parser_required(struct gengetopt_args_info *args_info, const char *prog_name)
Checks that all the required options were specified.
int cmdline_parser_ext(int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params)
The command line parser (version with additional parameters).
void cmdline_parser_init(struct gengetopt_args_info *args_info)
Initializes the passed gengetopt_args_info structure's fields (also set default values for options th...
void cmdline_parser_free(struct gengetopt_args_info *args_info)
Deallocates the string fields of the gengetopt_args_info structure (but does not deallocate the struc...
void cmdline_parser_params_init(struct cmdline_parser_params *params)
Initializes all the fields a cmdline_parser_params structure to their default values.