--- trunk/OOPSE/utils/Dump2XYZCmd.c 2004/04/19 03:52:27 1118 +++ trunk/OOPSE/utils/Dump2XYZCmd.c 2004/04/20 05:39:38 1126 @@ -38,12 +38,14 @@ cmdline_parser_print_help (void) printf(" -h, --help Print help and exit\n"); printf(" -V, --version Print version and exit\n"); printf(" -i, --input=filename input dump file\n"); - printf(" -o, --output=STRING output file name\n"); + printf(" -o, --output=filename output file name\n"); printf(" -n, --frame=INT print every n frame (default=`1')\n"); printf(" -d, --dipole print the dipole moments (default=off)\n"); printf(" -w, --water skip the the waters (default=off)\n"); printf(" -m, --periodicBox map to the periodic box (default=off)\n"); - printf(" -r, --replace replace the atom types of zconstraint molecules \n (default=off)\n"); + printf(" -z, --zconstraint replace the atom types of zconstraint molecules \n (default=off)\n"); + printf(" -r, --rigidbody add a pseudo COM atom to rigidbody (default=off)\n"); + printf(" -t, --watertype replace the atom type of water model (default=on)\n"); printf(" -s, --ignore=atomtype ignore the atom types\n"); printf(" --repeatX=INT The number of images to repeat in the x direction \n (default=`0')\n"); printf(" --repeatY=INT The number of images to repeat in the y direction \n (default=`0')\n"); @@ -87,7 +89,9 @@ cmdline_parser (int argc, char * const *argv, struct g args_info->dipole_given = 0 ; args_info->water_given = 0 ; args_info->periodicBox_given = 0 ; - args_info->replace_given = 0 ; + args_info->zconstraint_given = 0 ; + args_info->rigidbody_given = 0 ; + args_info->watertype_given = 0 ; args_info->ignore_given = 0 ; args_info->repeatX_given = 0 ; args_info->repeatY_given = 0 ; @@ -99,7 +103,9 @@ cmdline_parser (int argc, char * const *argv, struct g args_info->dipole_flag = 0;\ args_info->water_flag = 0;\ args_info->periodicBox_flag = 0;\ - args_info->replace_flag = 0;\ + args_info->zconstraint_flag = 0;\ + args_info->rigidbody_flag = 0;\ + args_info->watertype_flag = 1;\ args_info->ignore_arg = NULL; \ args_info->repeatX_arg = 0 ;\ args_info->repeatY_arg = 0 ;\ @@ -127,7 +133,9 @@ cmdline_parser (int argc, char * const *argv, struct g { "dipole", 0, NULL, 'd' }, { "water", 0, NULL, 'w' }, { "periodicBox", 0, NULL, 'm' }, - { "replace", 0, NULL, 'r' }, + { "zconstraint", 0, NULL, 'z' }, + { "rigidbody", 0, NULL, 'r' }, + { "watertype", 0, NULL, 't' }, { "ignore", 1, NULL, 's' }, { "repeatX", 1, NULL, 0 }, { "repeatY", 1, NULL, 0 }, @@ -136,7 +144,7 @@ cmdline_parser (int argc, char * const *argv, struct g }; stop_char = 0; - c = getopt_long (argc, argv, "hVi:o:n:dwmrs:", long_options, &option_index); + c = getopt_long (argc, argv, "hVi:o:n:dwmzrts:", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ @@ -218,17 +226,39 @@ cmdline_parser (int argc, char * const *argv, struct g args_info->periodicBox_flag = !(args_info->periodicBox_flag); break; - case 'r': /* replace the atom types of zconstraint molecules. */ - if (args_info->replace_given) + case 'z': /* replace the atom types of zconstraint molecules. */ + if (args_info->zconstraint_given) { - fprintf (stderr, "%s: `--replace' (`-r') option given more than once\n", CMDLINE_PARSER_PACKAGE); + fprintf (stderr, "%s: `--zconstraint' (`-z') option given more than once\n", CMDLINE_PARSER_PACKAGE); + clear_args (); + exit (EXIT_FAILURE); + } + args_info->zconstraint_given = 1; + args_info->zconstraint_flag = !(args_info->zconstraint_flag); + break; + + case 'r': /* add a pseudo COM atom to rigidbody. */ + if (args_info->rigidbody_given) + { + fprintf (stderr, "%s: `--rigidbody' (`-r') option given more than once\n", CMDLINE_PARSER_PACKAGE); clear_args (); exit (EXIT_FAILURE); } - args_info->replace_given = 1; - args_info->replace_flag = !(args_info->replace_flag); + args_info->rigidbody_given = 1; + args_info->rigidbody_flag = !(args_info->rigidbody_flag); break; + case 't': /* replace the atom type of water model. */ + if (args_info->watertype_given) + { + fprintf (stderr, "%s: `--watertype' (`-t') option given more than once\n", CMDLINE_PARSER_PACKAGE); + clear_args (); + exit (EXIT_FAILURE); + } + args_info->watertype_given = 1; + args_info->watertype_flag = !(args_info->watertype_flag); + break; + case 's': /* ignore the atom types. */ args_info->ignore_given++; ignore_new = (struct ignore_list *) malloc (sizeof (struct ignore_list));