3 * This source code is part of
7 * GROningen MAchine for Chemical Simulations
10 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
11 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
12 * Copyright (c) 2001-2004, The GROMACS development team,
13 * check out http://www.gromacs.org for more information.
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version 2
18 * of the License, or (at your option) any later version.
20 * If you want to redistribute modifications, please consider that
21 * scientific software is very special. Version control is crucial -
22 * bugs must be traceable. We will be happy to consider code for
23 * inclusion in the official distribution, but derived work must not
24 * be called official GROMACS. Details are found in the README & COPYING
25 * files - if they are missing, get the official version at www.gromacs.org.
27 * To help us fund GROMACS development, we humbly ask that you cite
28 * the papers on the package - you can find them in the top README file.
30 * For more info, check our website at http://www.gromacs.org
33 * Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
55 int main(int argc
,char *argv
[])
57 static char *desc
[] = {
58 "The ffscan program performs a single point energy and force calculation",
59 "in which the force field is modified. This way a range of parameters can",
60 "be changed and tested for reproduction of e.g. quantum chemical or",
61 "experimental data. A grid scan over the parameters is done as specified",
62 "using command line arguments. All parameters that reproduce the energy",
63 "within a given absolute tolerance are printed to a log file.[PAR]",
64 "Obviously polarizable models can be used, and shell optimisation is",
65 "performed if necessary. Also, like in mdrun table functions can be used",
66 "for user defined potential functions.[PAR]",
67 "If the option -ga with appropriate file is passed, a genetic algorithm will",
68 "be used rather than a grid scan."
71 static t_filenm fnm
[] = {
72 { efTPX
, NULL
, NULL
, ffREAD
},
73 { efLOG
, "-g", "md", ffWRITE
},
74 { efXVG
, "-table", "table", ffOPTRD
},
75 { efDAT
, "-parm", "params", ffREAD
},
76 { efDAT
, "-ga", "genalg", ffOPTRD
},
77 { efGRO
, "-c", "junk", ffWRITE
},
78 { efEDR
, "-e", "junk", ffWRITE
},
79 { efTRN
, "-o", "junk", ffWRITE
}
81 #define NFILE asize(fnm)
83 /* Command line options ! */
84 static t_ffscan ff
= {
99 static char *loadx
=NULL
,*loady
=NULL
,*loadz
=NULL
;
100 static t_pargs pa
[] = {
101 { "-tol", FALSE
, etREAL
, {&ff
.tol
}, "Energy tolerance (kJ/mol) (zero means everything is printed)" },
102 { "-fmax", FALSE
, etREAL
, {&ff
.f_max
}, "Force tolerance (zero means everything is printed)" },
103 { "-comb", FALSE
, etBOOL
, {&ff
.bComb
}, "Use combination rules" },
104 { "-npow", FALSE
, etREAL
, {&ff
.npow
}, "Power for LJ in case of table use" },
105 { "-logeps",FALSE
, etBOOL
, {&ff
.bLogEps
}, "Use a logarithmic scale for epsilon" },
106 { "-v", FALSE
, etBOOL
, {&ff
.bVerbose
}, "Be loud and noisy" },
107 { "-epot", FALSE
, etREAL
, {&ff
.epot
}, "Target energy (kJ/mol)" },
108 { "-fepot", FALSE
, etREAL
, {&ff
.fac_epot
}, "Factor for scaling energy violations (0 turns energy contribution off)" },
109 { "-pres", FALSE
, etREAL
, {&ff
.pres
}, "Value for reference pressure" },
110 { "-fpres", FALSE
, etREAL
, {&ff
.fac_pres
}, "Factor for scaling pressure violations (0 turns pressure contribution off)" },
111 { "-fmsf", FALSE
, etREAL
, {&ff
.fac_msf
}, "Factor for scaling mean square force violations (0 turns MSF contribution off)" },
112 { "-molsize",FALSE
,etINT
, {&ff
.molsize
}, "Number of atoms per molecule" },
113 { "-nmol", FALSE
, etINT
, {&ff
.nmol
}, "Number of molecules (Epot is divided by this value!)" }
115 #define NPA asize(pa)
116 unsigned long Flags
= 0;
120 ivec ddxyz
= { 1,1,1 };
122 cr
= init_par(&argc
,&argv
);
124 ff
.bVerbose
= ff
.bVerbose
&& MASTER(cr
);
131 CopyRight(stderr
,argv
[0]);
133 parse_common_args(&argc
,argv
,PCA_BE_NICE
,NFILE
,fnm
,
134 NPA
,pa
,asize(desc
),desc
,0,NULL
);
137 gmx_fatal(FARGS
,"Can not have repulsion with smaller exponent than 6");
139 gmx_fatal(FARGS
,"Can not fit %d molecules",ff
.nmol
);
141 gmx_log_open(ftp2fn(efLOG
,NFILE
,fnm
),cr
,FALSE
,0,&fplog
);
144 CopyRight(fplog
,argv
[0]);
145 please_cite(fplog
,"Lindahl2001a");
146 please_cite(fplog
,"Berendsen95a");
151 Flags
= (Flags
| MD_FFSCAN
);
153 mdrunner(fplog
,cr
,NFILE
,fnm
,ff
.bVerbose
,FALSE
,
154 ddxyz
,0,0,0,loadx
,loady
,loadz
,1,
156 if (gmx_parallel_env_initialized())
159 gmx_log_close(fplog
);