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 2081 by gezelter, Tue Mar 17 18:22:18 2015 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 >  "  -x, --centroidX=DOUBLE        Location of droplet centroid in x",
48 >  "  -y, --centroidY=DOUBLE        Location of droplet centroid in y",
49    "  -z, --referenceZ=DOUBLE       Reference z-height of solid surface",
50    "  -r, --dropletR=DOUBLE         Droplet radius in angstroms",
51 +  "      --threshDens=DOUBLE       Threshold Density in g/cm^3",
52 +  "      --bufferLength=DOUBLE     Buffer length in angstroms",
53    "\n Group: sequentialProps\n   an option of this group is required",
54    "  -c, --com                     selection center of mass",
55    "      --ca1                     contact angle of selection (using center of \n                                  mass)",
# Line 83 | Line 88 | void clear_given (struct gengetopt_args_info *args_inf
88    args_info->sele1_given = 0 ;
89    args_info->sele2_given = 0 ;
90    args_info->nbins_given = 0 ;
91 +  args_info->nbins_z_given = 0 ;
92 +  args_info->centroidX_given = 0 ;
93 +  args_info->centroidY_given = 0 ;
94    args_info->referenceZ_given = 0 ;
95    args_info->dropletR_given = 0 ;
96 +  args_info->threshDens_given = 0 ;
97 +  args_info->bufferLength_given = 0 ;
98    args_info->com_given = 0 ;
99    args_info->ca1_given = 0 ;
100    args_info->ca2_given = 0 ;
# Line 105 | Line 115 | void clear_args (struct gengetopt_args_info *args_info
115    args_info->sele2_orig = NULL;
116    args_info->nbins_arg = 100;
117    args_info->nbins_orig = NULL;
118 +  args_info->nbins_z_arg = 100;
119 +  args_info->nbins_z_orig = NULL;
120 +  args_info->centroidX_orig = NULL;
121 +  args_info->centroidY_orig = NULL;
122    args_info->referenceZ_orig = NULL;
123    args_info->dropletR_orig = NULL;
124 +  args_info->threshDens_orig = NULL;
125 +  args_info->bufferLength_orig = NULL;
126    
127   }
128  
# Line 122 | Line 138 | void init_args_info(struct gengetopt_args_info *args_i
138    args_info->sele1_help = gengetopt_args_info_help[4] ;
139    args_info->sele2_help = gengetopt_args_info_help[5] ;
140    args_info->nbins_help = gengetopt_args_info_help[6] ;
141 <  args_info->referenceZ_help = gengetopt_args_info_help[7] ;
142 <  args_info->dropletR_help = gengetopt_args_info_help[8] ;
143 <  args_info->com_help = gengetopt_args_info_help[10] ;
144 <  args_info->ca1_help = gengetopt_args_info_help[11] ;
145 <  args_info->ca2_help = gengetopt_args_info_help[12] ;
141 >  args_info->nbins_z_help = gengetopt_args_info_help[7] ;
142 >  args_info->centroidX_help = gengetopt_args_info_help[8] ;
143 >  args_info->centroidY_help = gengetopt_args_info_help[9] ;
144 >  args_info->referenceZ_help = gengetopt_args_info_help[10] ;
145 >  args_info->dropletR_help = gengetopt_args_info_help[11] ;
146 >  args_info->threshDens_help = gengetopt_args_info_help[12] ;
147 >  args_info->bufferLength_help = gengetopt_args_info_help[13] ;
148 >  args_info->com_help = gengetopt_args_info_help[15] ;
149 >  args_info->ca1_help = gengetopt_args_info_help[16] ;
150 >  args_info->ca2_help = gengetopt_args_info_help[17] ;
151    
152   }
153  
# Line 219 | Line 240 | cmdline_parser_release (struct gengetopt_args_info *ar
240    free_string_field (&(args_info->sele2_arg));
241    free_string_field (&(args_info->sele2_orig));
242    free_string_field (&(args_info->nbins_orig));
243 +  free_string_field (&(args_info->nbins_z_orig));
244 +  free_string_field (&(args_info->centroidX_orig));
245 +  free_string_field (&(args_info->centroidY_orig));
246    free_string_field (&(args_info->referenceZ_orig));
247    free_string_field (&(args_info->dropletR_orig));
248 +  free_string_field (&(args_info->threshDens_orig));
249 +  free_string_field (&(args_info->bufferLength_orig));
250    
251    
252    for (i = 0; i < args_info->inputs_num; ++i)
# Line 270 | Line 296 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
296      write_into_file(outfile, "sele2", args_info->sele2_orig, 0);
297    if (args_info->nbins_given)
298      write_into_file(outfile, "nbins", args_info->nbins_orig, 0);
299 +  if (args_info->nbins_z_given)
300 +    write_into_file(outfile, "nbins_z", args_info->nbins_z_orig, 0);
301 +  if (args_info->centroidX_given)
302 +    write_into_file(outfile, "centroidX", args_info->centroidX_orig, 0);
303 +  if (args_info->centroidY_given)
304 +    write_into_file(outfile, "centroidY", args_info->centroidY_orig, 0);
305    if (args_info->referenceZ_given)
306      write_into_file(outfile, "referenceZ", args_info->referenceZ_orig, 0);
307    if (args_info->dropletR_given)
308      write_into_file(outfile, "dropletR", args_info->dropletR_orig, 0);
309 +  if (args_info->threshDens_given)
310 +    write_into_file(outfile, "threshDens", args_info->threshDens_orig, 0);
311 +  if (args_info->bufferLength_given)
312 +    write_into_file(outfile, "bufferLength", args_info->bufferLength_orig, 0);
313    if (args_info->com_given)
314      write_into_file(outfile, "com", 0, 0 );
315    if (args_info->ca1_given)
# Line 587 | Line 623 | cmdline_parser_internal (
623          { "output",     1, NULL, 'o' },
624          { "sele1",      1, NULL, 0 },
625          { "sele2",      1, NULL, 0 },
626 <        { "nbins",      1, NULL, 'n' },
626 >        { "nbins",      1, NULL, 'b' },
627 >        { "nbins_z",    1, NULL, 0 },
628 >        { "centroidX",  1, NULL, 'x' },
629 >        { "centroidY",  1, NULL, 'y' },
630          { "referenceZ", 1, NULL, 'z' },
631          { "dropletR",   1, NULL, 'r' },
632 +        { "threshDens", 1, NULL, 0 },
633 +        { "bufferLength",       1, NULL, 0 },
634          { "com",        0, NULL, 'c' },
635          { "ca1",        0, NULL, 0 },
636          { "ca2",        0, NULL, 0 },
637          { 0,  0, 0, 0 }
638        };
639  
640 <      c = getopt_long (argc, argv, "hVi:o:n:z:r:c", long_options, &option_index);
640 >      c = getopt_long (argc, argv, "hVi:o:b:x:y:z:r:c", long_options, &option_index);
641  
642        if (c == -1) break;       /* Exit from `while (1)' loop.  */
643  
# Line 636 | Line 677 | cmdline_parser_internal (
677              goto failure;
678          
679            break;
680 <        case 'n':       /* Number of bins.  */
680 >        case 'b':       /* number of bins (general purpose).  */
681          
682          
683            if (update_arg( (void *)&(args_info->nbins_arg),
684                 &(args_info->nbins_orig), &(args_info->nbins_given),
685                &(local_args_info.nbins_given), optarg, 0, "100", ARG_INT,
686                check_ambiguity, override, 0, 0,
687 <              "nbins", 'n',
687 >              "nbins", 'b',
688                additional_error))
689              goto failure;
690          
691            break;
692 +        case 'x':       /* Location of droplet centroid in x.  */
693 +        
694 +        
695 +          if (update_arg( (void *)&(args_info->centroidX_arg),
696 +               &(args_info->centroidX_orig), &(args_info->centroidX_given),
697 +              &(local_args_info.centroidX_given), optarg, 0, 0, ARG_DOUBLE,
698 +              check_ambiguity, override, 0, 0,
699 +              "centroidX", 'x',
700 +              additional_error))
701 +            goto failure;
702 +        
703 +          break;
704 +        case 'y':       /* Location of droplet centroid in y.  */
705 +        
706 +        
707 +          if (update_arg( (void *)&(args_info->centroidY_arg),
708 +               &(args_info->centroidY_orig), &(args_info->centroidY_given),
709 +              &(local_args_info.centroidY_given), optarg, 0, 0, ARG_DOUBLE,
710 +              check_ambiguity, override, 0, 0,
711 +              "centroidY", 'y',
712 +              additional_error))
713 +            goto failure;
714 +        
715 +          break;
716          case 'z':       /* Reference z-height of solid surface.  */
717          
718          
# Line 717 | Line 782 | cmdline_parser_internal (
782                goto failure;
783            
784            }
785 +          /* number of bins in z axis.  */
786 +          else if (strcmp (long_options[option_index].name, "nbins_z") == 0)
787 +          {
788 +          
789 +          
790 +            if (update_arg( (void *)&(args_info->nbins_z_arg),
791 +                 &(args_info->nbins_z_orig), &(args_info->nbins_z_given),
792 +                &(local_args_info.nbins_z_given), optarg, 0, "100", ARG_INT,
793 +                check_ambiguity, override, 0, 0,
794 +                "nbins_z", '-',
795 +                additional_error))
796 +              goto failure;
797 +          
798 +          }
799 +          /* Threshold Density in g/cm^3.  */
800 +          else if (strcmp (long_options[option_index].name, "threshDens") == 0)
801 +          {
802 +          
803 +          
804 +            if (update_arg( (void *)&(args_info->threshDens_arg),
805 +                 &(args_info->threshDens_orig), &(args_info->threshDens_given),
806 +                &(local_args_info.threshDens_given), optarg, 0, 0, ARG_DOUBLE,
807 +                check_ambiguity, override, 0, 0,
808 +                "threshDens", '-',
809 +                additional_error))
810 +              goto failure;
811 +          
812 +          }
813 +          /* Buffer length in angstroms.  */
814 +          else if (strcmp (long_options[option_index].name, "bufferLength") == 0)
815 +          {
816 +          
817 +          
818 +            if (update_arg( (void *)&(args_info->bufferLength_arg),
819 +                 &(args_info->bufferLength_orig), &(args_info->bufferLength_given),
820 +                &(local_args_info.bufferLength_given), optarg, 0, 0, ARG_DOUBLE,
821 +                check_ambiguity, override, 0, 0,
822 +                "bufferLength", '-',
823 +                additional_error))
824 +              goto failure;
825 +          
826 +          }
827            /* contact angle of selection (using center of mass).  */
828            else if (strcmp (long_options[option_index].name, "ca1") == 0)
829            {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines