Improved version for builds from modified trees.
[gromacs/qmmm-gamess-us.git] / src / mdlib / gmx_qhop_db_test.c
blob8c503c54b710ea7989b2a5e20b34f6554759b19b
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include "gmx_fatal.h"
4 #include "macros.h"
5 #include "gmx_qhop_db.h"
7 int main(int argc,char *argv[])
9 gmx_qhop_db db;
10 char *donors[] = { "H3O+", "ACE" };
11 char *acceptors[] = { "H2O", "GLU" };
12 t_qhop_parameters qp;
13 int i,j;
15 if ((db = gmx_qhop_db_read("ffoplsaa")) == NULL)
16 gmx_fatal(FARGS,"Can not read qhop database information");
17 if (gmx_qhop_db_write("koe.dat",db) != 1)
18 gmx_fatal(FARGS,"Can not write qhop database information");
20 for(i=0; (i<asize(donors)); i++) {
21 for(j=0; (j<asize(acceptors)); j++) {
22 if (gmx_qhop_db_get_parameters(db,donors[i],acceptors[j],&qp) == 1) {
23 printf("Found qhop parameters for donor %s and acceptor %s\n",
24 donors[i],acceptors[j]);
26 else {
27 printf("Could not find qhop parameters for donor %s and acceptor %s\n",
28 donors[i],acceptors[j]);
33 if (gmx_qhop_db_done(db) != 1)
34 gmx_fatal(FARGS,"Error destroying qhop data");
36 return 0;