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

Comparing branches/development/src/applications/staticProps/StaticPropsCmd.cpp (file contents):
Revision 1848 by gezelter, Mon Feb 4 21:13:46 2013 UTC vs.
Revision 1865 by gezelter, Wed Apr 17 18:24:08 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 "StaticPropsCmd.h"
27  
# Line 87 | Line 83 | const char *gengetopt_args_info_help[] = {
83    "      --rodlength               length of nanorod",
84    "  -Q, --tet_param               tetrahedrality order parameter (Qk)",
85    "      --tet_param_z             spatially-resolved tetrahedrality order \n                                  parameter Qk(z)",
86 +  "      --rnemdz                  slab-resolved RNEMD statistics (temperature, \n                                  density, velocity)",
87 +  "      --rnemdr                  shell-resolved RNEMD statistics (temperature, \n                                  density, angular velocity)",
88      0
89   };
90  
# Line 164 | Line 162 | void clear_given (struct gengetopt_args_info *args_inf
162    args_info->rodlength_given = 0 ;
163    args_info->tet_param_given = 0 ;
164    args_info->tet_param_z_given = 0 ;
165 +  args_info->rnemdz_given = 0 ;
166 +  args_info->rnemdr_given = 0 ;
167    args_info->staticProps_group_counter = 0 ;
168   }
169  
# Line 267 | Line 267 | void init_args_info(struct gengetopt_args_info *args_i
267    args_info->rodlength_help = gengetopt_args_info_help[48] ;
268    args_info->tet_param_help = gengetopt_args_info_help[49] ;
269    args_info->tet_param_z_help = gengetopt_args_info_help[50] ;
270 +  args_info->rnemdz_help = gengetopt_args_info_help[51] ;
271 +  args_info->rnemdr_help = gengetopt_args_info_help[52] ;
272    
273   }
274  
# Line 516 | Line 518 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
518      write_into_file(outfile, "tet_param", 0, 0 );
519    if (args_info->tet_param_z_given)
520      write_into_file(outfile, "tet_param_z", 0, 0 );
521 +  if (args_info->rnemdz_given)
522 +    write_into_file(outfile, "rnemdz", 0, 0 );
523 +  if (args_info->rnemdr_given)
524 +    write_into_file(outfile, "rnemdr", 0, 0 );
525    
526  
527    i = EXIT_SUCCESS;
# Line 594 | Line 600 | reset_group_staticProps(struct gengetopt_args_info *ar
600    args_info->rodlength_given = 0 ;
601    args_info->tet_param_given = 0 ;
602    args_info->tet_param_z_given = 0 ;
603 +  args_info->rnemdz_given = 0 ;
604 +  args_info->rnemdr_given = 0 ;
605  
606    args_info->staticProps_group_counter = 0;
607   }
# Line 889 | Line 897 | cmdline_parser_internal (
897          { "rodlength",  0, NULL, 0 },
898          { "tet_param",  0, NULL, 'Q' },
899          { "tet_param_z",        0, NULL, 0 },
900 +        { "rnemdz",     0, NULL, 0 },
901 +        { "rnemdr",     0, NULL, 0 },
902          { 0,  0, 0, 0 }
903        };
904  
# Line 1625 | Line 1635 | cmdline_parser_internal (
1635                  &(local_args_info.tet_param_z_given), optarg, 0, 0, ARG_NO,
1636                  check_ambiguity, override, 0, 0,
1637                  "tet_param_z", '-',
1638 +                additional_error))
1639 +              goto failure;
1640 +          
1641 +          }
1642 +          /* slab-resolved RNEMD statistics (temperature, density, velocity).  */
1643 +          else if (strcmp (long_options[option_index].name, "rnemdz") == 0)
1644 +          {
1645 +          
1646 +            if (args_info->staticProps_group_counter && override)
1647 +              reset_group_staticProps (args_info);
1648 +            args_info->staticProps_group_counter += 1;
1649 +          
1650 +            if (update_arg( 0 ,
1651 +                 0 , &(args_info->rnemdz_given),
1652 +                &(local_args_info.rnemdz_given), optarg, 0, 0, ARG_NO,
1653 +                check_ambiguity, override, 0, 0,
1654 +                "rnemdz", '-',
1655                  additional_error))
1656                goto failure;
1657            
1658            }
1659 +          /* shell-resolved RNEMD statistics (temperature, density, angular velocity).  */
1660 +          else if (strcmp (long_options[option_index].name, "rnemdr") == 0)
1661 +          {
1662            
1663 +            if (args_info->staticProps_group_counter && override)
1664 +              reset_group_staticProps (args_info);
1665 +            args_info->staticProps_group_counter += 1;
1666 +          
1667 +            if (update_arg( 0 ,
1668 +                 0 , &(args_info->rnemdr_given),
1669 +                &(local_args_info.rnemdr_given), optarg, 0, 0, ARG_NO,
1670 +                check_ambiguity, override, 0, 0,
1671 +                "rnemdr", '-',
1672 +                additional_error))
1673 +              goto failure;
1674 +          
1675 +          }
1676 +          
1677            break;
1678          case '?':       /* Invalid option.  */
1679            /* `getopt_long' already printed an error message.  */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines