Revised wording in pdb2gmx.c, hopefully clearer now.
[gromacs/rigid-bodies.git] / src / gmxlib / debugb.h
bloba340dbaaee7f2d57e91eeeddf13597e94eb7893f
1 /*
2 *
3 * This source code is part of
4 *
5 * G R O M A C S
6 *
7 * GROningen MAchine for Chemical Simulations
8 *
9 * VERSION 3.2.0
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
32 * And Hey:
33 * GROningen Mixture of Alchemy and Childrens' Stories
35 #ifndef DEBUG
36 #define DEBUG_BOND(log,x,ai,aj,dx,dr2,dr,bondparams,delta_r,vbond,fbond,fij)
37 #define DEBUG_ANGLE_UPD(log,f_i,f_j,f_k)
38 #define DEBUG_ANGLES(log,x,ai,aj,ak,theta,bondparams,dtheta,fijk,va)
39 #define DEBUG_ANGLE4S(log,x,ai,aj,ak,theta,bondparams,dth1,dth2,dth12,fijk,va)
40 #define DEBUG_DIH_ANGLE(log,xi,xj,xk,xl,r_ij,r_kj,r_kl,m,n,cos_phi,phi,ipr, \
41 sign)
42 #define DEBUG_DIH_FUP(log,i,j,k,l,ddphi,ipr,p,q,r_ij,r_kj,r_kl,m,n,f_i,f_j, \
43 f_k,f_l,uvec,vvec,svec)
44 #define DEBUG_PDIHS(log,ai,aj,ak,al,x,r_ij,r_kj,r_kl,m,n,ph0,cp,mult,mdphi, \
45 ddphi,vpd)
46 #define DEBUG_IDIHS(log,ai,aj,ak,al,x,ph0,cp,dphi,ddphi,vid)
47 #define DEBUG_RBDIHS(log,rbc,ddphi,v)
48 #define DEBUG_POSRES(log,ai,x,pos0,fc,dx,dr2,fi,v)
49 #else
50 #define vlist(v) (v)[0],(v)[1],(v)[2]
51 #define ivlist(i,v) i,(v)[i][0],(v)[i][1],(v)[i][2]
52 #define VECFMT(v) #v"=(%e,%e,%e) "
53 #define IVECFMT(i,v) #i"=%d (%e,%e,%e) "
54 #define INTFMT(i) #i"=%d "
55 #define REALFMT(r) #r"=%e "
56 #define EOLNFMT "\n",
58 #define DEBUG_BOND(log,x,ai,aj,dx,dr2,dr,bondparams,delta_r,vbond,fbond,fij) \
59 fprintf(log,"bonds: " \
60 IVECFMT(ai,x) \
61 IVECFMT(aj,x) \
62 VECFMT (dx) \
63 REALFMT(dr2) \
64 REALFMT(dr) \
65 REALFMT(b0) \
66 REALFMT(cb) \
67 REALFMT(delta_r) \
68 REALFMT(vbond) \
69 REALFMT(fbond) \
70 VECFMT (fij) \
71 EOLNFMT \
72 ivlist(i,x),ivlist(aj,x), \
73 vlist(dx),dr2,dr,bondparams->bonds.b0,bondparams->bonds.cb, \
74 delta_r,vbond,fbond,vlist(fij))
75 #define DEBUG_ANGLE_UPD(log,f_i,f_j,f_k) \
76 fprintf(log,"do_fang_upd: " \
77 VECFMT (f_i) \
78 VECFMT (f_j) \
79 VECFMT (f_k) \
80 EOLNFMT \
81 vlist(f_i),vlist(f_j),vlist(f_k))
82 #define DEBUG_ANGLES(log,x,ai,aj,ak,theta,bondparams,dtheta,fijk,va) \
83 fprintf(log,"angles: " \
84 IVECFMT(ai,x) \
85 IVECFMT(aj,x) \
86 IVECFMT(ak,x) \
87 REALFMT(theta) \
88 REALFMT(th0) \
89 REALFMT(ct) \
90 REALFMT(theta) \
91 REALFMT(fijk) \
92 REALFMT(va) \
93 EOLNFMT \
94 ivlist(ai,x),ivlist(aj,x),ivlist(ak,x),theta, \
95 bondparams->angles.th0,bondparams->angles.ct,dtheta,fijk,va)
96 #define DEBUG_ANGLE4S(log,x,ai,aj,ak,theta,bondparams,dth1,dth2,dth12,fijk,v) \
97 fprintf(log,"angle4s: " \
98 IVECFMT(ai,x) \
99 IVECFMT(aj,x) \
100 IVECFMT(ak,x) \
101 REALFMT(theta) \
102 REALFMT(th0) \
103 REALFMT(ct) \
104 REALFMT(dth1) \
105 REALFMT(dth2) \
106 REALFMT(dth12) \
107 REALFMT(fijk) \
108 REALFMT(va) \
109 EOLNFMT \
110 ai,vlist(x[ai]),aj,vlist(x[aj]),ak,vlist(x[ak]),theta, \
111 bondparams->angles.th0,bondparams->angles.ct,dth1,dth2,dth12,fijk,va)
112 #define DEBUG_DIH_ANGLE(log,xi,xj,xk,xl,r_ij,r_kj,r_kl,m,n,cos_phi,phi,ipr, \
113 sign) \
114 fprintf(log,"dih_angle: " \
115 VECFMT (xi) \
116 VECFMT (xj) \
117 VECFMT (xk) \
118 VECFMT (xl) \
119 VECFMT (r_ij) \
120 VECFMT (r_kj) \
121 VECFMT (r_kl) \
122 VECFMT (m) \
123 VECFMT (n) \
124 REALFMT(cos_phi) \
125 REALFMT(phi) \
126 REALFMT(ipr) \
127 EOLNFMT \
128 vlist(xi),vlist(xj),vlist(xk),vlist(xl), \
129 vlist(r_ij),vlist(r_kj),vlist(r_kl),vlist(m),vlist(n), \
130 *(cos_phi),phi,ipr,*(sign))
131 #define DEBUG_DIH_FUP(log,i,j,k,l,ddphi,ipr,p,q,r_ij,r_kj,r_kl,m,n,f_i,f_j, \
132 f_k,f_l,uvec,vvec,svec) \
133 fprintf(log,"dih_fup: " \
134 INTFMT (i) \
135 INTFMT (j) \
136 INTFMT (k) \
137 INTFMT (l) \
138 REALFMT(ddphi) \
139 REALFMT(ipr) \
140 REALFMT(p) \
141 REALFMT(q) \
142 VECFMT (r_ij) \
143 VECFMT (r_kj) \
144 VECFMT (r_kl) \
145 VECFMT (m) \
146 VECFMT (n) \
147 VECFMT (f_i) \
148 VECFMT (f_j) \
149 VECFMT (f_k) \
150 VECFMT (f_l) \
151 VECFMT (uvec) \
152 VECFMT (vvec) \
153 VECFMT (svec) \
154 EOLNFMT \
155 i,j,k,l,ddphi,ipr,p,q,vlist(r_ij),vlist(r_kj),vlist(r_kl), \
156 vlist(m),vlist(n), \
157 vlist(f_i),vlist(f_j),vlist(f_k),vlist(f_l), \
158 vlist(uvec),vlist(vvec),vlist(svec))
159 #define DEBUG_PDIHS(log,ai,aj,ak,al,x,r_ij,r_kj,r_kl,m,n,ph0,cp,mult,mdphi, \
160 ddphi,vpd) \
161 fprintf(log,"pdihs: " \
162 IVECFMT(ai,x) \
163 IVECFMT(aj,x) \
164 IVECFMT(ak,x) \
165 IVECFMT(al,x) \
166 VECFMT(r_ij) \
167 VECFMT(r_kj) \
168 VECFMT(r_kl) \
169 VECFMT(m) \
170 VECFMT(n) \
171 REALFMT(ph0) \
172 REALFMT(cp) \
173 INTFMT(mult) \
174 REALFMT(mdphi) \
175 REALFMT(ddphi) \
176 REALFMT(vpd) \
177 EOLNFMT \
178 ivlist(ai,x),ivlist(aj,x),ivlist(ak,x),ivlist(al,x),vlist(r_ij), \
179 vlist(r_kj),vlist(r_kl),vlist(m),vlist(n),ph0,cp,mult,mdphi,ddphi, \
180 vpd)
181 #define DEBUG_IDIHS(log,ai,aj,ak,al,x,ph0,cp,dphi,ddphi,vid) \
182 fprintf(log,"idihs: " \
183 IVECFMT(ai,x) \
184 IVECFMT(aj,x) \
185 IVECFMT(ak,x) \
186 IVECFMT(al,x) \
187 REALFMT(ph0) \
188 REALFMT(cp) \
189 REALFMT(dphi) \
190 REALFMT(ddphi) \
191 REALFMT(vid) \
192 EOLNFMT \
193 ivlist(ai,x),ivlist(aj,x),ivlist(ak,x),ivlist(al,x),ph0,cp,dphi, \
194 ddphi,vid)
195 #define DEBUG_RBDIHS(log,rbc,ddphi,v) \
196 fprintf(log,"rbdihs: " \
197 REALFMT(rbc0) \
198 REALFMT(rbc1) \
199 REALFMT(rbc2) \
200 REALFMT(rbc3) \
201 REALFMT(rbc4) \
202 REALFMT(rbc5) \
203 REALFMT(ddphi) \
204 REALFMT(v) \
205 EOLNFMT \
206 (rbc)[0],(rbc)[1],(rbc)[2],(rbc)[3],(rbc)[4],(rbc)[5],ddphi,v)
207 #define DEBUG_POSRES(log,ai,x,pos0,fc,dx,dr2,fi,v) \
208 fprintf(log,"rbdihs: " \
209 IVECFMT(ai,x) \
210 VECFMT(pos0) \
211 REALFMT(fc) \
212 VECFMT(dx) \
213 REALFMT(dr2) \
214 VECFMT(fi) \
215 REALFMT(v) \
216 EOLNFMT \
217 ivlist(ai,x),vlist(pos0),fc,vlist(dx),dr2,vlist(fi),v)
218 #endif