4 * This source code is part of
8 * GROningen MAchine for Chemical Simulations
12 * Copyright (c) 1991-1999
13 * BIOSON Research Institute, Dept. of Biophysical Chemistry
14 * University of Groningen, The Netherlands
17 * GROMACS: A message-passing parallel molecular dynamics implementation
18 * H.J.C. Berendsen, D. van der Spoel and R. van Drunen
19 * Comp. Phys. Comm. 91, 43-56 (1995)
21 * Also check out our WWW page:
22 * http://md.chem.rug.nl/~gmx
27 * Great Red Oystrich Makes All Chemists Sane
29 static char *SRCID_calcfdev_c = "$Id$";
36 void calc_force(int natom,rvec f[],rvec fff[])
39 int jindex[] = { 0, 5, 10};
43 for(j=0; (j<2); j++) {
45 for(i=jindex[j]; (i<jindex[j+1]); i++) {
46 for(m=0; (m<DIM); m++) {
52 msf1 = iprod(fff[0],fff[0]);
53 msf2 = iprod(fff[1],fff[1]);
55 pr_rvecs(debug,0,"force",f,natom);
57 fprintf(debug,"FMOL: %10.3f %10.3f %10.3f %10.3f %10.3f %10.3f\n",
58 fff[0][XX],fff[0][YY],fff[0][ZZ],fff[1][XX],fff[1][YY],fff[1][ZZ]);
59 fprintf(debug,"RMSF: %10.3e %10.3e\n",msf1,msf2);
64 void calc_f_dev(int natoms,real charge[],rvec x[],rvec f[],
65 t_idef *idef,real *xiH,real *xiS)
67 enum { wwwO, wwwH1, wwwH2, wwwS, wwwNR };
68 int lj_index[wwwNR] = { 0, 4, 4, 8 };
69 real rmsf,dFH,dFS,dFO,dr_14;
70 real q[wwwNR],c6[wwwNR],c12[wwwNR],c12ratio;
74 for(i=0; (i<wwwNR); i++) {
76 c12[i] = idef->iparams[lj_index[i]].lj.c12;
77 c6[i] = idef->iparams[lj_index[i]].lj.c6;
80 calc_force(natoms,f,fff);
85 for(i=0; (i<4); i++) {
86 for(j=4; (j<8); j++) {
88 rvec_sub(x[i],x[j],dx);
90 dr_14 = pow(iprod(dx,dx),-7);
91 c12ratio = -12*sqrt(c12[aj]/c12[i])*dr_14*iprod(fff[0],dx);
110 fprintf(debug,"FFF: dFS=%10.3e, dFH=%10.3e, dFO=%10.3e, rmsf=%10.3e\n",
116 *xiH=rmsf/(10*c12[wwwH1]*dFH);
121 *xiS=rmsf/(10*c12[wwwS]*dFS);