ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/applications/staticProps/StaticPropsCmd.c
(Generate patch)

Comparing trunk/OOPSE-4/src/applications/staticProps/StaticPropsCmd.c (file contents):
Revision 2240 by tim, Thu May 26 22:45:00 2005 UTC vs.
Revision 2241 by tim, Fri May 27 04:41:34 2005 UTC

# Line 43 | Line 43 | cmdline_parser_print_help (void)
43    printf("  -r, --nrbins=INT                number of bins for distance  (default=`100')\n");
44    printf("  -a, --nanglebins=INT            number of bins for cos(angle)  (default=\n                                    `50')\n");
45    printf("  -l, --length=DOUBLE             maximum length (Defaults to 1/2 smallest \n                                    length of first frame)\n");
46 <  printf("      --sele1=selection script    select first stuntdouble set\n");
47 <  printf("      --sele2=selection script    select second stuntdouble set\n");
46 >  printf("      --sele1=selection script    select the first stuntdouble set\n");
47 >  printf("      --sele2=selection script    select the second stuntdouble set\n");
48 >  printf("      --sele3=selection script    select the third stuntdouble set\n");
49    printf("      --refsele=selection script  select reference (use and only use with \n                                    --gxyz)\n");
50 +  printf("      --molname=STRING            molecule name\n");
51 +  printf("      --begin=INT                 begin interanl index\n");
52 +  printf("      --end=INT                   end internal index\n");
53    printf("\n");
54    printf(" Group: staticProps  an option of this group is required\n");
55    printf("      --gofr                      g(r)\n");
# Line 53 | Line 57 | cmdline_parser_print_help (void)
57    printf("      --r_omega                   g(r, cos(omega))\n");
58    printf("      --theta_omega               g(cos(theta), cos(omega))\n");
59    printf("      --gxyz                      g(x, y, z)\n");
60 <  printf("      --p2                        p2 order parameter\n");
60 >  printf("      --p2                        p2 order parameter (--sele1 and --sele2 must \n                                    be specified)\n");
61 >  printf("      --scd                       scd order parameter(either --sele1, --sele2, \n                                    --sele3 are specified or --molname, \n                                    --begin, --end are specified)\n");
62   }
63  
64  
# Line 89 | Line 94 | cmdline_parser (int argc, char * const *argv, struct g
94    args_info->length_given = 0 ;
95    args_info->sele1_given = 0 ;
96    args_info->sele2_given = 0 ;
97 +  args_info->sele3_given = 0 ;
98    args_info->refsele_given = 0 ;
99 +  args_info->molname_given = 0 ;
100 +  args_info->begin_given = 0 ;
101 +  args_info->end_given = 0 ;
102    args_info->gofr_given = 0 ;
103    args_info->r_theta_given = 0 ;
104    args_info->r_omega_given = 0 ;
105    args_info->theta_omega_given = 0 ;
106    args_info->gxyz_given = 0 ;
107    args_info->p2_given = 0 ;
108 +  args_info->scd_given = 0 ;
109   #define clear_args() { \
110    args_info->input_arg = NULL; \
111    args_info->output_arg = NULL; \
# Line 104 | Line 114 | cmdline_parser (int argc, char * const *argv, struct g
114    args_info->nanglebins_arg = 50 ;\
115    args_info->sele1_arg = NULL; \
116    args_info->sele2_arg = NULL; \
117 +  args_info->sele3_arg = NULL; \
118    args_info->refsele_arg = NULL; \
119 +  args_info->molname_arg = NULL; \
120   }
121  
122    clear_args();
# Line 130 | Line 142 | cmdline_parser (int argc, char * const *argv, struct g
142          { "length",     1, NULL, 'l' },
143          { "sele1",      1, NULL, 0 },
144          { "sele2",      1, NULL, 0 },
145 +        { "sele3",      1, NULL, 0 },
146          { "refsele",    1, NULL, 0 },
147 +        { "molname",    1, NULL, 0 },
148 +        { "begin",      1, NULL, 0 },
149 +        { "end",        1, NULL, 0 },
150          { "gofr",       0, NULL, 0 },
151          { "r_theta",    0, NULL, 0 },
152          { "r_omega",    0, NULL, 0 },
153          { "theta_omega",        0, NULL, 0 },
154          { "gxyz",       0, NULL, 0 },
155          { "p2", 0, NULL, 0 },
156 +        { "scd",        0, NULL, 0 },
157          { NULL, 0, NULL, 0 }
158        };
159  
# Line 225 | Line 242 | cmdline_parser (int argc, char * const *argv, struct g
242  
243  
244          case 0: /* Long option with no short option */
245 <          /* select first stuntdouble set.  */
245 >          /* select the first stuntdouble set.  */
246            if (strcmp (long_options[option_index].name, "sele1") == 0)
247            {
248              if (args_info->sele1_given)
# Line 239 | Line 256 | cmdline_parser (int argc, char * const *argv, struct g
256              break;
257            }
258            
259 <          /* select second stuntdouble set.  */
259 >          /* select the second stuntdouble set.  */
260            else if (strcmp (long_options[option_index].name, "sele2") == 0)
261            {
262              if (args_info->sele2_given)
# Line 253 | Line 270 | cmdline_parser (int argc, char * const *argv, struct g
270              break;
271            }
272            
273 +          /* select the third stuntdouble set.  */
274 +          else if (strcmp (long_options[option_index].name, "sele3") == 0)
275 +          {
276 +            if (args_info->sele3_given)
277 +              {
278 +                fprintf (stderr, "%s: `--sele3' option given more than once\n", CMDLINE_PARSER_PACKAGE);
279 +                clear_args ();
280 +                exit (EXIT_FAILURE);
281 +              }
282 +            args_info->sele3_given = 1;
283 +            args_info->sele3_arg = gengetopt_strdup (optarg);
284 +            break;
285 +          }
286 +          
287            /* select reference (use and only use with --gxyz).  */
288            else if (strcmp (long_options[option_index].name, "refsele") == 0)
289            {
# Line 267 | Line 298 | cmdline_parser (int argc, char * const *argv, struct g
298              break;
299            }
300            
301 +          /* molecule name.  */
302 +          else if (strcmp (long_options[option_index].name, "molname") == 0)
303 +          {
304 +            if (args_info->molname_given)
305 +              {
306 +                fprintf (stderr, "%s: `--molname' option given more than once\n", CMDLINE_PARSER_PACKAGE);
307 +                clear_args ();
308 +                exit (EXIT_FAILURE);
309 +              }
310 +            args_info->molname_given = 1;
311 +            args_info->molname_arg = gengetopt_strdup (optarg);
312 +            break;
313 +          }
314 +          
315 +          /* begin interanl index.  */
316 +          else if (strcmp (long_options[option_index].name, "begin") == 0)
317 +          {
318 +            if (args_info->begin_given)
319 +              {
320 +                fprintf (stderr, "%s: `--begin' option given more than once\n", CMDLINE_PARSER_PACKAGE);
321 +                clear_args ();
322 +                exit (EXIT_FAILURE);
323 +              }
324 +            args_info->begin_given = 1;
325 +            args_info->begin_arg = strtol (optarg,&stop_char,0);
326 +            break;
327 +          }
328 +          
329 +          /* end internal index.  */
330 +          else if (strcmp (long_options[option_index].name, "end") == 0)
331 +          {
332 +            if (args_info->end_given)
333 +              {
334 +                fprintf (stderr, "%s: `--end' option given more than once\n", CMDLINE_PARSER_PACKAGE);
335 +                clear_args ();
336 +                exit (EXIT_FAILURE);
337 +              }
338 +            args_info->end_given = 1;
339 +            args_info->end_arg = strtol (optarg,&stop_char,0);
340 +            break;
341 +          }
342 +          
343            /* g(r).  */
344            else if (strcmp (long_options[option_index].name, "gofr") == 0)
345            {
# Line 337 | Line 410 | cmdline_parser (int argc, char * const *argv, struct g
410              break;
411            }
412            
413 <          /* p2 order parameter.  */
413 >          /* p2 order parameter (--sele1 and --sele2 must be specified).  */
414            else if (strcmp (long_options[option_index].name, "p2") == 0)
415            {
416              if (args_info->p2_given)
# Line 351 | Line 424 | cmdline_parser (int argc, char * const *argv, struct g
424              break;
425            }
426            
427 +          /* scd order parameter(either --sele1, --sele2, --sele3 are specified or --molname, --begin, --end are specified).  */
428 +          else if (strcmp (long_options[option_index].name, "scd") == 0)
429 +          {
430 +            if (args_info->scd_given)
431 +              {
432 +                fprintf (stderr, "%s: `--scd' option given more than once\n", CMDLINE_PARSER_PACKAGE);
433 +                clear_args ();
434 +                exit (EXIT_FAILURE);
435 +              }
436 +            args_info->scd_given = 1; staticProps_group_counter += 1;
437 +          
438 +            break;
439 +          }
440 +          
441  
442          case '?':       /* Invalid option.  */
443            /* `getopt_long' already printed an error message.  */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines