069758133851adc0a9fa4d1d3c0ad9ffa035ddbf
[alexxy/gromacs.git] / src / gmxlib / nonbonded / nb_kernel_c / nb_kernel_ElecEw_VdwLJ_GeomW3W3_c.c
1 /*
2  * Note: this file was generated by the Gromacs c kernel generator.
3  *
4  *                This source code is part of
5  *
6  *                 G   R   O   M   A   C   S
7  *
8  * Copyright (c) 2001-2012, The GROMACS Development Team
9  *
10  * Gromacs is a library for molecular simulation and trajectory analysis,
11  * written by Erik Lindahl, David van der Spoel, Berk Hess, and others - for
12  * a full list of developers and information, check out http://www.gromacs.org
13  *
14  * This program is free software; you can redistribute it and/or modify it under
15  * the terms of the GNU Lesser General Public License as published by the Free
16  * Software Foundation; either version 2 of the License, or (at your option) any
17  * later version.
18  *
19  * To help fund GROMACS development, we humbly ask that you cite
20  * the papers people have written on it - you can find them on the website.
21  */
22 #ifdef HAVE_CONFIG_H
23 #include <config.h>
24 #endif
25
26 #include <math.h>
27
28 #include "../nb_kernel.h"
29 #include "types/simple.h"
30 #include "vec.h"
31 #include "nrnb.h"
32
33 /*
34  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwLJ_GeomW3W3_VF_c
35  * Electrostatics interaction: Ewald
36  * VdW interaction:            LennardJones
37  * Geometry:                   Water3-Water3
38  * Calculate force/pot:        PotentialAndForce
39  */
40 void
41 nb_kernel_ElecEw_VdwLJ_GeomW3W3_VF_c
42                     (t_nblist * gmx_restrict                nlist,
43                      rvec * gmx_restrict                    xx,
44                      rvec * gmx_restrict                    ff,
45                      t_forcerec * gmx_restrict              fr,
46                      t_mdatoms * gmx_restrict               mdatoms,
47                      nb_kernel_data_t * gmx_restrict        kernel_data,
48                      t_nrnb * gmx_restrict                  nrnb)
49 {
50     int              i_shift_offset,i_coord_offset,j_coord_offset;
51     int              j_index_start,j_index_end;
52     int              nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
53     real             shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
54     int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
55     real             *shiftvec,*fshift,*x,*f;
56     int              vdwioffset0;
57     real             ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
58     int              vdwioffset1;
59     real             ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
60     int              vdwioffset2;
61     real             ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
62     int              vdwjidx0;
63     real             jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
64     int              vdwjidx1;
65     real             jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
66     int              vdwjidx2;
67     real             jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
68     real             dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
69     real             dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01,cexp1_01,cexp2_01;
70     real             dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02,cexp1_02,cexp2_02;
71     real             dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
72     real             dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
73     real             dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
74     real             dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
75     real             dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
76     real             dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
77     real             velec,felec,velecsum,facel,crf,krf,krf2;
78     real             *charge;
79     int              nvdwtype;
80     real             rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
81     int              *vdwtype;
82     real             *vdwparam;
83     int              ewitab;
84     real             ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace;
85     real             *ewtab;
86
87     x                = xx[0];
88     f                = ff[0];
89
90     nri              = nlist->nri;
91     iinr             = nlist->iinr;
92     jindex           = nlist->jindex;
93     jjnr             = nlist->jjnr;
94     shiftidx         = nlist->shift;
95     gid              = nlist->gid;
96     shiftvec         = fr->shift_vec[0];
97     fshift           = fr->fshift[0];
98     facel            = fr->epsfac;
99     charge           = mdatoms->chargeA;
100     nvdwtype         = fr->ntype;
101     vdwparam         = fr->nbfp;
102     vdwtype          = mdatoms->typeA;
103
104     sh_ewald         = fr->ic->sh_ewald;
105     ewtab            = fr->ic->tabq_coul_FDV0;
106     ewtabscale       = fr->ic->tabq_scale;
107     ewtabhalfspace   = 0.5/ewtabscale;
108
109     /* Setup water-specific parameters */
110     inr              = nlist->iinr[0];
111     iq0              = facel*charge[inr+0];
112     iq1              = facel*charge[inr+1];
113     iq2              = facel*charge[inr+2];
114     vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
115
116     jq0              = charge[inr+0];
117     jq1              = charge[inr+1];
118     jq2              = charge[inr+2];
119     vdwjidx0         = 2*vdwtype[inr+0];
120     qq00             = iq0*jq0;
121     c6_00            = vdwparam[vdwioffset0+vdwjidx0];
122     c12_00           = vdwparam[vdwioffset0+vdwjidx0+1];
123     qq01             = iq0*jq1;
124     qq02             = iq0*jq2;
125     qq10             = iq1*jq0;
126     qq11             = iq1*jq1;
127     qq12             = iq1*jq2;
128     qq20             = iq2*jq0;
129     qq21             = iq2*jq1;
130     qq22             = iq2*jq2;
131
132     outeriter        = 0;
133     inneriter        = 0;
134
135     /* Start outer loop over neighborlists */
136     for(iidx=0; iidx<nri; iidx++)
137     {
138         /* Load shift vector for this list */
139         i_shift_offset   = DIM*shiftidx[iidx];
140         shX              = shiftvec[i_shift_offset+XX];
141         shY              = shiftvec[i_shift_offset+YY];
142         shZ              = shiftvec[i_shift_offset+ZZ];
143
144         /* Load limits for loop over neighbors */
145         j_index_start    = jindex[iidx];
146         j_index_end      = jindex[iidx+1];
147
148         /* Get outer coordinate index */
149         inr              = iinr[iidx];
150         i_coord_offset   = DIM*inr;
151
152         /* Load i particle coords and add shift vector */
153         ix0              = shX + x[i_coord_offset+DIM*0+XX];
154         iy0              = shY + x[i_coord_offset+DIM*0+YY];
155         iz0              = shZ + x[i_coord_offset+DIM*0+ZZ];
156         ix1              = shX + x[i_coord_offset+DIM*1+XX];
157         iy1              = shY + x[i_coord_offset+DIM*1+YY];
158         iz1              = shZ + x[i_coord_offset+DIM*1+ZZ];
159         ix2              = shX + x[i_coord_offset+DIM*2+XX];
160         iy2              = shY + x[i_coord_offset+DIM*2+YY];
161         iz2              = shZ + x[i_coord_offset+DIM*2+ZZ];
162
163         fix0             = 0.0;
164         fiy0             = 0.0;
165         fiz0             = 0.0;
166         fix1             = 0.0;
167         fiy1             = 0.0;
168         fiz1             = 0.0;
169         fix2             = 0.0;
170         fiy2             = 0.0;
171         fiz2             = 0.0;
172
173         /* Reset potential sums */
174         velecsum         = 0.0;
175         vvdwsum          = 0.0;
176
177         /* Start inner kernel loop */
178         for(jidx=j_index_start; jidx<j_index_end; jidx++)
179         {
180             /* Get j neighbor index, and coordinate index */
181             jnr              = jjnr[jidx];
182             j_coord_offset   = DIM*jnr;
183
184             /* load j atom coordinates */
185             jx0              = x[j_coord_offset+DIM*0+XX];
186             jy0              = x[j_coord_offset+DIM*0+YY];
187             jz0              = x[j_coord_offset+DIM*0+ZZ];
188             jx1              = x[j_coord_offset+DIM*1+XX];
189             jy1              = x[j_coord_offset+DIM*1+YY];
190             jz1              = x[j_coord_offset+DIM*1+ZZ];
191             jx2              = x[j_coord_offset+DIM*2+XX];
192             jy2              = x[j_coord_offset+DIM*2+YY];
193             jz2              = x[j_coord_offset+DIM*2+ZZ];
194
195             /* Calculate displacement vector */
196             dx00             = ix0 - jx0;
197             dy00             = iy0 - jy0;
198             dz00             = iz0 - jz0;
199             dx01             = ix0 - jx1;
200             dy01             = iy0 - jy1;
201             dz01             = iz0 - jz1;
202             dx02             = ix0 - jx2;
203             dy02             = iy0 - jy2;
204             dz02             = iz0 - jz2;
205             dx10             = ix1 - jx0;
206             dy10             = iy1 - jy0;
207             dz10             = iz1 - jz0;
208             dx11             = ix1 - jx1;
209             dy11             = iy1 - jy1;
210             dz11             = iz1 - jz1;
211             dx12             = ix1 - jx2;
212             dy12             = iy1 - jy2;
213             dz12             = iz1 - jz2;
214             dx20             = ix2 - jx0;
215             dy20             = iy2 - jy0;
216             dz20             = iz2 - jz0;
217             dx21             = ix2 - jx1;
218             dy21             = iy2 - jy1;
219             dz21             = iz2 - jz1;
220             dx22             = ix2 - jx2;
221             dy22             = iy2 - jy2;
222             dz22             = iz2 - jz2;
223
224             /* Calculate squared distance and things based on it */
225             rsq00            = dx00*dx00+dy00*dy00+dz00*dz00;
226             rsq01            = dx01*dx01+dy01*dy01+dz01*dz01;
227             rsq02            = dx02*dx02+dy02*dy02+dz02*dz02;
228             rsq10            = dx10*dx10+dy10*dy10+dz10*dz10;
229             rsq11            = dx11*dx11+dy11*dy11+dz11*dz11;
230             rsq12            = dx12*dx12+dy12*dy12+dz12*dz12;
231             rsq20            = dx20*dx20+dy20*dy20+dz20*dz20;
232             rsq21            = dx21*dx21+dy21*dy21+dz21*dz21;
233             rsq22            = dx22*dx22+dy22*dy22+dz22*dz22;
234
235             rinv00           = gmx_invsqrt(rsq00);
236             rinv01           = gmx_invsqrt(rsq01);
237             rinv02           = gmx_invsqrt(rsq02);
238             rinv10           = gmx_invsqrt(rsq10);
239             rinv11           = gmx_invsqrt(rsq11);
240             rinv12           = gmx_invsqrt(rsq12);
241             rinv20           = gmx_invsqrt(rsq20);
242             rinv21           = gmx_invsqrt(rsq21);
243             rinv22           = gmx_invsqrt(rsq22);
244
245             rinvsq00         = rinv00*rinv00;
246             rinvsq01         = rinv01*rinv01;
247             rinvsq02         = rinv02*rinv02;
248             rinvsq10         = rinv10*rinv10;
249             rinvsq11         = rinv11*rinv11;
250             rinvsq12         = rinv12*rinv12;
251             rinvsq20         = rinv20*rinv20;
252             rinvsq21         = rinv21*rinv21;
253             rinvsq22         = rinv22*rinv22;
254
255             /**************************
256              * CALCULATE INTERACTIONS *
257              **************************/
258
259             r00              = rsq00*rinv00;
260
261             /* EWALD ELECTROSTATICS */
262
263             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
264             ewrt             = r00*ewtabscale;
265             ewitab           = ewrt;
266             eweps            = ewrt-ewitab;
267             ewitab           = 4*ewitab;
268             felec            = ewtab[ewitab]+eweps*ewtab[ewitab+1];
269             velec            = qq00*(rinv00-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
270             felec            = qq00*rinv00*(rinvsq00-felec);
271
272             /* LENNARD-JONES DISPERSION/REPULSION */
273
274             rinvsix          = rinvsq00*rinvsq00*rinvsq00;
275             vvdw6            = c6_00*rinvsix;
276             vvdw12           = c12_00*rinvsix*rinvsix;
277             vvdw             = vvdw12*(1.0/12.0) - vvdw6*(1.0/6.0);
278             fvdw             = (vvdw12-vvdw6)*rinvsq00;
279
280             /* Update potential sums from outer loop */
281             velecsum        += velec;
282             vvdwsum         += vvdw;
283
284             fscal            = felec+fvdw;
285
286             /* Calculate temporary vectorial force */
287             tx               = fscal*dx00;
288             ty               = fscal*dy00;
289             tz               = fscal*dz00;
290
291             /* Update vectorial force */
292             fix0            += tx;
293             fiy0            += ty;
294             fiz0            += tz;
295             f[j_coord_offset+DIM*0+XX] -= tx;
296             f[j_coord_offset+DIM*0+YY] -= ty;
297             f[j_coord_offset+DIM*0+ZZ] -= tz;
298
299             /**************************
300              * CALCULATE INTERACTIONS *
301              **************************/
302
303             r01              = rsq01*rinv01;
304
305             /* EWALD ELECTROSTATICS */
306
307             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
308             ewrt             = r01*ewtabscale;
309             ewitab           = ewrt;
310             eweps            = ewrt-ewitab;
311             ewitab           = 4*ewitab;
312             felec            = ewtab[ewitab]+eweps*ewtab[ewitab+1];
313             velec            = qq01*(rinv01-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
314             felec            = qq01*rinv01*(rinvsq01-felec);
315
316             /* Update potential sums from outer loop */
317             velecsum        += velec;
318
319             fscal            = felec;
320
321             /* Calculate temporary vectorial force */
322             tx               = fscal*dx01;
323             ty               = fscal*dy01;
324             tz               = fscal*dz01;
325
326             /* Update vectorial force */
327             fix0            += tx;
328             fiy0            += ty;
329             fiz0            += tz;
330             f[j_coord_offset+DIM*1+XX] -= tx;
331             f[j_coord_offset+DIM*1+YY] -= ty;
332             f[j_coord_offset+DIM*1+ZZ] -= tz;
333
334             /**************************
335              * CALCULATE INTERACTIONS *
336              **************************/
337
338             r02              = rsq02*rinv02;
339
340             /* EWALD ELECTROSTATICS */
341
342             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
343             ewrt             = r02*ewtabscale;
344             ewitab           = ewrt;
345             eweps            = ewrt-ewitab;
346             ewitab           = 4*ewitab;
347             felec            = ewtab[ewitab]+eweps*ewtab[ewitab+1];
348             velec            = qq02*(rinv02-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
349             felec            = qq02*rinv02*(rinvsq02-felec);
350
351             /* Update potential sums from outer loop */
352             velecsum        += velec;
353
354             fscal            = felec;
355
356             /* Calculate temporary vectorial force */
357             tx               = fscal*dx02;
358             ty               = fscal*dy02;
359             tz               = fscal*dz02;
360
361             /* Update vectorial force */
362             fix0            += tx;
363             fiy0            += ty;
364             fiz0            += tz;
365             f[j_coord_offset+DIM*2+XX] -= tx;
366             f[j_coord_offset+DIM*2+YY] -= ty;
367             f[j_coord_offset+DIM*2+ZZ] -= tz;
368
369             /**************************
370              * CALCULATE INTERACTIONS *
371              **************************/
372
373             r10              = rsq10*rinv10;
374
375             /* EWALD ELECTROSTATICS */
376
377             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
378             ewrt             = r10*ewtabscale;
379             ewitab           = ewrt;
380             eweps            = ewrt-ewitab;
381             ewitab           = 4*ewitab;
382             felec            = ewtab[ewitab]+eweps*ewtab[ewitab+1];
383             velec            = qq10*(rinv10-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
384             felec            = qq10*rinv10*(rinvsq10-felec);
385
386             /* Update potential sums from outer loop */
387             velecsum        += velec;
388
389             fscal            = felec;
390
391             /* Calculate temporary vectorial force */
392             tx               = fscal*dx10;
393             ty               = fscal*dy10;
394             tz               = fscal*dz10;
395
396             /* Update vectorial force */
397             fix1            += tx;
398             fiy1            += ty;
399             fiz1            += tz;
400             f[j_coord_offset+DIM*0+XX] -= tx;
401             f[j_coord_offset+DIM*0+YY] -= ty;
402             f[j_coord_offset+DIM*0+ZZ] -= tz;
403
404             /**************************
405              * CALCULATE INTERACTIONS *
406              **************************/
407
408             r11              = rsq11*rinv11;
409
410             /* EWALD ELECTROSTATICS */
411
412             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
413             ewrt             = r11*ewtabscale;
414             ewitab           = ewrt;
415             eweps            = ewrt-ewitab;
416             ewitab           = 4*ewitab;
417             felec            = ewtab[ewitab]+eweps*ewtab[ewitab+1];
418             velec            = qq11*(rinv11-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
419             felec            = qq11*rinv11*(rinvsq11-felec);
420
421             /* Update potential sums from outer loop */
422             velecsum        += velec;
423
424             fscal            = felec;
425
426             /* Calculate temporary vectorial force */
427             tx               = fscal*dx11;
428             ty               = fscal*dy11;
429             tz               = fscal*dz11;
430
431             /* Update vectorial force */
432             fix1            += tx;
433             fiy1            += ty;
434             fiz1            += tz;
435             f[j_coord_offset+DIM*1+XX] -= tx;
436             f[j_coord_offset+DIM*1+YY] -= ty;
437             f[j_coord_offset+DIM*1+ZZ] -= tz;
438
439             /**************************
440              * CALCULATE INTERACTIONS *
441              **************************/
442
443             r12              = rsq12*rinv12;
444
445             /* EWALD ELECTROSTATICS */
446
447             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
448             ewrt             = r12*ewtabscale;
449             ewitab           = ewrt;
450             eweps            = ewrt-ewitab;
451             ewitab           = 4*ewitab;
452             felec            = ewtab[ewitab]+eweps*ewtab[ewitab+1];
453             velec            = qq12*(rinv12-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
454             felec            = qq12*rinv12*(rinvsq12-felec);
455
456             /* Update potential sums from outer loop */
457             velecsum        += velec;
458
459             fscal            = felec;
460
461             /* Calculate temporary vectorial force */
462             tx               = fscal*dx12;
463             ty               = fscal*dy12;
464             tz               = fscal*dz12;
465
466             /* Update vectorial force */
467             fix1            += tx;
468             fiy1            += ty;
469             fiz1            += tz;
470             f[j_coord_offset+DIM*2+XX] -= tx;
471             f[j_coord_offset+DIM*2+YY] -= ty;
472             f[j_coord_offset+DIM*2+ZZ] -= tz;
473
474             /**************************
475              * CALCULATE INTERACTIONS *
476              **************************/
477
478             r20              = rsq20*rinv20;
479
480             /* EWALD ELECTROSTATICS */
481
482             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
483             ewrt             = r20*ewtabscale;
484             ewitab           = ewrt;
485             eweps            = ewrt-ewitab;
486             ewitab           = 4*ewitab;
487             felec            = ewtab[ewitab]+eweps*ewtab[ewitab+1];
488             velec            = qq20*(rinv20-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
489             felec            = qq20*rinv20*(rinvsq20-felec);
490
491             /* Update potential sums from outer loop */
492             velecsum        += velec;
493
494             fscal            = felec;
495
496             /* Calculate temporary vectorial force */
497             tx               = fscal*dx20;
498             ty               = fscal*dy20;
499             tz               = fscal*dz20;
500
501             /* Update vectorial force */
502             fix2            += tx;
503             fiy2            += ty;
504             fiz2            += tz;
505             f[j_coord_offset+DIM*0+XX] -= tx;
506             f[j_coord_offset+DIM*0+YY] -= ty;
507             f[j_coord_offset+DIM*0+ZZ] -= tz;
508
509             /**************************
510              * CALCULATE INTERACTIONS *
511              **************************/
512
513             r21              = rsq21*rinv21;
514
515             /* EWALD ELECTROSTATICS */
516
517             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
518             ewrt             = r21*ewtabscale;
519             ewitab           = ewrt;
520             eweps            = ewrt-ewitab;
521             ewitab           = 4*ewitab;
522             felec            = ewtab[ewitab]+eweps*ewtab[ewitab+1];
523             velec            = qq21*(rinv21-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
524             felec            = qq21*rinv21*(rinvsq21-felec);
525
526             /* Update potential sums from outer loop */
527             velecsum        += velec;
528
529             fscal            = felec;
530
531             /* Calculate temporary vectorial force */
532             tx               = fscal*dx21;
533             ty               = fscal*dy21;
534             tz               = fscal*dz21;
535
536             /* Update vectorial force */
537             fix2            += tx;
538             fiy2            += ty;
539             fiz2            += tz;
540             f[j_coord_offset+DIM*1+XX] -= tx;
541             f[j_coord_offset+DIM*1+YY] -= ty;
542             f[j_coord_offset+DIM*1+ZZ] -= tz;
543
544             /**************************
545              * CALCULATE INTERACTIONS *
546              **************************/
547
548             r22              = rsq22*rinv22;
549
550             /* EWALD ELECTROSTATICS */
551
552             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
553             ewrt             = r22*ewtabscale;
554             ewitab           = ewrt;
555             eweps            = ewrt-ewitab;
556             ewitab           = 4*ewitab;
557             felec            = ewtab[ewitab]+eweps*ewtab[ewitab+1];
558             velec            = qq22*(rinv22-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
559             felec            = qq22*rinv22*(rinvsq22-felec);
560
561             /* Update potential sums from outer loop */
562             velecsum        += velec;
563
564             fscal            = felec;
565
566             /* Calculate temporary vectorial force */
567             tx               = fscal*dx22;
568             ty               = fscal*dy22;
569             tz               = fscal*dz22;
570
571             /* Update vectorial force */
572             fix2            += tx;
573             fiy2            += ty;
574             fiz2            += tz;
575             f[j_coord_offset+DIM*2+XX] -= tx;
576             f[j_coord_offset+DIM*2+YY] -= ty;
577             f[j_coord_offset+DIM*2+ZZ] -= tz;
578
579             /* Inner loop uses 372 flops */
580         }
581         /* End of innermost loop */
582
583         tx = ty = tz = 0;
584         f[i_coord_offset+DIM*0+XX] += fix0;
585         f[i_coord_offset+DIM*0+YY] += fiy0;
586         f[i_coord_offset+DIM*0+ZZ] += fiz0;
587         tx                         += fix0;
588         ty                         += fiy0;
589         tz                         += fiz0;
590         f[i_coord_offset+DIM*1+XX] += fix1;
591         f[i_coord_offset+DIM*1+YY] += fiy1;
592         f[i_coord_offset+DIM*1+ZZ] += fiz1;
593         tx                         += fix1;
594         ty                         += fiy1;
595         tz                         += fiz1;
596         f[i_coord_offset+DIM*2+XX] += fix2;
597         f[i_coord_offset+DIM*2+YY] += fiy2;
598         f[i_coord_offset+DIM*2+ZZ] += fiz2;
599         tx                         += fix2;
600         ty                         += fiy2;
601         tz                         += fiz2;
602         fshift[i_shift_offset+XX]  += tx;
603         fshift[i_shift_offset+YY]  += ty;
604         fshift[i_shift_offset+ZZ]  += tz;
605
606         ggid                        = gid[iidx];
607         /* Update potential energies */
608         kernel_data->energygrp_elec[ggid] += velecsum;
609         kernel_data->energygrp_vdw[ggid] += vvdwsum;
610
611         /* Increment number of inner iterations */
612         inneriter                  += j_index_end - j_index_start;
613
614         /* Outer loop uses 32 flops */
615     }
616
617     /* Increment number of outer iterations */
618     outeriter        += nri;
619
620     /* Update outer/inner flops */
621
622     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_VF,outeriter*32 + inneriter*372);
623 }
624 /*
625  * Gromacs nonbonded kernel:   nb_kernel_ElecEw_VdwLJ_GeomW3W3_F_c
626  * Electrostatics interaction: Ewald
627  * VdW interaction:            LennardJones
628  * Geometry:                   Water3-Water3
629  * Calculate force/pot:        Force
630  */
631 void
632 nb_kernel_ElecEw_VdwLJ_GeomW3W3_F_c
633                     (t_nblist * gmx_restrict                nlist,
634                      rvec * gmx_restrict                    xx,
635                      rvec * gmx_restrict                    ff,
636                      t_forcerec * gmx_restrict              fr,
637                      t_mdatoms * gmx_restrict               mdatoms,
638                      nb_kernel_data_t * gmx_restrict        kernel_data,
639                      t_nrnb * gmx_restrict                  nrnb)
640 {
641     int              i_shift_offset,i_coord_offset,j_coord_offset;
642     int              j_index_start,j_index_end;
643     int              nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
644     real             shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
645     int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
646     real             *shiftvec,*fshift,*x,*f;
647     int              vdwioffset0;
648     real             ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
649     int              vdwioffset1;
650     real             ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
651     int              vdwioffset2;
652     real             ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
653     int              vdwjidx0;
654     real             jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
655     int              vdwjidx1;
656     real             jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
657     int              vdwjidx2;
658     real             jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
659     real             dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
660     real             dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01,cexp1_01,cexp2_01;
661     real             dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02,cexp1_02,cexp2_02;
662     real             dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
663     real             dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
664     real             dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
665     real             dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
666     real             dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
667     real             dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
668     real             velec,felec,velecsum,facel,crf,krf,krf2;
669     real             *charge;
670     int              nvdwtype;
671     real             rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
672     int              *vdwtype;
673     real             *vdwparam;
674     int              ewitab;
675     real             ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace;
676     real             *ewtab;
677
678     x                = xx[0];
679     f                = ff[0];
680
681     nri              = nlist->nri;
682     iinr             = nlist->iinr;
683     jindex           = nlist->jindex;
684     jjnr             = nlist->jjnr;
685     shiftidx         = nlist->shift;
686     gid              = nlist->gid;
687     shiftvec         = fr->shift_vec[0];
688     fshift           = fr->fshift[0];
689     facel            = fr->epsfac;
690     charge           = mdatoms->chargeA;
691     nvdwtype         = fr->ntype;
692     vdwparam         = fr->nbfp;
693     vdwtype          = mdatoms->typeA;
694
695     sh_ewald         = fr->ic->sh_ewald;
696     ewtab            = fr->ic->tabq_coul_F;
697     ewtabscale       = fr->ic->tabq_scale;
698     ewtabhalfspace   = 0.5/ewtabscale;
699
700     /* Setup water-specific parameters */
701     inr              = nlist->iinr[0];
702     iq0              = facel*charge[inr+0];
703     iq1              = facel*charge[inr+1];
704     iq2              = facel*charge[inr+2];
705     vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
706
707     jq0              = charge[inr+0];
708     jq1              = charge[inr+1];
709     jq2              = charge[inr+2];
710     vdwjidx0         = 2*vdwtype[inr+0];
711     qq00             = iq0*jq0;
712     c6_00            = vdwparam[vdwioffset0+vdwjidx0];
713     c12_00           = vdwparam[vdwioffset0+vdwjidx0+1];
714     qq01             = iq0*jq1;
715     qq02             = iq0*jq2;
716     qq10             = iq1*jq0;
717     qq11             = iq1*jq1;
718     qq12             = iq1*jq2;
719     qq20             = iq2*jq0;
720     qq21             = iq2*jq1;
721     qq22             = iq2*jq2;
722
723     outeriter        = 0;
724     inneriter        = 0;
725
726     /* Start outer loop over neighborlists */
727     for(iidx=0; iidx<nri; iidx++)
728     {
729         /* Load shift vector for this list */
730         i_shift_offset   = DIM*shiftidx[iidx];
731         shX              = shiftvec[i_shift_offset+XX];
732         shY              = shiftvec[i_shift_offset+YY];
733         shZ              = shiftvec[i_shift_offset+ZZ];
734
735         /* Load limits for loop over neighbors */
736         j_index_start    = jindex[iidx];
737         j_index_end      = jindex[iidx+1];
738
739         /* Get outer coordinate index */
740         inr              = iinr[iidx];
741         i_coord_offset   = DIM*inr;
742
743         /* Load i particle coords and add shift vector */
744         ix0              = shX + x[i_coord_offset+DIM*0+XX];
745         iy0              = shY + x[i_coord_offset+DIM*0+YY];
746         iz0              = shZ + x[i_coord_offset+DIM*0+ZZ];
747         ix1              = shX + x[i_coord_offset+DIM*1+XX];
748         iy1              = shY + x[i_coord_offset+DIM*1+YY];
749         iz1              = shZ + x[i_coord_offset+DIM*1+ZZ];
750         ix2              = shX + x[i_coord_offset+DIM*2+XX];
751         iy2              = shY + x[i_coord_offset+DIM*2+YY];
752         iz2              = shZ + x[i_coord_offset+DIM*2+ZZ];
753
754         fix0             = 0.0;
755         fiy0             = 0.0;
756         fiz0             = 0.0;
757         fix1             = 0.0;
758         fiy1             = 0.0;
759         fiz1             = 0.0;
760         fix2             = 0.0;
761         fiy2             = 0.0;
762         fiz2             = 0.0;
763
764         /* Start inner kernel loop */
765         for(jidx=j_index_start; jidx<j_index_end; jidx++)
766         {
767             /* Get j neighbor index, and coordinate index */
768             jnr              = jjnr[jidx];
769             j_coord_offset   = DIM*jnr;
770
771             /* load j atom coordinates */
772             jx0              = x[j_coord_offset+DIM*0+XX];
773             jy0              = x[j_coord_offset+DIM*0+YY];
774             jz0              = x[j_coord_offset+DIM*0+ZZ];
775             jx1              = x[j_coord_offset+DIM*1+XX];
776             jy1              = x[j_coord_offset+DIM*1+YY];
777             jz1              = x[j_coord_offset+DIM*1+ZZ];
778             jx2              = x[j_coord_offset+DIM*2+XX];
779             jy2              = x[j_coord_offset+DIM*2+YY];
780             jz2              = x[j_coord_offset+DIM*2+ZZ];
781
782             /* Calculate displacement vector */
783             dx00             = ix0 - jx0;
784             dy00             = iy0 - jy0;
785             dz00             = iz0 - jz0;
786             dx01             = ix0 - jx1;
787             dy01             = iy0 - jy1;
788             dz01             = iz0 - jz1;
789             dx02             = ix0 - jx2;
790             dy02             = iy0 - jy2;
791             dz02             = iz0 - jz2;
792             dx10             = ix1 - jx0;
793             dy10             = iy1 - jy0;
794             dz10             = iz1 - jz0;
795             dx11             = ix1 - jx1;
796             dy11             = iy1 - jy1;
797             dz11             = iz1 - jz1;
798             dx12             = ix1 - jx2;
799             dy12             = iy1 - jy2;
800             dz12             = iz1 - jz2;
801             dx20             = ix2 - jx0;
802             dy20             = iy2 - jy0;
803             dz20             = iz2 - jz0;
804             dx21             = ix2 - jx1;
805             dy21             = iy2 - jy1;
806             dz21             = iz2 - jz1;
807             dx22             = ix2 - jx2;
808             dy22             = iy2 - jy2;
809             dz22             = iz2 - jz2;
810
811             /* Calculate squared distance and things based on it */
812             rsq00            = dx00*dx00+dy00*dy00+dz00*dz00;
813             rsq01            = dx01*dx01+dy01*dy01+dz01*dz01;
814             rsq02            = dx02*dx02+dy02*dy02+dz02*dz02;
815             rsq10            = dx10*dx10+dy10*dy10+dz10*dz10;
816             rsq11            = dx11*dx11+dy11*dy11+dz11*dz11;
817             rsq12            = dx12*dx12+dy12*dy12+dz12*dz12;
818             rsq20            = dx20*dx20+dy20*dy20+dz20*dz20;
819             rsq21            = dx21*dx21+dy21*dy21+dz21*dz21;
820             rsq22            = dx22*dx22+dy22*dy22+dz22*dz22;
821
822             rinv00           = gmx_invsqrt(rsq00);
823             rinv01           = gmx_invsqrt(rsq01);
824             rinv02           = gmx_invsqrt(rsq02);
825             rinv10           = gmx_invsqrt(rsq10);
826             rinv11           = gmx_invsqrt(rsq11);
827             rinv12           = gmx_invsqrt(rsq12);
828             rinv20           = gmx_invsqrt(rsq20);
829             rinv21           = gmx_invsqrt(rsq21);
830             rinv22           = gmx_invsqrt(rsq22);
831
832             rinvsq00         = rinv00*rinv00;
833             rinvsq01         = rinv01*rinv01;
834             rinvsq02         = rinv02*rinv02;
835             rinvsq10         = rinv10*rinv10;
836             rinvsq11         = rinv11*rinv11;
837             rinvsq12         = rinv12*rinv12;
838             rinvsq20         = rinv20*rinv20;
839             rinvsq21         = rinv21*rinv21;
840             rinvsq22         = rinv22*rinv22;
841
842             /**************************
843              * CALCULATE INTERACTIONS *
844              **************************/
845
846             r00              = rsq00*rinv00;
847
848             /* EWALD ELECTROSTATICS */
849
850             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
851             ewrt             = r00*ewtabscale;
852             ewitab           = ewrt;
853             eweps            = ewrt-ewitab;
854             felec            = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
855             felec            = qq00*rinv00*(rinvsq00-felec);
856
857             /* LENNARD-JONES DISPERSION/REPULSION */
858
859             rinvsix          = rinvsq00*rinvsq00*rinvsq00;
860             fvdw             = (c12_00*rinvsix-c6_00)*rinvsix*rinvsq00;
861
862             fscal            = felec+fvdw;
863
864             /* Calculate temporary vectorial force */
865             tx               = fscal*dx00;
866             ty               = fscal*dy00;
867             tz               = fscal*dz00;
868
869             /* Update vectorial force */
870             fix0            += tx;
871             fiy0            += ty;
872             fiz0            += tz;
873             f[j_coord_offset+DIM*0+XX] -= tx;
874             f[j_coord_offset+DIM*0+YY] -= ty;
875             f[j_coord_offset+DIM*0+ZZ] -= tz;
876
877             /**************************
878              * CALCULATE INTERACTIONS *
879              **************************/
880
881             r01              = rsq01*rinv01;
882
883             /* EWALD ELECTROSTATICS */
884
885             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
886             ewrt             = r01*ewtabscale;
887             ewitab           = ewrt;
888             eweps            = ewrt-ewitab;
889             felec            = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
890             felec            = qq01*rinv01*(rinvsq01-felec);
891
892             fscal            = felec;
893
894             /* Calculate temporary vectorial force */
895             tx               = fscal*dx01;
896             ty               = fscal*dy01;
897             tz               = fscal*dz01;
898
899             /* Update vectorial force */
900             fix0            += tx;
901             fiy0            += ty;
902             fiz0            += tz;
903             f[j_coord_offset+DIM*1+XX] -= tx;
904             f[j_coord_offset+DIM*1+YY] -= ty;
905             f[j_coord_offset+DIM*1+ZZ] -= tz;
906
907             /**************************
908              * CALCULATE INTERACTIONS *
909              **************************/
910
911             r02              = rsq02*rinv02;
912
913             /* EWALD ELECTROSTATICS */
914
915             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
916             ewrt             = r02*ewtabscale;
917             ewitab           = ewrt;
918             eweps            = ewrt-ewitab;
919             felec            = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
920             felec            = qq02*rinv02*(rinvsq02-felec);
921
922             fscal            = felec;
923
924             /* Calculate temporary vectorial force */
925             tx               = fscal*dx02;
926             ty               = fscal*dy02;
927             tz               = fscal*dz02;
928
929             /* Update vectorial force */
930             fix0            += tx;
931             fiy0            += ty;
932             fiz0            += tz;
933             f[j_coord_offset+DIM*2+XX] -= tx;
934             f[j_coord_offset+DIM*2+YY] -= ty;
935             f[j_coord_offset+DIM*2+ZZ] -= tz;
936
937             /**************************
938              * CALCULATE INTERACTIONS *
939              **************************/
940
941             r10              = rsq10*rinv10;
942
943             /* EWALD ELECTROSTATICS */
944
945             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
946             ewrt             = r10*ewtabscale;
947             ewitab           = ewrt;
948             eweps            = ewrt-ewitab;
949             felec            = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
950             felec            = qq10*rinv10*(rinvsq10-felec);
951
952             fscal            = felec;
953
954             /* Calculate temporary vectorial force */
955             tx               = fscal*dx10;
956             ty               = fscal*dy10;
957             tz               = fscal*dz10;
958
959             /* Update vectorial force */
960             fix1            += tx;
961             fiy1            += ty;
962             fiz1            += tz;
963             f[j_coord_offset+DIM*0+XX] -= tx;
964             f[j_coord_offset+DIM*0+YY] -= ty;
965             f[j_coord_offset+DIM*0+ZZ] -= tz;
966
967             /**************************
968              * CALCULATE INTERACTIONS *
969              **************************/
970
971             r11              = rsq11*rinv11;
972
973             /* EWALD ELECTROSTATICS */
974
975             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
976             ewrt             = r11*ewtabscale;
977             ewitab           = ewrt;
978             eweps            = ewrt-ewitab;
979             felec            = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
980             felec            = qq11*rinv11*(rinvsq11-felec);
981
982             fscal            = felec;
983
984             /* Calculate temporary vectorial force */
985             tx               = fscal*dx11;
986             ty               = fscal*dy11;
987             tz               = fscal*dz11;
988
989             /* Update vectorial force */
990             fix1            += tx;
991             fiy1            += ty;
992             fiz1            += tz;
993             f[j_coord_offset+DIM*1+XX] -= tx;
994             f[j_coord_offset+DIM*1+YY] -= ty;
995             f[j_coord_offset+DIM*1+ZZ] -= tz;
996
997             /**************************
998              * CALCULATE INTERACTIONS *
999              **************************/
1000
1001             r12              = rsq12*rinv12;
1002
1003             /* EWALD ELECTROSTATICS */
1004
1005             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1006             ewrt             = r12*ewtabscale;
1007             ewitab           = ewrt;
1008             eweps            = ewrt-ewitab;
1009             felec            = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
1010             felec            = qq12*rinv12*(rinvsq12-felec);
1011
1012             fscal            = felec;
1013
1014             /* Calculate temporary vectorial force */
1015             tx               = fscal*dx12;
1016             ty               = fscal*dy12;
1017             tz               = fscal*dz12;
1018
1019             /* Update vectorial force */
1020             fix1            += tx;
1021             fiy1            += ty;
1022             fiz1            += tz;
1023             f[j_coord_offset+DIM*2+XX] -= tx;
1024             f[j_coord_offset+DIM*2+YY] -= ty;
1025             f[j_coord_offset+DIM*2+ZZ] -= tz;
1026
1027             /**************************
1028              * CALCULATE INTERACTIONS *
1029              **************************/
1030
1031             r20              = rsq20*rinv20;
1032
1033             /* EWALD ELECTROSTATICS */
1034
1035             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1036             ewrt             = r20*ewtabscale;
1037             ewitab           = ewrt;
1038             eweps            = ewrt-ewitab;
1039             felec            = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
1040             felec            = qq20*rinv20*(rinvsq20-felec);
1041
1042             fscal            = felec;
1043
1044             /* Calculate temporary vectorial force */
1045             tx               = fscal*dx20;
1046             ty               = fscal*dy20;
1047             tz               = fscal*dz20;
1048
1049             /* Update vectorial force */
1050             fix2            += tx;
1051             fiy2            += ty;
1052             fiz2            += tz;
1053             f[j_coord_offset+DIM*0+XX] -= tx;
1054             f[j_coord_offset+DIM*0+YY] -= ty;
1055             f[j_coord_offset+DIM*0+ZZ] -= tz;
1056
1057             /**************************
1058              * CALCULATE INTERACTIONS *
1059              **************************/
1060
1061             r21              = rsq21*rinv21;
1062
1063             /* EWALD ELECTROSTATICS */
1064
1065             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1066             ewrt             = r21*ewtabscale;
1067             ewitab           = ewrt;
1068             eweps            = ewrt-ewitab;
1069             felec            = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
1070             felec            = qq21*rinv21*(rinvsq21-felec);
1071
1072             fscal            = felec;
1073
1074             /* Calculate temporary vectorial force */
1075             tx               = fscal*dx21;
1076             ty               = fscal*dy21;
1077             tz               = fscal*dz21;
1078
1079             /* Update vectorial force */
1080             fix2            += tx;
1081             fiy2            += ty;
1082             fiz2            += tz;
1083             f[j_coord_offset+DIM*1+XX] -= tx;
1084             f[j_coord_offset+DIM*1+YY] -= ty;
1085             f[j_coord_offset+DIM*1+ZZ] -= tz;
1086
1087             /**************************
1088              * CALCULATE INTERACTIONS *
1089              **************************/
1090
1091             r22              = rsq22*rinv22;
1092
1093             /* EWALD ELECTROSTATICS */
1094
1095             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1096             ewrt             = r22*ewtabscale;
1097             ewitab           = ewrt;
1098             eweps            = ewrt-ewitab;
1099             felec            = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
1100             felec            = qq22*rinv22*(rinvsq22-felec);
1101
1102             fscal            = felec;
1103
1104             /* Calculate temporary vectorial force */
1105             tx               = fscal*dx22;
1106             ty               = fscal*dy22;
1107             tz               = fscal*dz22;
1108
1109             /* Update vectorial force */
1110             fix2            += tx;
1111             fiy2            += ty;
1112             fiz2            += tz;
1113             f[j_coord_offset+DIM*2+XX] -= tx;
1114             f[j_coord_offset+DIM*2+YY] -= ty;
1115             f[j_coord_offset+DIM*2+ZZ] -= tz;
1116
1117             /* Inner loop uses 304 flops */
1118         }
1119         /* End of innermost loop */
1120
1121         tx = ty = tz = 0;
1122         f[i_coord_offset+DIM*0+XX] += fix0;
1123         f[i_coord_offset+DIM*0+YY] += fiy0;
1124         f[i_coord_offset+DIM*0+ZZ] += fiz0;
1125         tx                         += fix0;
1126         ty                         += fiy0;
1127         tz                         += fiz0;
1128         f[i_coord_offset+DIM*1+XX] += fix1;
1129         f[i_coord_offset+DIM*1+YY] += fiy1;
1130         f[i_coord_offset+DIM*1+ZZ] += fiz1;
1131         tx                         += fix1;
1132         ty                         += fiy1;
1133         tz                         += fiz1;
1134         f[i_coord_offset+DIM*2+XX] += fix2;
1135         f[i_coord_offset+DIM*2+YY] += fiy2;
1136         f[i_coord_offset+DIM*2+ZZ] += fiz2;
1137         tx                         += fix2;
1138         ty                         += fiy2;
1139         tz                         += fiz2;
1140         fshift[i_shift_offset+XX]  += tx;
1141         fshift[i_shift_offset+YY]  += ty;
1142         fshift[i_shift_offset+ZZ]  += tz;
1143
1144         /* Increment number of inner iterations */
1145         inneriter                  += j_index_end - j_index_start;
1146
1147         /* Outer loop uses 30 flops */
1148     }
1149
1150     /* Increment number of outer iterations */
1151     outeriter        += nri;
1152
1153     /* Update outer/inner flops */
1154
1155     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_F,outeriter*30 + inneriter*304);
1156 }