Fixing copyright issues and code contributors
[alexxy/gromacs.git] / src / gmxlib / debugb.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5  * Copyright (c) 2001-2004, The GROMACS development team,
6  * check out http://www.gromacs.org for more information.
7  * Copyright (c) 2012,2013, by the GROMACS development team, led by
8  * David van der Spoel, Berk Hess, Erik Lindahl, and including many
9  * others, as listed in the AUTHORS file in the top-level source
10  * directory and at http://www.gromacs.org.
11  *
12  * GROMACS is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Lesser General Public License
14  * as published by the Free Software Foundation; either version 2.1
15  * of the License, or (at your option) any later version.
16  *
17  * GROMACS is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  * Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with GROMACS; if not, see
24  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
26  *
27  * If you want to redistribute modifications to GROMACS, please
28  * consider that scientific software is very special. Version
29  * control is crucial - bugs must be traceable. We will be happy to
30  * consider code for inclusion in the official distribution, but
31  * derived work must not be called official GROMACS. Details are found
32  * in the README & COPYING files - if they are missing, get the
33  * official version at http://www.gromacs.org.
34  *
35  * To help us fund GROMACS development, we humbly ask that you cite
36  * the research papers on the package. Check out http://www.gromacs.org.
37  */
38 #ifndef DEBUG
39 #define DEBUG_BOND(log,x,ai,aj,dx,dr2,dr,bondparams,delta_r,vbond,fbond,fij)
40 #define DEBUG_ANGLE_UPD(log,f_i,f_j,f_k)
41 #define DEBUG_ANGLES(log,x,ai,aj,ak,theta,bondparams,dtheta,fijk,va)
42 #define DEBUG_ANGLE4S(log,x,ai,aj,ak,theta,bondparams,dth1,dth2,dth12,fijk,va)
43 #define DEBUG_DIH_ANGLE(log,xi,xj,xk,xl,r_ij,r_kj,r_kl,m,n,cos_phi,phi,ipr, \
44                         sign)
45 #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, \
46                       f_k,f_l,uvec,vvec,svec)
47 #define DEBUG_PDIHS(log,ai,aj,ak,al,x,r_ij,r_kj,r_kl,m,n,ph0,cp,mult,mdphi, \
48                     ddphi,vpd)
49 #define DEBUG_IDIHS(log,ai,aj,ak,al,x,ph0,cp,dphi,ddphi,vid)
50 #define DEBUG_RBDIHS(log,rbc,ddphi,v)
51 #define DEBUG_POSRES(log,ai,x,pos0,fc,dx,dr2,fi,v)
52 #else
53 #define vlist(v)        (v)[0],(v)[1],(v)[2]
54 #define ivlist(i,v)     i,(v)[i][0],(v)[i][1],(v)[i][2]
55 #define VECFMT(v)       #v"=(%e,%e,%e) "
56 #define IVECFMT(i,v)    #i"=%d (%e,%e,%e) "
57 #define INTFMT(i)       #i"=%d "
58 #define REALFMT(r)      #r"=%e "
59 #define EOLNFMT         "\n",
60
61 #define DEBUG_BOND(log,x,ai,aj,dx,dr2,dr,bondparams,delta_r,vbond,fbond,fij) \
62   fprintf(log,"bonds: " \
63           IVECFMT(ai,x) \
64           IVECFMT(aj,x) \
65           VECFMT (dx) \
66           REALFMT(dr2) \
67           REALFMT(dr) \
68           REALFMT(b0) \
69           REALFMT(cb) \
70           REALFMT(delta_r) \
71           REALFMT(vbond) \
72           REALFMT(fbond) \
73           VECFMT (fij) \
74           EOLNFMT \
75           ivlist(i,x),ivlist(aj,x), \
76           vlist(dx),dr2,dr,bondparams->bonds.b0,bondparams->bonds.cb, \
77           delta_r,vbond,fbond,vlist(fij))
78 #define DEBUG_ANGLE_UPD(log,f_i,f_j,f_k) \
79   fprintf(log,"do_fang_upd: " \
80           VECFMT (f_i) \
81           VECFMT (f_j) \
82           VECFMT (f_k) \
83           EOLNFMT \
84           vlist(f_i),vlist(f_j),vlist(f_k))
85 #define DEBUG_ANGLES(log,x,ai,aj,ak,theta,bondparams,dtheta,fijk,va) \
86   fprintf(log,"angles: " \
87           IVECFMT(ai,x) \
88           IVECFMT(aj,x) \
89           IVECFMT(ak,x) \
90           REALFMT(theta) \
91           REALFMT(th0) \
92           REALFMT(ct) \
93           REALFMT(theta) \
94           REALFMT(fijk) \
95           REALFMT(va) \
96           EOLNFMT \
97           ivlist(ai,x),ivlist(aj,x),ivlist(ak,x),theta, \
98           bondparams->angles.th0,bondparams->angles.ct,dtheta,fijk,va)
99 #define DEBUG_ANGLE4S(log,x,ai,aj,ak,theta,bondparams,dth1,dth2,dth12,fijk,v) \
100   fprintf(log,"angle4s: " \
101           IVECFMT(ai,x) \
102           IVECFMT(aj,x) \
103           IVECFMT(ak,x) \
104           REALFMT(theta) \
105           REALFMT(th0) \
106           REALFMT(ct) \
107           REALFMT(dth1) \
108           REALFMT(dth2) \
109           REALFMT(dth12) \
110           REALFMT(fijk) \
111           REALFMT(va) \
112           EOLNFMT \
113           ai,vlist(x[ai]),aj,vlist(x[aj]),ak,vlist(x[ak]),theta, \
114           bondparams->angles.th0,bondparams->angles.ct,dth1,dth2,dth12,fijk,va)
115 #define DEBUG_DIH_ANGLE(log,xi,xj,xk,xl,r_ij,r_kj,r_kl,m,n,cos_phi,phi,ipr, \
116                         sign) \
117   fprintf(log,"dih_angle: " \
118           VECFMT (xi) \
119           VECFMT (xj) \
120           VECFMT (xk) \
121           VECFMT (xl) \
122           VECFMT (r_ij) \
123           VECFMT (r_kj) \
124           VECFMT (r_kl) \
125           VECFMT (m) \
126           VECFMT (n) \
127           REALFMT(cos_phi) \
128           REALFMT(phi) \
129           REALFMT(ipr) \
130           EOLNFMT \
131           vlist(xi),vlist(xj),vlist(xk),vlist(xl), \
132           vlist(r_ij),vlist(r_kj),vlist(r_kl),vlist(m),vlist(n), \
133           *(cos_phi),phi,ipr,*(sign))
134 #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, \
135                       f_k,f_l,uvec,vvec,svec) \
136   fprintf(log,"dih_fup: " \
137           INTFMT (i) \
138           INTFMT (j) \
139           INTFMT (k) \
140           INTFMT (l) \
141           REALFMT(ddphi) \
142           REALFMT(ipr) \
143           REALFMT(p) \
144           REALFMT(q) \
145           VECFMT (r_ij) \
146           VECFMT (r_kj) \
147           VECFMT (r_kl) \
148           VECFMT (m) \
149           VECFMT (n) \
150           VECFMT (f_i) \
151           VECFMT (f_j) \
152           VECFMT (f_k) \
153           VECFMT (f_l) \
154           VECFMT (uvec) \
155           VECFMT (vvec) \
156           VECFMT (svec) \
157           EOLNFMT \
158           i,j,k,l,ddphi,ipr,p,q,vlist(r_ij),vlist(r_kj),vlist(r_kl), \
159           vlist(m),vlist(n), \
160           vlist(f_i),vlist(f_j),vlist(f_k),vlist(f_l), \
161           vlist(uvec),vlist(vvec),vlist(svec))
162 #define DEBUG_PDIHS(log,ai,aj,ak,al,x,r_ij,r_kj,r_kl,m,n,ph0,cp,mult,mdphi, \
163                     ddphi,vpd) \
164   fprintf(log,"pdihs: " \
165           IVECFMT(ai,x) \
166           IVECFMT(aj,x) \
167           IVECFMT(ak,x) \
168           IVECFMT(al,x) \
169           VECFMT(r_ij) \
170           VECFMT(r_kj) \
171           VECFMT(r_kl) \
172           VECFMT(m) \
173           VECFMT(n) \
174           REALFMT(ph0) \
175           REALFMT(cp) \
176           INTFMT(mult) \
177           REALFMT(mdphi) \
178           REALFMT(ddphi) \
179           REALFMT(vpd) \
180           EOLNFMT \
181           ivlist(ai,x),ivlist(aj,x),ivlist(ak,x),ivlist(al,x),vlist(r_ij), \
182           vlist(r_kj),vlist(r_kl),vlist(m),vlist(n),ph0,cp,mult,mdphi,ddphi, \
183           vpd)
184 #define DEBUG_IDIHS(log,ai,aj,ak,al,x,ph0,cp,dphi,ddphi,vid) \
185   fprintf(log,"idihs: " \
186           IVECFMT(ai,x) \
187           IVECFMT(aj,x) \
188           IVECFMT(ak,x) \
189           IVECFMT(al,x) \
190           REALFMT(ph0) \
191           REALFMT(cp) \
192           REALFMT(dphi) \
193           REALFMT(ddphi) \
194           REALFMT(vid) \
195           EOLNFMT \
196           ivlist(ai,x),ivlist(aj,x),ivlist(ak,x),ivlist(al,x),ph0,cp,dphi, \
197           ddphi,vid)
198 #define DEBUG_RBDIHS(log,rbc,ddphi,v) \
199   fprintf(log,"rbdihs: " \
200           REALFMT(rbc0) \
201           REALFMT(rbc1) \
202           REALFMT(rbc2) \
203           REALFMT(rbc3) \
204           REALFMT(rbc4) \
205           REALFMT(rbc5) \
206           REALFMT(ddphi) \
207           REALFMT(v) \
208           EOLNFMT \
209           (rbc)[0],(rbc)[1],(rbc)[2],(rbc)[3],(rbc)[4],(rbc)[5],ddphi,v)
210 #define DEBUG_POSRES(log,ai,x,pos0,fc,dx,dr2,fi,v) \
211   fprintf(log,"rbdihs: " \
212           IVECFMT(ai,x) \
213           VECFMT(pos0) \
214           REALFMT(fc) \
215           VECFMT(dx) \
216           REALFMT(dr2) \
217           VECFMT(fi) \
218           REALFMT(v) \
219           EOLNFMT \
220           ivlist(ai,x),vlist(pos0),fc,vlist(dx),dr2,vlist(fi),v)
221 #endif