ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/applications/sequentialProps/SequentialPropsCmd.cpp
(Generate patch)

Comparing trunk/src/applications/sequentialProps/SequentialPropsCmd.cpp (file contents):
Revision 2029 by gezelter, Thu Oct 30 18:51:38 2014 UTC vs.
Revision 2039 by gezelter, Thu Nov 6 14:31:32 2014 UTC

# Line 42 | Line 42 | const char *gengetopt_args_info_help[] = {
42    "  -o, --output=filename         output file name",
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')",
45 >  "  -b, --nbins=INT               number of bins (general purpose)  \n                                  (default=`100')",
46 >  "      --nbins_z=INT             number of bins in z axis  (default=`100')",
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    "\n Group: sequentialProps\n   an option of this group is required",
52    "  -c, --com                     selection center of mass",
53    "      --ca1                     contact angle of selection (using center of \n                                  mass)",
# Line 83 | Line 86 | void clear_given (struct gengetopt_args_info *args_inf
86    args_info->sele1_given = 0 ;
87    args_info->sele2_given = 0 ;
88    args_info->nbins_given = 0 ;
89 +  args_info->nbins_z_given = 0 ;
90    args_info->referenceZ_given = 0 ;
91    args_info->dropletR_given = 0 ;
92 +  args_info->threshDens_given = 0 ;
93 +  args_info->bufferLength_given = 0 ;
94    args_info->com_given = 0 ;
95    args_info->ca1_given = 0 ;
96    args_info->ca2_given = 0 ;
# Line 105 | Line 111 | void clear_args (struct gengetopt_args_info *args_info
111    args_info->sele2_orig = NULL;
112    args_info->nbins_arg = 100;
113    args_info->nbins_orig = NULL;
114 +  args_info->nbins_z_arg = 100;
115 +  args_info->nbins_z_orig = NULL;
116    args_info->referenceZ_orig = NULL;
117    args_info->dropletR_orig = NULL;
118 +  args_info->threshDens_orig = NULL;
119 +  args_info->bufferLength_orig = NULL;
120    
121   }
122  
# Line 122 | Line 132 | void init_args_info(struct gengetopt_args_info *args_i
132    args_info->sele1_help = gengetopt_args_info_help[4] ;
133    args_info->sele2_help = gengetopt_args_info_help[5] ;
134    args_info->nbins_help = gengetopt_args_info_help[6] ;
135 <  args_info->referenceZ_help = gengetopt_args_info_help[7] ;
136 <  args_info->dropletR_help = gengetopt_args_info_help[8] ;
137 <  args_info->com_help = gengetopt_args_info_help[10] ;
138 <  args_info->ca1_help = gengetopt_args_info_help[11] ;
139 <  args_info->ca2_help = gengetopt_args_info_help[12] ;
135 >  args_info->nbins_z_help = gengetopt_args_info_help[7] ;
136 >  args_info->referenceZ_help = gengetopt_args_info_help[8] ;
137 >  args_info->dropletR_help = gengetopt_args_info_help[9] ;
138 >  args_info->threshDens_help = gengetopt_args_info_help[10] ;
139 >  args_info->bufferLength_help = gengetopt_args_info_help[11] ;
140 >  args_info->com_help = gengetopt_args_info_help[13] ;
141 >  args_info->ca1_help = gengetopt_args_info_help[14] ;
142 >  args_info->ca2_help = gengetopt_args_info_help[15] ;
143    
144   }
145  
# Line 219 | Line 232 | cmdline_parser_release (struct gengetopt_args_info *ar
232    free_string_field (&(args_info->sele2_arg));
233    free_string_field (&(args_info->sele2_orig));
234    free_string_field (&(args_info->nbins_orig));
235 +  free_string_field (&(args_info->nbins_z_orig));
236    free_string_field (&(args_info->referenceZ_orig));
237    free_string_field (&(args_info->dropletR_orig));
238 +  free_string_field (&(args_info->threshDens_orig));
239 +  free_string_field (&(args_info->bufferLength_orig));
240    
241    
242    for (i = 0; i < args_info->inputs_num; ++i)
# Line 270 | Line 286 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
286      write_into_file(outfile, "sele2", args_info->sele2_orig, 0);
287    if (args_info->nbins_given)
288      write_into_file(outfile, "nbins", args_info->nbins_orig, 0);
289 +  if (args_info->nbins_z_given)
290 +    write_into_file(outfile, "nbins_z", args_info->nbins_z_orig, 0);
291    if (args_info->referenceZ_given)
292      write_into_file(outfile, "referenceZ", args_info->referenceZ_orig, 0);
293    if (args_info->dropletR_given)
294      write_into_file(outfile, "dropletR", args_info->dropletR_orig, 0);
295 +  if (args_info->threshDens_given)
296 +    write_into_file(outfile, "threshDens", args_info->threshDens_orig, 0);
297 +  if (args_info->bufferLength_given)
298 +    write_into_file(outfile, "bufferLength", args_info->bufferLength_orig, 0);
299    if (args_info->com_given)
300      write_into_file(outfile, "com", 0, 0 );
301    if (args_info->ca1_given)
# Line 587 | Line 609 | cmdline_parser_internal (
609          { "output",     1, NULL, 'o' },
610          { "sele1",      1, NULL, 0 },
611          { "sele2",      1, NULL, 0 },
612 <        { "nbins",      1, NULL, 'n' },
612 >        { "nbins",      1, NULL, 'b' },
613 >        { "nbins_z",    1, NULL, 0 },
614          { "referenceZ", 1, NULL, 'z' },
615          { "dropletR",   1, NULL, 'r' },
616 +        { "threshDens", 1, NULL, 0 },
617 +        { "bufferLength",       1, NULL, 0 },
618          { "com",        0, NULL, 'c' },
619          { "ca1",        0, NULL, 0 },
620          { "ca2",        0, NULL, 0 },
621          { 0,  0, 0, 0 }
622        };
623  
624 <      c = getopt_long (argc, argv, "hVi:o:n:z:r:c", long_options, &option_index);
624 >      c = getopt_long (argc, argv, "hVi:o:b:z:r:c", long_options, &option_index);
625  
626        if (c == -1) break;       /* Exit from `while (1)' loop.  */
627  
# Line 636 | Line 661 | cmdline_parser_internal (
661              goto failure;
662          
663            break;
664 <        case 'n':       /* Number of bins.  */
664 >        case 'b':       /* number of bins (general purpose).  */
665          
666          
667            if (update_arg( (void *)&(args_info->nbins_arg),
668                 &(args_info->nbins_orig), &(args_info->nbins_given),
669                &(local_args_info.nbins_given), optarg, 0, "100", ARG_INT,
670                check_ambiguity, override, 0, 0,
671 <              "nbins", 'n',
671 >              "nbins", 'b',
672                additional_error))
673              goto failure;
674          
# Line 717 | Line 742 | cmdline_parser_internal (
742                goto failure;
743            
744            }
745 +          /* number of bins in z axis.  */
746 +          else if (strcmp (long_options[option_index].name, "nbins_z") == 0)
747 +          {
748 +          
749 +          
750 +            if (update_arg( (void *)&(args_info->nbins_z_arg),
751 +                 &(args_info->nbins_z_orig), &(args_info->nbins_z_given),
752 +                &(local_args_info.nbins_z_given), optarg, 0, "100", ARG_INT,
753 +                check_ambiguity, override, 0, 0,
754 +                "nbins_z", '-',
755 +                additional_error))
756 +              goto failure;
757 +          
758 +          }
759 +          /* Threshold Density in g/cm^3.  */
760 +          else if (strcmp (long_options[option_index].name, "threshDens") == 0)
761 +          {
762 +          
763 +          
764 +            if (update_arg( (void *)&(args_info->threshDens_arg),
765 +                 &(args_info->threshDens_orig), &(args_info->threshDens_given),
766 +                &(local_args_info.threshDens_given), optarg, 0, 0, ARG_DOUBLE,
767 +                check_ambiguity, override, 0, 0,
768 +                "threshDens", '-',
769 +                additional_error))
770 +              goto failure;
771 +          
772 +          }
773 +          /* Buffer length in angstroms.  */
774 +          else if (strcmp (long_options[option_index].name, "bufferLength") == 0)
775 +          {
776 +          
777 +          
778 +            if (update_arg( (void *)&(args_info->bufferLength_arg),
779 +                 &(args_info->bufferLength_orig), &(args_info->bufferLength_given),
780 +                &(local_args_info.bufferLength_given), optarg, 0, 0, ARG_DOUBLE,
781 +                check_ambiguity, override, 0, 0,
782 +                "bufferLength", '-',
783 +                additional_error))
784 +              goto failure;
785 +          
786 +          }
787            /* contact angle of selection (using center of mass).  */
788            else if (strcmp (long_options[option_index].name, "ca1") == 0)
789            {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines