35 |
|
printf("\n" |
36 |
|
"Usage: %s [OPTIONS]...\n", CMDLINE_PARSER_PACKAGE); |
37 |
|
printf("\n"); |
38 |
< |
printf(" -h, --help Print help and exit\n"); |
39 |
< |
printf(" -V, --version Print version and exit\n"); |
40 |
< |
printf(" -i, --input=filename input dump file\n"); |
41 |
< |
printf(" -o, --output=filename output file name\n"); |
42 |
< |
printf(" -n, --frame=INT print every n frame (default=`1')\n"); |
43 |
< |
printf(" -d, --dipole print the dipole moments (default=off)\n"); |
44 |
< |
printf(" -w, --water skip the the waters (default=off)\n"); |
45 |
< |
printf(" -m, --periodicBox map to the periodic box (default=off)\n"); |
46 |
< |
printf(" -z, --zconstraint replace the atom types of zconstraint \n molecules (default=off)\n"); |
47 |
< |
printf(" -r, --rigidbody add a pseudo COM atom to rigidbody \n (default=off)\n"); |
48 |
< |
printf(" -t, --watertype replace the atom type of water model \n (default=on)\n"); |
49 |
< |
printf(" -g, --ignore=atomtype ignore the atom types\n"); |
50 |
< |
printf(" -s, --selection=selection script selection syntax:\n" |
51 |
< |
" select DMPC -- select DMPC molecule\n" |
52 |
< |
" select DMPC.* -- select all atoms and all rigidbodies belong to DMPC molecule(same as above)\n" |
53 |
< |
" select not DMPC -- select all atoms and all rigidbodies do not belong to DMPC molecule\n" |
54 |
< |
" select C* and 4 to 7 -- select stuntdoubles which match C* and which index is between [4, 7)\n" |
55 |
< |
" select 5 -- select stuntdobule whose global index is 5\n" |
56 |
< |
" select within (5.0, HDP or PO4) -- select stuntdoubles which is within 5 A to HDP or PO4\n" |
38 |
> |
printf(" -h, --help Print help and exit\n"); |
39 |
> |
printf(" -V, --version Print version and exit\n"); |
40 |
> |
printf(" -i, --input=filename input dump file\n"); |
41 |
> |
printf(" -o, --output=filename output file name\n"); |
42 |
> |
printf(" -n, --frame=INT print every n frame (default=`1')\n"); |
43 |
> |
printf(" -d, --dipole print the dipole moments (default=off)\n"); |
44 |
> |
printf(" -w, --water skip the the waters (default=off)\n"); |
45 |
> |
printf(" -m, --periodicBox map to the periodic box (default=off)\n"); |
46 |
> |
printf(" -z, --zconstraint replace the atom types of zconstraint \n molecules (default=off)\n"); |
47 |
> |
printf(" -r, --rigidbody add a pseudo COM atom to rigidbody \n (default=off)\n"); |
48 |
> |
printf(" -t, --watertype replace the atom type of water model \n (default=on)\n"); |
49 |
> |
printf(" -g, --ignore=atomtype ignore the atom types\n"); |
50 |
> |
printf(" -s, --selection=selection script selection syntax:\n" |
51 |
> |
" select DMPC -- select DMPC molecule\n" |
52 |
> |
" select DMPC.* -- select all atoms and all rigidbodies belong to DMPC molecule(same as above)\n" |
53 |
> |
" select not DMPC -- select all atoms and all rigidbodies do not belong to DMPC molecule\n" |
54 |
> |
" select C* and 4 to 7 -- select stuntdoubles which match C* and which index is between [4, 7)\n" |
55 |
> |
" select 5 -- select stuntdobule whose global index is 5\n" |
56 |
> |
" select within (5.0, HDP or PO4) -- select stuntdoubles which is within 5 A to HDP or PO4\n" |
57 |
> |
" select DMPC.3 -- select stuntdouble which internal index is 3\n" |
58 |
|
" select DMPC.DMPC_RB_*.* --select atoms belong to rigid body inside DMPC molecule \n"); |
59 |
< |
printf(" --repeatX=INT The number of images to repeat in the x \n direction (default=`0')\n"); |
60 |
< |
printf(" --repeatY=INT The number of images to repeat in the y \n direction (default=`0')\n"); |
61 |
< |
printf(" --repeatZ=INT The number of images to repeat in the z \n direction (default=`0')\n"); |
59 |
> |
printf(" --originsele=selection script select origin\n"); |
60 |
> |
printf(" --refsele=selection script select reference\n"); |
61 |
> |
printf(" --repeatX=INT The number of images to repeat in the x \n direction (default=`0')\n"); |
62 |
> |
printf(" --repeatY=INT The number of images to repeat in the y \n direction (default=`0')\n"); |
63 |
> |
printf(" --repeatZ=INT The number of images to repeat in the z \n direction (default=`0')\n"); |
64 |
|
} |
65 |
|
|
66 |
|
|
105 |
|
args_info->watertype_given = 0 ; |
106 |
|
args_info->ignore_given = 0 ; |
107 |
|
args_info->selection_given = 0 ; |
108 |
+ |
args_info->originsele_given = 0 ; |
109 |
+ |
args_info->refsele_given = 0 ; |
110 |
|
args_info->repeatX_given = 0 ; |
111 |
|
args_info->repeatY_given = 0 ; |
112 |
|
args_info->repeatZ_given = 0 ; |
122 |
|
args_info->watertype_flag = 1;\ |
123 |
|
args_info->ignore_arg = NULL; \ |
124 |
|
args_info->selection_arg = NULL; \ |
125 |
+ |
args_info->originsele_arg = NULL; \ |
126 |
+ |
args_info->refsele_arg = NULL; \ |
127 |
|
args_info->repeatX_arg = 0 ;\ |
128 |
|
args_info->repeatY_arg = 0 ;\ |
129 |
|
args_info->repeatZ_arg = 0 ;\ |
155 |
|
{ "watertype", 0, NULL, 't' }, |
156 |
|
{ "ignore", 1, NULL, 'g' }, |
157 |
|
{ "selection", 1, NULL, 's' }, |
158 |
+ |
{ "originsele", 1, NULL, 0 }, |
159 |
+ |
{ "refsele", 1, NULL, 0 }, |
160 |
|
{ "repeatX", 1, NULL, 0 }, |
161 |
|
{ "repeatY", 1, NULL, 0 }, |
162 |
|
{ "repeatZ", 1, NULL, 0 }, |
287 |
|
ignore_new->ignore_arg = gengetopt_strdup (optarg); |
288 |
|
break; |
289 |
|
|
290 |
< |
case 's': /* general selection syntax:\n |
282 |
< |
select DMPC -- select DMPC molecule\n \ |
283 |
< |
select DMPC.* -- select all atoms and all rigidbodies belong to DMPC molecule\n \ |
284 |
< |
select 5 -- select stuntdobule whose global index is 5\n \ |
285 |
< |
select within (5.0, HDP or PO4) -- select stuntdoubles which is within 5 A to HDP or PO4\n \ |
286 |
< |
select DMPC.DMPC_RB_*.* --select atoms belong to rigid body inside DMPC molecule . */ |
290 |
> |
case 's': /* general selection syntax(now only support select atoms within a specified range). */ |
291 |
|
if (args_info->selection_given) |
292 |
|
{ |
293 |
|
fprintf (stderr, "%s: `--selection' (`-s') option given more than once\n", CMDLINE_PARSER_PACKAGE); |
300 |
|
|
301 |
|
|
302 |
|
case 0: /* Long option with no short option */ |
303 |
+ |
/* select origin. */ |
304 |
+ |
if (strcmp (long_options[option_index].name, "originsele") == 0) |
305 |
+ |
{ |
306 |
+ |
if (args_info->originsele_given) |
307 |
+ |
{ |
308 |
+ |
fprintf (stderr, "%s: `--originsele' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
309 |
+ |
clear_args (); |
310 |
+ |
exit (EXIT_FAILURE); |
311 |
+ |
} |
312 |
+ |
args_info->originsele_given = 1; |
313 |
+ |
args_info->originsele_arg = gengetopt_strdup (optarg); |
314 |
+ |
break; |
315 |
+ |
} |
316 |
+ |
|
317 |
+ |
/* select reference. */ |
318 |
+ |
else if (strcmp (long_options[option_index].name, "refsele") == 0) |
319 |
+ |
{ |
320 |
+ |
if (args_info->refsele_given) |
321 |
+ |
{ |
322 |
+ |
fprintf (stderr, "%s: `--refsele' option given more than once\n", CMDLINE_PARSER_PACKAGE); |
323 |
+ |
clear_args (); |
324 |
+ |
exit (EXIT_FAILURE); |
325 |
+ |
} |
326 |
+ |
args_info->refsele_given = 1; |
327 |
+ |
args_info->refsele_arg = gengetopt_strdup (optarg); |
328 |
+ |
break; |
329 |
+ |
} |
330 |
+ |
|
331 |
|
/* The number of images to repeat in the x direction. */ |
332 |
< |
if (strcmp (long_options[option_index].name, "repeatX") == 0) |
332 |
> |
else if (strcmp (long_options[option_index].name, "repeatX") == 0) |
333 |
|
{ |
334 |
|
if (args_info->repeatX_given) |
335 |
|
{ |