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

Comparing trunk/src/applications/dynamicProps/DynamicPropsCmd.cpp (file contents):
Revision 1879 by gezelter, Sun Jun 16 15:15:42 2013 UTC vs.
Revision 1934 by gezelter, Mon Aug 26 14:15:09 2013 UTC

# Line 21 | Line 21
21   #define FIX_UNUSED(X) (void) (X) /* avoid warnings for unused params */
22   #endif
23  
24 #ifdef WIN32
25 #include "utils/wingetopt.h"
26 #else
24   #include <getopt.h>
28 #endif
25  
26   #include "DynamicPropsCmd.h"
27  
# Line 43 | Line 39 | const char *gengetopt_args_info_help[] = {
39    "      --sele1=selection script  select first stuntdouble set",
40    "      --sele2=selection script  select second stuntdouble set (if sele2 is not \n                                  set, use script from sele1)",
41    "      --order=INT               Lengendre Polynomial Order",
42 +  "  -z, --nzbins=INT              Number of Z bins  (default=`100')",
43    "  -m, --memory=memory specification\n                                Available memory (defaults to 2G)  \n                                  (default=`2G')",
44    "\n Group: dynamicProps\n   an option of this group is required",
45    "  -s, --selecorr                selection correlation function",
# Line 50 | Line 47 | const char *gengetopt_args_info_help[] = {
47    "  -v, --vcorr                   velocity correlation function",
48    "  -d, --dcorr                   dipole correlation function",
49    "  -l, --lcorr                   Lengendre correlation function",
50 +  "      --lcorrZ                  Lengendre correlation function binned by Z",
51 +  "      --cohZ                    Lengendre correlation function for OH bond \n                                  vectors binned by Z",
52    "  -M, --sdcorr                  System dipole correlation function",
53    "      --r_rcorr                 Radial rmsd",
54    "      --thetacorr               Angular rmsd",
# Line 90 | Line 89 | void clear_given (struct gengetopt_args_info *args_inf
89    args_info->sele1_given = 0 ;
90    args_info->sele2_given = 0 ;
91    args_info->order_given = 0 ;
92 +  args_info->nzbins_given = 0 ;
93    args_info->memory_given = 0 ;
94    args_info->selecorr_given = 0 ;
95    args_info->rcorr_given = 0 ;
96    args_info->vcorr_given = 0 ;
97    args_info->dcorr_given = 0 ;
98    args_info->lcorr_given = 0 ;
99 +  args_info->lcorrZ_given = 0 ;
100 +  args_info->cohZ_given = 0 ;
101    args_info->sdcorr_given = 0 ;
102    args_info->r_rcorr_given = 0 ;
103    args_info->thetacorr_given = 0 ;
# Line 119 | Line 121 | void clear_args (struct gengetopt_args_info *args_info
121    args_info->sele2_arg = NULL;
122    args_info->sele2_orig = NULL;
123    args_info->order_orig = NULL;
124 +  args_info->nzbins_arg = 100;
125 +  args_info->nzbins_orig = NULL;
126    args_info->memory_arg = gengetopt_strdup ("2G");
127    args_info->memory_orig = NULL;
128    
# Line 136 | Line 140 | void init_args_info(struct gengetopt_args_info *args_i
140    args_info->sele1_help = gengetopt_args_info_help[4] ;
141    args_info->sele2_help = gengetopt_args_info_help[5] ;
142    args_info->order_help = gengetopt_args_info_help[6] ;
143 <  args_info->memory_help = gengetopt_args_info_help[7] ;
144 <  args_info->selecorr_help = gengetopt_args_info_help[9] ;
145 <  args_info->rcorr_help = gengetopt_args_info_help[10] ;
146 <  args_info->vcorr_help = gengetopt_args_info_help[11] ;
147 <  args_info->dcorr_help = gengetopt_args_info_help[12] ;
148 <  args_info->lcorr_help = gengetopt_args_info_help[13] ;
149 <  args_info->sdcorr_help = gengetopt_args_info_help[14] ;
150 <  args_info->r_rcorr_help = gengetopt_args_info_help[15] ;
151 <  args_info->thetacorr_help = gengetopt_args_info_help[16] ;
152 <  args_info->drcorr_help = gengetopt_args_info_help[17] ;
153 <  args_info->helfandEcorr_help = gengetopt_args_info_help[18] ;
154 <  args_info->momentum_help = gengetopt_args_info_help[19] ;
155 <  args_info->stresscorr_help = gengetopt_args_info_help[20] ;
143 >  args_info->nzbins_help = gengetopt_args_info_help[7] ;
144 >  args_info->memory_help = gengetopt_args_info_help[8] ;
145 >  args_info->selecorr_help = gengetopt_args_info_help[10] ;
146 >  args_info->rcorr_help = gengetopt_args_info_help[11] ;
147 >  args_info->vcorr_help = gengetopt_args_info_help[12] ;
148 >  args_info->dcorr_help = gengetopt_args_info_help[13] ;
149 >  args_info->lcorr_help = gengetopt_args_info_help[14] ;
150 >  args_info->lcorrZ_help = gengetopt_args_info_help[15] ;
151 >  args_info->cohZ_help = gengetopt_args_info_help[16] ;
152 >  args_info->sdcorr_help = gengetopt_args_info_help[17] ;
153 >  args_info->r_rcorr_help = gengetopt_args_info_help[18] ;
154 >  args_info->thetacorr_help = gengetopt_args_info_help[19] ;
155 >  args_info->drcorr_help = gengetopt_args_info_help[20] ;
156 >  args_info->helfandEcorr_help = gengetopt_args_info_help[21] ;
157 >  args_info->momentum_help = gengetopt_args_info_help[22] ;
158 >  args_info->stresscorr_help = gengetopt_args_info_help[23] ;
159    
160   }
161  
# Line 241 | Line 248 | cmdline_parser_release (struct gengetopt_args_info *ar
248    free_string_field (&(args_info->sele2_arg));
249    free_string_field (&(args_info->sele2_orig));
250    free_string_field (&(args_info->order_orig));
251 +  free_string_field (&(args_info->nzbins_orig));
252    free_string_field (&(args_info->memory_arg));
253    free_string_field (&(args_info->memory_orig));
254    
# Line 292 | Line 300 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
300      write_into_file(outfile, "sele2", args_info->sele2_orig, 0);
301    if (args_info->order_given)
302      write_into_file(outfile, "order", args_info->order_orig, 0);
303 +  if (args_info->nzbins_given)
304 +    write_into_file(outfile, "nzbins", args_info->nzbins_orig, 0);
305    if (args_info->memory_given)
306      write_into_file(outfile, "memory", args_info->memory_orig, 0);
307    if (args_info->selecorr_given)
# Line 304 | Line 314 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
314      write_into_file(outfile, "dcorr", 0, 0 );
315    if (args_info->lcorr_given)
316      write_into_file(outfile, "lcorr", 0, 0 );
317 +  if (args_info->lcorrZ_given)
318 +    write_into_file(outfile, "lcorrZ", 0, 0 );
319 +  if (args_info->cohZ_given)
320 +    write_into_file(outfile, "cohZ", 0, 0 );
321    if (args_info->sdcorr_given)
322      write_into_file(outfile, "sdcorr", 0, 0 );
323    if (args_info->r_rcorr_given)
# Line 376 | Line 390 | reset_group_dynamicProps(struct gengetopt_args_info *a
390    args_info->vcorr_given = 0 ;
391    args_info->dcorr_given = 0 ;
392    args_info->lcorr_given = 0 ;
393 +  args_info->lcorrZ_given = 0 ;
394 +  args_info->cohZ_given = 0 ;
395    args_info->sdcorr_given = 0 ;
396    args_info->r_rcorr_given = 0 ;
397    args_info->thetacorr_given = 0 ;
# Line 631 | Line 647 | cmdline_parser_internal (
647          { "sele1",      1, NULL, 0 },
648          { "sele2",      1, NULL, 0 },
649          { "order",      1, NULL, 0 },
650 +        { "nzbins",     1, NULL, 'z' },
651          { "memory",     1, NULL, 'm' },
652          { "selecorr",   0, NULL, 's' },
653          { "rcorr",      0, NULL, 'r' },
654          { "vcorr",      0, NULL, 'v' },
655          { "dcorr",      0, NULL, 'd' },
656          { "lcorr",      0, NULL, 'l' },
657 +        { "lcorrZ",     0, NULL, 0 },
658 +        { "cohZ",       0, NULL, 0 },
659          { "sdcorr",     0, NULL, 'M' },
660          { "r_rcorr",    0, NULL, 0 },
661          { "thetacorr",  0, NULL, 0 },
# Line 647 | Line 666 | cmdline_parser_internal (
666          { 0,  0, 0, 0 }
667        };
668  
669 <      c = getopt_long (argc, argv, "hVi:o:m:srvdlMp", long_options, &option_index);
669 >      c = getopt_long (argc, argv, "hVi:o:z:m:srvdlMp", long_options, &option_index);
670  
671        if (c == -1) break;       /* Exit from `while (1)' loop.  */
672  
# Line 687 | Line 706 | cmdline_parser_internal (
706              goto failure;
707          
708            break;
709 +        case 'z':       /* Number of Z bins.  */
710 +        
711 +        
712 +          if (update_arg( (void *)&(args_info->nzbins_arg),
713 +               &(args_info->nzbins_orig), &(args_info->nzbins_given),
714 +              &(local_args_info.nzbins_given), optarg, 0, "100", ARG_INT,
715 +              check_ambiguity, override, 0, 0,
716 +              "nzbins", 'z',
717 +              additional_error))
718 +            goto failure;
719 +        
720 +          break;
721          case 'm':       /* Available memory (defaults to 2G).  */
722          
723          
# Line 844 | Line 875 | cmdline_parser_internal (
875                  &(local_args_info.order_given), optarg, 0, 0, ARG_INT,
876                  check_ambiguity, override, 0, 0,
877                  "order", '-',
878 +                additional_error))
879 +              goto failure;
880 +          
881 +          }
882 +          /* Lengendre correlation function binned by Z.  */
883 +          else if (strcmp (long_options[option_index].name, "lcorrZ") == 0)
884 +          {
885 +          
886 +            if (args_info->dynamicProps_group_counter && override)
887 +              reset_group_dynamicProps (args_info);
888 +            args_info->dynamicProps_group_counter += 1;
889 +          
890 +            if (update_arg( 0 ,
891 +                 0 , &(args_info->lcorrZ_given),
892 +                &(local_args_info.lcorrZ_given), optarg, 0, 0, ARG_NO,
893 +                check_ambiguity, override, 0, 0,
894 +                "lcorrZ", '-',
895                  additional_error))
896                goto failure;
897            
898            }
899 +          /* Lengendre correlation function for OH bond vectors binned by Z.  */
900 +          else if (strcmp (long_options[option_index].name, "cohZ") == 0)
901 +          {
902 +          
903 +            if (args_info->dynamicProps_group_counter && override)
904 +              reset_group_dynamicProps (args_info);
905 +            args_info->dynamicProps_group_counter += 1;
906 +          
907 +            if (update_arg( 0 ,
908 +                 0 , &(args_info->cohZ_given),
909 +                &(local_args_info.cohZ_given), optarg, 0, 0, ARG_NO,
910 +                check_ambiguity, override, 0, 0,
911 +                "cohZ", '-',
912 +                additional_error))
913 +              goto failure;
914 +          
915 +          }
916            /* Radial rmsd.  */
917            else if (strcmp (long_options[option_index].name, "r_rcorr") == 0)
918            {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines