| 43 |  | "      --sele1=selection script  select first stuntdouble set", | 
| 44 |  | "      --sele2=selection script  select second stuntdouble set (if sele2 is not \n                                  set, use script from sele1)", | 
| 45 |  | "  -n, --nbins=INT               Number of bins  (default=`100')", | 
| 46 | + | "  -z, --referenceZ=DOUBLE       Reference z-height of solid surface", | 
| 47 | + | "  -r, --dropletR=DOUBLE         Droplet radius in angstroms", | 
| 48 |  | "\n Group: sequentialProps\n   an option of this group is required", | 
| 49 | < | "  -d, --density                 selection correlation function", | 
| 49 | > | "  -c, --com                     selection center of mass", | 
| 50 | > | "      --ca1                     contact angle of selection (using center of \n                                  mass)", | 
| 51 | > | "      --ca2                     contact angle of selection (using density \n                                  profile)", | 
| 52 |  | 0 | 
| 53 |  | }; | 
| 54 |  |  | 
| 55 |  | typedef enum {ARG_NO | 
| 56 |  | , ARG_STRING | 
| 57 |  | , ARG_INT | 
| 58 | + | , ARG_DOUBLE | 
| 59 |  | } cmdline_parser_arg_type; | 
| 60 |  |  | 
| 61 |  | static | 
| 83 |  | args_info->sele1_given = 0 ; | 
| 84 |  | args_info->sele2_given = 0 ; | 
| 85 |  | args_info->nbins_given = 0 ; | 
| 86 | < | args_info->density_given = 0 ; | 
| 86 | > | args_info->referenceZ_given = 0 ; | 
| 87 | > | args_info->dropletR_given = 0 ; | 
| 88 | > | args_info->com_given = 0 ; | 
| 89 | > | args_info->ca1_given = 0 ; | 
| 90 | > | args_info->ca2_given = 0 ; | 
| 91 |  | args_info->sequentialProps_group_counter = 0 ; | 
| 92 |  | } | 
| 93 |  |  | 
| 105 |  | args_info->sele2_orig = NULL; | 
| 106 |  | args_info->nbins_arg = 100; | 
| 107 |  | args_info->nbins_orig = NULL; | 
| 108 | + | args_info->referenceZ_orig = NULL; | 
| 109 | + | args_info->dropletR_orig = NULL; | 
| 110 |  |  | 
| 111 |  | } | 
| 112 |  |  | 
| 122 |  | args_info->sele1_help = gengetopt_args_info_help[4] ; | 
| 123 |  | args_info->sele2_help = gengetopt_args_info_help[5] ; | 
| 124 |  | args_info->nbins_help = gengetopt_args_info_help[6] ; | 
| 125 | < | args_info->density_help = gengetopt_args_info_help[8] ; | 
| 125 | > | args_info->referenceZ_help = gengetopt_args_info_help[7] ; | 
| 126 | > | args_info->dropletR_help = gengetopt_args_info_help[8] ; | 
| 127 | > | args_info->com_help = gengetopt_args_info_help[10] ; | 
| 128 | > | args_info->ca1_help = gengetopt_args_info_help[11] ; | 
| 129 | > | args_info->ca2_help = gengetopt_args_info_help[12] ; | 
| 130 |  |  | 
| 131 |  | } | 
| 132 |  |  | 
| 219 |  | free_string_field (&(args_info->sele2_arg)); | 
| 220 |  | free_string_field (&(args_info->sele2_orig)); | 
| 221 |  | free_string_field (&(args_info->nbins_orig)); | 
| 222 | + | free_string_field (&(args_info->referenceZ_orig)); | 
| 223 | + | free_string_field (&(args_info->dropletR_orig)); | 
| 224 |  |  | 
| 225 |  |  | 
| 226 |  | for (i = 0; i < args_info->inputs_num; ++i) | 
| 270 |  | write_into_file(outfile, "sele2", args_info->sele2_orig, 0); | 
| 271 |  | if (args_info->nbins_given) | 
| 272 |  | write_into_file(outfile, "nbins", args_info->nbins_orig, 0); | 
| 273 | < | if (args_info->density_given) | 
| 274 | < | write_into_file(outfile, "density", 0, 0 ); | 
| 273 | > | if (args_info->referenceZ_given) | 
| 274 | > | write_into_file(outfile, "referenceZ", args_info->referenceZ_orig, 0); | 
| 275 | > | if (args_info->dropletR_given) | 
| 276 | > | write_into_file(outfile, "dropletR", args_info->dropletR_orig, 0); | 
| 277 | > | if (args_info->com_given) | 
| 278 | > | write_into_file(outfile, "com", 0, 0 ); | 
| 279 | > | if (args_info->ca1_given) | 
| 280 | > | write_into_file(outfile, "ca1", 0, 0 ); | 
| 281 | > | if (args_info->ca2_given) | 
| 282 | > | write_into_file(outfile, "ca2", 0, 0 ); | 
| 283 |  |  | 
| 284 |  |  | 
| 285 |  | i = EXIT_SUCCESS; | 
| 333 |  | if (! args_info->sequentialProps_group_counter) | 
| 334 |  | return; | 
| 335 |  |  | 
| 336 | < | args_info->density_given = 0 ; | 
| 336 | > | args_info->com_given = 0 ; | 
| 337 | > | args_info->ca1_given = 0 ; | 
| 338 | > | args_info->ca2_given = 0 ; | 
| 339 |  |  | 
| 340 |  | args_info->sequentialProps_group_counter = 0; | 
| 341 |  | } | 
| 496 |  | case ARG_INT: | 
| 497 |  | if (val) *((int *)field) = strtol (val, &stop_char, 0); | 
| 498 |  | break; | 
| 499 | + | case ARG_DOUBLE: | 
| 500 | + | if (val) *((double *)field) = strtod (val, &stop_char); | 
| 501 | + | break; | 
| 502 |  | case ARG_STRING: | 
| 503 |  | if (val) { | 
| 504 |  | string_field = (char **)field; | 
| 514 |  | /* check numeric conversion */ | 
| 515 |  | switch(arg_type) { | 
| 516 |  | case ARG_INT: | 
| 517 | + | case ARG_DOUBLE: | 
| 518 |  | if (val && !(stop_char && *stop_char == '\0')) { | 
| 519 |  | fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val); | 
| 520 |  | return 1; /* failure */ | 
| 588 |  | { "sele1",      1, NULL, 0 }, | 
| 589 |  | { "sele2",      1, NULL, 0 }, | 
| 590 |  | { "nbins",      1, NULL, 'n' }, | 
| 591 | < | { "density",    0, NULL, 'd' }, | 
| 591 | > | { "referenceZ", 1, NULL, 'z' }, | 
| 592 | > | { "dropletR",   1, NULL, 'r' }, | 
| 593 | > | { "com",        0, NULL, 'c' }, | 
| 594 | > | { "ca1",        0, NULL, 0 }, | 
| 595 | > | { "ca2",        0, NULL, 0 }, | 
| 596 |  | { 0,  0, 0, 0 } | 
| 597 |  | }; | 
| 598 |  |  | 
| 599 | < | c = getopt_long (argc, argv, "hVi:o:n:d", long_options, &option_index); | 
| 599 | > | c = getopt_long (argc, argv, "hVi:o:n:z:r:c", long_options, &option_index); | 
| 600 |  |  | 
| 601 |  | if (c == -1) break;       /* Exit from `while (1)' loop.  */ | 
| 602 |  |  | 
| 648 |  | goto failure; | 
| 649 |  |  | 
| 650 |  | break; | 
| 651 | < | case 'd':       /* selection correlation function.  */ | 
| 651 | > | case 'z':       /* Reference z-height of solid surface.  */ | 
| 652 |  |  | 
| 653 | + |  | 
| 654 | + | if (update_arg( (void *)&(args_info->referenceZ_arg), | 
| 655 | + | &(args_info->referenceZ_orig), &(args_info->referenceZ_given), | 
| 656 | + | &(local_args_info.referenceZ_given), optarg, 0, 0, ARG_DOUBLE, | 
| 657 | + | check_ambiguity, override, 0, 0, | 
| 658 | + | "referenceZ", 'z', | 
| 659 | + | additional_error)) | 
| 660 | + | goto failure; | 
| 661 | + |  | 
| 662 | + | break; | 
| 663 | + | case 'r':       /* Droplet radius in angstroms.  */ | 
| 664 | + |  | 
| 665 | + |  | 
| 666 | + | if (update_arg( (void *)&(args_info->dropletR_arg), | 
| 667 | + | &(args_info->dropletR_orig), &(args_info->dropletR_given), | 
| 668 | + | &(local_args_info.dropletR_given), optarg, 0, 0, ARG_DOUBLE, | 
| 669 | + | check_ambiguity, override, 0, 0, | 
| 670 | + | "dropletR", 'r', | 
| 671 | + | additional_error)) | 
| 672 | + | goto failure; | 
| 673 | + |  | 
| 674 | + | break; | 
| 675 | + | case 'c':       /* selection center of mass.  */ | 
| 676 | + |  | 
| 677 |  | if (args_info->sequentialProps_group_counter && override) | 
| 678 |  | reset_group_sequentialProps (args_info); | 
| 679 |  | args_info->sequentialProps_group_counter += 1; | 
| 680 |  |  | 
| 681 |  | if (update_arg( 0 , | 
| 682 | < | 0 , &(args_info->density_given), | 
| 683 | < | &(local_args_info.density_given), optarg, 0, 0, ARG_NO, | 
| 682 | > | 0 , &(args_info->com_given), | 
| 683 | > | &(local_args_info.com_given), optarg, 0, 0, ARG_NO, | 
| 684 |  | check_ambiguity, override, 0, 0, | 
| 685 | < | "density", 'd', | 
| 685 | > | "com", 'c', | 
| 686 |  | additional_error)) | 
| 687 |  | goto failure; | 
| 688 |  |  | 
| 717 |  | goto failure; | 
| 718 |  |  | 
| 719 |  | } | 
| 720 | + | /* contact angle of selection (using center of mass).  */ | 
| 721 | + | else if (strcmp (long_options[option_index].name, "ca1") == 0) | 
| 722 | + | { | 
| 723 |  |  | 
| 724 | + | if (args_info->sequentialProps_group_counter && override) | 
| 725 | + | reset_group_sequentialProps (args_info); | 
| 726 | + | args_info->sequentialProps_group_counter += 1; | 
| 727 | + |  | 
| 728 | + | if (update_arg( 0 , | 
| 729 | + | 0 , &(args_info->ca1_given), | 
| 730 | + | &(local_args_info.ca1_given), optarg, 0, 0, ARG_NO, | 
| 731 | + | check_ambiguity, override, 0, 0, | 
| 732 | + | "ca1", '-', | 
| 733 | + | additional_error)) | 
| 734 | + | goto failure; | 
| 735 | + |  | 
| 736 | + | } | 
| 737 | + | /* contact angle of selection (using density profile).  */ | 
| 738 | + | else if (strcmp (long_options[option_index].name, "ca2") == 0) | 
| 739 | + | { | 
| 740 | + |  | 
| 741 | + | if (args_info->sequentialProps_group_counter && override) | 
| 742 | + | reset_group_sequentialProps (args_info); | 
| 743 | + | args_info->sequentialProps_group_counter += 1; | 
| 744 | + |  | 
| 745 | + | if (update_arg( 0 , | 
| 746 | + | 0 , &(args_info->ca2_given), | 
| 747 | + | &(local_args_info.ca2_given), optarg, 0, 0, ARG_NO, | 
| 748 | + | check_ambiguity, override, 0, 0, | 
| 749 | + | "ca2", '-', | 
| 750 | + | additional_error)) | 
| 751 | + | goto failure; | 
| 752 | + |  | 
| 753 | + | } | 
| 754 | + |  | 
| 755 |  | break; | 
| 756 |  | case '?':       /* Invalid option.  */ | 
| 757 |  | /* `getopt_long' already printed an error message.  */ |