--- trunk/src/applications/dump2Xyz/Dump2XYZCmd.c 2005/02/18 23:07:32 369 +++ trunk/src/applications/dump2Xyz/Dump2XYZCmd.c 2005/03/09 17:30:29 413 @@ -40,22 +40,12 @@ cmdline_parser_print_help (void) printf(" -i, --input=filename input dump file\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(" -z, --zconstraint replace the atom types of zconstraint \n molecules (default=off)\n"); printf(" -r, --rigidbody add a pseudo COM atom to rigidbody \n (default=off)\n"); printf(" -t, --watertype replace the atom type of water model \n (default=on)\n"); - printf(" -g, --ignore=atomtype ignore the atom types\n"); - printf(" -s, --selection=selection script selection syntax:\n" - " select DMPC -- select DMPC molecule\n" - " select DMPC.* -- select all atoms and all rigidbodies belong to DMPC molecule(same as above)\n" - " select not DMPC -- select all atoms and all rigidbodies do not belong to DMPC molecule\n" - " select C* and 4 to 7 -- select stuntdoubles which match C* and which index is between [4, 7)\n" - " select 5 -- select stuntdobule whose global index is 5\n" - " select within (5.0, HDP or PO4) -- select stuntdoubles which is within 5 A to HDP or PO4\n" - " select DMPC.3 -- select stuntdouble which internal index is 3\n" - " select DMPC.DMPC_RB_*.* --select atoms belong to rigid body inside DMPC molecule \n"); + printf(" -s, --selection=selection script general selection syntax(now only support \n select atoms within a specified range)\n"); printf(" --originsele=selection script select origin\n"); printf(" --refsele=selection script select reference\n"); printf(" --repeatX=INT The number of images to repeat in the x \n direction (default=`0')\n"); @@ -82,14 +72,6 @@ cmdline_parser (int argc, char * const *argv, struct g cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_info) { int c; /* Character of the parsed option. */ - int i; /* Counter */ - struct ignore_list - { - char * ignore_arg; - struct ignore_list * next; - }; - struct ignore_list * ignore_list = NULL,* ignore_new = NULL; - int missing_required_options = 0; args_info->help_given = 0 ; @@ -97,13 +79,11 @@ cmdline_parser (int argc, char * const *argv, struct g args_info->input_given = 0 ; args_info->output_given = 0 ; args_info->frame_given = 0 ; - args_info->dipole_given = 0 ; args_info->water_given = 0 ; args_info->periodicBox_given = 0 ; args_info->zconstraint_given = 0 ; args_info->rigidbody_given = 0 ; args_info->watertype_given = 0 ; - args_info->ignore_given = 0 ; args_info->selection_given = 0 ; args_info->originsele_given = 0 ; args_info->refsele_given = 0 ; @@ -114,13 +94,11 @@ cmdline_parser (int argc, char * const *argv, struct g args_info->input_arg = NULL; \ args_info->output_arg = NULL; \ args_info->frame_arg = 1 ;\ - args_info->dipole_flag = 0;\ args_info->water_flag = 0;\ args_info->periodicBox_flag = 0;\ args_info->zconstraint_flag = 0;\ args_info->rigidbody_flag = 0;\ args_info->watertype_flag = 1;\ - args_info->ignore_arg = NULL; \ args_info->selection_arg = NULL; \ args_info->originsele_arg = NULL; \ args_info->refsele_arg = NULL; \ @@ -147,13 +125,11 @@ cmdline_parser (int argc, char * const *argv, struct g { "input", 1, NULL, 'i' }, { "output", 1, NULL, 'o' }, { "frame", 1, NULL, 'n' }, - { "dipole", 0, NULL, 'd' }, { "water", 0, NULL, 'w' }, { "periodicBox", 0, NULL, 'm' }, { "zconstraint", 0, NULL, 'z' }, { "rigidbody", 0, NULL, 'r' }, { "watertype", 0, NULL, 't' }, - { "ignore", 1, NULL, 'g' }, { "selection", 1, NULL, 's' }, { "originsele", 1, NULL, 0 }, { "refsele", 1, NULL, 0 }, @@ -164,7 +140,7 @@ cmdline_parser (int argc, char * const *argv, struct g }; stop_char = 0; - c = getopt_long (argc, argv, "hVi:o:n:dwmzrtg:s:", long_options, &option_index); + c = getopt_long (argc, argv, "hVi:o:n:wmzrts:", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ @@ -213,17 +189,6 @@ cmdline_parser (int argc, char * const *argv, struct g args_info->frame_arg = strtol (optarg,&stop_char,0); break; - case 'd': /* print the dipole moments. */ - if (args_info->dipole_given) - { - fprintf (stderr, "%s: `--dipole' (`-d') option given more than once\n", CMDLINE_PARSER_PACKAGE); - clear_args (); - exit (EXIT_FAILURE); - } - args_info->dipole_given = 1; - args_info->dipole_flag = !(args_info->dipole_flag); - break; - case 'w': /* skip the the waters. */ if (args_info->water_given) { @@ -279,14 +244,6 @@ cmdline_parser (int argc, char * const *argv, struct g args_info->watertype_flag = !(args_info->watertype_flag); break; - case 'g': /* ignore the atom types. */ - args_info->ignore_given++; - ignore_new = (struct ignore_list *) malloc (sizeof (struct ignore_list)); - ignore_new->next = ignore_list; - ignore_list = ignore_new; - ignore_new->ignore_arg = gengetopt_strdup (optarg); - break; - case 's': /* general selection syntax(now only support select atoms within a specified range). */ if (args_info->selection_given) { @@ -390,15 +347,5 @@ cmdline_parser (int argc, char * const *argv, struct g if ( missing_required_options ) exit (EXIT_FAILURE); - if (args_info->ignore_given) - { - args_info->ignore_arg = (char * *) malloc (args_info->ignore_given * sizeof (char *)); - for (i = 0; i < args_info->ignore_given; i++) - { - args_info->ignore_arg [i] = ignore_list->ignore_arg; - ignore_list = ignore_list->next; - } - } - return 0; }