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

Comparing trunk/src/applications/staticProps/StaticPropsCmd.cpp (file contents):
Revision 1878 by gezelter, Tue Jan 29 20:58:08 2013 UTC vs.
Revision 1879 by gezelter, Sun Jun 16 15:15:42 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
27   #include <getopt.h>
28 + #endif
29  
30   #include "StaticPropsCmd.h"
31  
# Line 83 | Line 87 | const char *gengetopt_args_info_help[] = {
87    "      --rodlength               length of nanorod",
88    "  -Q, --tet_param               tetrahedrality order parameter (Qk)",
89    "      --tet_param_z             spatially-resolved tetrahedrality order \n                                  parameter Qk(z)",
90 +  "      --rnemdz                  slab-resolved RNEMD statistics (temperature, \n                                  density, velocity)",
91 +  "      --rnemdr                  shell-resolved RNEMD statistics (temperature, \n                                  density, angular velocity)",
92      0
93   };
94  
# Line 160 | Line 166 | void clear_given (struct gengetopt_args_info *args_inf
166    args_info->rodlength_given = 0 ;
167    args_info->tet_param_given = 0 ;
168    args_info->tet_param_z_given = 0 ;
169 +  args_info->rnemdz_given = 0 ;
170 +  args_info->rnemdr_given = 0 ;
171    args_info->staticProps_group_counter = 0 ;
172   }
173  
# Line 263 | Line 271 | void init_args_info(struct gengetopt_args_info *args_i
271    args_info->rodlength_help = gengetopt_args_info_help[48] ;
272    args_info->tet_param_help = gengetopt_args_info_help[49] ;
273    args_info->tet_param_z_help = gengetopt_args_info_help[50] ;
274 +  args_info->rnemdz_help = gengetopt_args_info_help[51] ;
275 +  args_info->rnemdr_help = gengetopt_args_info_help[52] ;
276    
277   }
278  
# Line 512 | Line 522 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
522      write_into_file(outfile, "tet_param", 0, 0 );
523    if (args_info->tet_param_z_given)
524      write_into_file(outfile, "tet_param_z", 0, 0 );
525 +  if (args_info->rnemdz_given)
526 +    write_into_file(outfile, "rnemdz", 0, 0 );
527 +  if (args_info->rnemdr_given)
528 +    write_into_file(outfile, "rnemdr", 0, 0 );
529    
530  
531    i = EXIT_SUCCESS;
# Line 590 | Line 604 | reset_group_staticProps(struct gengetopt_args_info *ar
604    args_info->rodlength_given = 0 ;
605    args_info->tet_param_given = 0 ;
606    args_info->tet_param_z_given = 0 ;
607 +  args_info->rnemdz_given = 0 ;
608 +  args_info->rnemdr_given = 0 ;
609  
610    args_info->staticProps_group_counter = 0;
611   }
# Line 885 | Line 901 | cmdline_parser_internal (
901          { "rodlength",  0, NULL, 0 },
902          { "tet_param",  0, NULL, 'Q' },
903          { "tet_param_z",        0, NULL, 0 },
904 +        { "rnemdz",     0, NULL, 0 },
905 +        { "rnemdr",     0, NULL, 0 },
906          { 0,  0, 0, 0 }
907        };
908  
# Line 1621 | Line 1639 | cmdline_parser_internal (
1639                  &(local_args_info.tet_param_z_given), optarg, 0, 0, ARG_NO,
1640                  check_ambiguity, override, 0, 0,
1641                  "tet_param_z", '-',
1642 +                additional_error))
1643 +              goto failure;
1644 +          
1645 +          }
1646 +          /* slab-resolved RNEMD statistics (temperature, density, velocity).  */
1647 +          else if (strcmp (long_options[option_index].name, "rnemdz") == 0)
1648 +          {
1649 +          
1650 +            if (args_info->staticProps_group_counter && override)
1651 +              reset_group_staticProps (args_info);
1652 +            args_info->staticProps_group_counter += 1;
1653 +          
1654 +            if (update_arg( 0 ,
1655 +                 0 , &(args_info->rnemdz_given),
1656 +                &(local_args_info.rnemdz_given), optarg, 0, 0, ARG_NO,
1657 +                check_ambiguity, override, 0, 0,
1658 +                "rnemdz", '-',
1659                  additional_error))
1660                goto failure;
1661            
1662            }
1663 +          /* shell-resolved RNEMD statistics (temperature, density, angular velocity).  */
1664 +          else if (strcmp (long_options[option_index].name, "rnemdr") == 0)
1665 +          {
1666            
1667 +            if (args_info->staticProps_group_counter && override)
1668 +              reset_group_staticProps (args_info);
1669 +            args_info->staticProps_group_counter += 1;
1670 +          
1671 +            if (update_arg( 0 ,
1672 +                 0 , &(args_info->rnemdr_given),
1673 +                &(local_args_info.rnemdr_given), optarg, 0, 0, ARG_NO,
1674 +                check_ambiguity, override, 0, 0,
1675 +                "rnemdr", '-',
1676 +                additional_error))
1677 +              goto failure;
1678 +          
1679 +          }
1680 +          
1681            break;
1682          case '?':       /* Invalid option.  */
1683            /* `getopt_long' already printed an error message.  */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines