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 1843 by gezelter, Tue Jan 29 20:58:08 2013 UTC vs.
Revision 1953 by gezelter, Thu Dec 5 18:19:26 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 +  "      --rnemdrt                 shell and angle-resolved RNEMD statistics \n                                  (temperature, density, angular velocity)",
93      0
94   };
95  
# Line 160 | Line 167 | void clear_given (struct gengetopt_args_info *args_inf
167    args_info->rodlength_given = 0 ;
168    args_info->tet_param_given = 0 ;
169    args_info->tet_param_z_given = 0 ;
170 +  args_info->rnemdz_given = 0 ;
171 +  args_info->rnemdr_given = 0 ;
172 +  args_info->rnemdrt_given = 0 ;
173    args_info->staticProps_group_counter = 0 ;
174   }
175  
# Line 263 | Line 273 | void init_args_info(struct gengetopt_args_info *args_i
273    args_info->rodlength_help = gengetopt_args_info_help[48] ;
274    args_info->tet_param_help = gengetopt_args_info_help[49] ;
275    args_info->tet_param_z_help = gengetopt_args_info_help[50] ;
276 +  args_info->rnemdz_help = gengetopt_args_info_help[51] ;
277 +  args_info->rnemdr_help = gengetopt_args_info_help[52] ;
278 +  args_info->rnemdrt_help = gengetopt_args_info_help[53] ;
279    
280   }
281  
# Line 512 | Line 525 | cmdline_parser_dump(FILE *outfile, struct gengetopt_ar
525      write_into_file(outfile, "tet_param", 0, 0 );
526    if (args_info->tet_param_z_given)
527      write_into_file(outfile, "tet_param_z", 0, 0 );
528 +  if (args_info->rnemdz_given)
529 +    write_into_file(outfile, "rnemdz", 0, 0 );
530 +  if (args_info->rnemdr_given)
531 +    write_into_file(outfile, "rnemdr", 0, 0 );
532 +  if (args_info->rnemdrt_given)
533 +    write_into_file(outfile, "rnemdrt", 0, 0 );
534    
535  
536    i = EXIT_SUCCESS;
# Line 590 | Line 609 | reset_group_staticProps(struct gengetopt_args_info *ar
609    args_info->rodlength_given = 0 ;
610    args_info->tet_param_given = 0 ;
611    args_info->tet_param_z_given = 0 ;
612 +  args_info->rnemdz_given = 0 ;
613 +  args_info->rnemdr_given = 0 ;
614 +  args_info->rnemdrt_given = 0 ;
615  
616    args_info->staticProps_group_counter = 0;
617   }
# Line 885 | Line 907 | cmdline_parser_internal (
907          { "rodlength",  0, NULL, 0 },
908          { "tet_param",  0, NULL, 'Q' },
909          { "tet_param_z",        0, NULL, 0 },
910 +        { "rnemdz",     0, NULL, 0 },
911 +        { "rnemdr",     0, NULL, 0 },
912 +        { "rnemdrt",    0, NULL, 0 },
913          { 0,  0, 0, 0 }
914        };
915  
# Line 1621 | Line 1646 | cmdline_parser_internal (
1646                  &(local_args_info.tet_param_z_given), optarg, 0, 0, ARG_NO,
1647                  check_ambiguity, override, 0, 0,
1648                  "tet_param_z", '-',
1649 +                additional_error))
1650 +              goto failure;
1651 +          
1652 +          }
1653 +          /* slab-resolved RNEMD statistics (temperature, density, velocity).  */
1654 +          else if (strcmp (long_options[option_index].name, "rnemdz") == 0)
1655 +          {
1656 +          
1657 +            if (args_info->staticProps_group_counter && override)
1658 +              reset_group_staticProps (args_info);
1659 +            args_info->staticProps_group_counter += 1;
1660 +          
1661 +            if (update_arg( 0 ,
1662 +                 0 , &(args_info->rnemdz_given),
1663 +                &(local_args_info.rnemdz_given), optarg, 0, 0, ARG_NO,
1664 +                check_ambiguity, override, 0, 0,
1665 +                "rnemdz", '-',
1666                  additional_error))
1667                goto failure;
1668            
1669            }
1670 +          /* shell-resolved RNEMD statistics (temperature, density, angular velocity).  */
1671 +          else if (strcmp (long_options[option_index].name, "rnemdr") == 0)
1672 +          {
1673            
1674 +            if (args_info->staticProps_group_counter && override)
1675 +              reset_group_staticProps (args_info);
1676 +            args_info->staticProps_group_counter += 1;
1677 +          
1678 +            if (update_arg( 0 ,
1679 +                 0 , &(args_info->rnemdr_given),
1680 +                &(local_args_info.rnemdr_given), optarg, 0, 0, ARG_NO,
1681 +                check_ambiguity, override, 0, 0,
1682 +                "rnemdr", '-',
1683 +                additional_error))
1684 +              goto failure;
1685 +          
1686 +          }
1687 +          /* shell and angle-resolved RNEMD statistics (temperature, density, angular velocity).  */
1688 +          else if (strcmp (long_options[option_index].name, "rnemdrt") == 0)
1689 +          {
1690 +          
1691 +            if (args_info->staticProps_group_counter && override)
1692 +              reset_group_staticProps (args_info);
1693 +            args_info->staticProps_group_counter += 1;
1694 +          
1695 +            if (update_arg( 0 ,
1696 +                 0 , &(args_info->rnemdrt_given),
1697 +                &(local_args_info.rnemdrt_given), optarg, 0, 0, ARG_NO,
1698 +                check_ambiguity, override, 0, 0,
1699 +                "rnemdrt", '-',
1700 +                additional_error))
1701 +              goto failure;
1702 +          
1703 +          }
1704 +          
1705            break;
1706          case '?':       /* Invalid option.  */
1707            /* `getopt_long' already printed an error message.  */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines