Fix component for libcudart
[alexxy/gromacs.git] / src / gmxlib / nonbonded / nb_kernel_c / nb_kernel_ElecRF_VdwBham_GeomW3P1_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_ElecRF_VdwBham_GeomW3P1_VF_c
35  * Electrostatics interaction: ReactionField
36  * VdW interaction:            Buckingham
37  * Geometry:                   Water3-Particle
38  * Calculate force/pot:        PotentialAndForce
39  */
40 void
41 nb_kernel_ElecRF_VdwBham_GeomW3P1_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     real             dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
65     real             dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
66     real             dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
67     real             velec,felec,velecsum,facel,crf,krf,krf2;
68     real             *charge;
69     int              nvdwtype;
70     real             rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
71     int              *vdwtype;
72     real             *vdwparam;
73
74     x                = xx[0];
75     f                = ff[0];
76
77     nri              = nlist->nri;
78     iinr             = nlist->iinr;
79     jindex           = nlist->jindex;
80     jjnr             = nlist->jjnr;
81     shiftidx         = nlist->shift;
82     gid              = nlist->gid;
83     shiftvec         = fr->shift_vec[0];
84     fshift           = fr->fshift[0];
85     facel            = fr->epsfac;
86     charge           = mdatoms->chargeA;
87     krf              = fr->ic->k_rf;
88     krf2             = krf*2.0;
89     crf              = fr->ic->c_rf;
90     nvdwtype         = fr->ntype;
91     vdwparam         = fr->nbfp;
92     vdwtype          = mdatoms->typeA;
93
94     /* Setup water-specific parameters */
95     inr              = nlist->iinr[0];
96     iq0              = facel*charge[inr+0];
97     iq1              = facel*charge[inr+1];
98     iq2              = facel*charge[inr+2];
99     vdwioffset0      = 3*nvdwtype*vdwtype[inr+0];
100
101     outeriter        = 0;
102     inneriter        = 0;
103
104     /* Start outer loop over neighborlists */
105     for(iidx=0; iidx<nri; iidx++)
106     {
107         /* Load shift vector for this list */
108         i_shift_offset   = DIM*shiftidx[iidx];
109         shX              = shiftvec[i_shift_offset+XX];
110         shY              = shiftvec[i_shift_offset+YY];
111         shZ              = shiftvec[i_shift_offset+ZZ];
112
113         /* Load limits for loop over neighbors */
114         j_index_start    = jindex[iidx];
115         j_index_end      = jindex[iidx+1];
116
117         /* Get outer coordinate index */
118         inr              = iinr[iidx];
119         i_coord_offset   = DIM*inr;
120
121         /* Load i particle coords and add shift vector */
122         ix0              = shX + x[i_coord_offset+DIM*0+XX];
123         iy0              = shY + x[i_coord_offset+DIM*0+YY];
124         iz0              = shZ + x[i_coord_offset+DIM*0+ZZ];
125         ix1              = shX + x[i_coord_offset+DIM*1+XX];
126         iy1              = shY + x[i_coord_offset+DIM*1+YY];
127         iz1              = shZ + x[i_coord_offset+DIM*1+ZZ];
128         ix2              = shX + x[i_coord_offset+DIM*2+XX];
129         iy2              = shY + x[i_coord_offset+DIM*2+YY];
130         iz2              = shZ + x[i_coord_offset+DIM*2+ZZ];
131
132         fix0             = 0.0;
133         fiy0             = 0.0;
134         fiz0             = 0.0;
135         fix1             = 0.0;
136         fiy1             = 0.0;
137         fiz1             = 0.0;
138         fix2             = 0.0;
139         fiy2             = 0.0;
140         fiz2             = 0.0;
141
142         /* Reset potential sums */
143         velecsum         = 0.0;
144         vvdwsum          = 0.0;
145
146         /* Start inner kernel loop */
147         for(jidx=j_index_start; jidx<j_index_end; jidx++)
148         {
149             /* Get j neighbor index, and coordinate index */
150             jnr              = jjnr[jidx];
151             j_coord_offset   = DIM*jnr;
152
153             /* load j atom coordinates */
154             jx0              = x[j_coord_offset+DIM*0+XX];
155             jy0              = x[j_coord_offset+DIM*0+YY];
156             jz0              = x[j_coord_offset+DIM*0+ZZ];
157
158             /* Calculate displacement vector */
159             dx00             = ix0 - jx0;
160             dy00             = iy0 - jy0;
161             dz00             = iz0 - jz0;
162             dx10             = ix1 - jx0;
163             dy10             = iy1 - jy0;
164             dz10             = iz1 - jz0;
165             dx20             = ix2 - jx0;
166             dy20             = iy2 - jy0;
167             dz20             = iz2 - jz0;
168
169             /* Calculate squared distance and things based on it */
170             rsq00            = dx00*dx00+dy00*dy00+dz00*dz00;
171             rsq10            = dx10*dx10+dy10*dy10+dz10*dz10;
172             rsq20            = dx20*dx20+dy20*dy20+dz20*dz20;
173
174             rinv00           = gmx_invsqrt(rsq00);
175             rinv10           = gmx_invsqrt(rsq10);
176             rinv20           = gmx_invsqrt(rsq20);
177
178             rinvsq00         = rinv00*rinv00;
179             rinvsq10         = rinv10*rinv10;
180             rinvsq20         = rinv20*rinv20;
181
182             /* Load parameters for j particles */
183             jq0              = charge[jnr+0];
184             vdwjidx0         = 3*vdwtype[jnr+0];
185
186             /**************************
187              * CALCULATE INTERACTIONS *
188              **************************/
189
190             r00              = rsq00*rinv00;
191
192             qq00             = iq0*jq0;
193             c6_00            = vdwparam[vdwioffset0+vdwjidx0];
194             cexp1_00         = vdwparam[vdwioffset0+vdwjidx0+1];
195             cexp2_00         = vdwparam[vdwioffset0+vdwjidx0+2];
196
197             /* REACTION-FIELD ELECTROSTATICS */
198             velec            = qq00*(rinv00+krf*rsq00-crf);
199             felec            = qq00*(rinv00*rinvsq00-krf2);
200
201             /* BUCKINGHAM DISPERSION/REPULSION */
202             rinvsix          = rinvsq00*rinvsq00*rinvsq00;
203             vvdw6            = c6_00*rinvsix;
204             br               = cexp2_00*r00;
205             vvdwexp          = cexp1_00*exp(-br);
206             vvdw             = vvdwexp - vvdw6*(1.0/6.0);
207             fvdw             = (br*vvdwexp-vvdw6)*rinvsq00;
208
209             /* Update potential sums from outer loop */
210             velecsum        += velec;
211             vvdwsum         += vvdw;
212
213             fscal            = felec+fvdw;
214
215             /* Calculate temporary vectorial force */
216             tx               = fscal*dx00;
217             ty               = fscal*dy00;
218             tz               = fscal*dz00;
219
220             /* Update vectorial force */
221             fix0            += tx;
222             fiy0            += ty;
223             fiz0            += tz;
224             f[j_coord_offset+DIM*0+XX] -= tx;
225             f[j_coord_offset+DIM*0+YY] -= ty;
226             f[j_coord_offset+DIM*0+ZZ] -= tz;
227
228             /**************************
229              * CALCULATE INTERACTIONS *
230              **************************/
231
232             qq10             = iq1*jq0;
233
234             /* REACTION-FIELD ELECTROSTATICS */
235             velec            = qq10*(rinv10+krf*rsq10-crf);
236             felec            = qq10*(rinv10*rinvsq10-krf2);
237
238             /* Update potential sums from outer loop */
239             velecsum        += velec;
240
241             fscal            = felec;
242
243             /* Calculate temporary vectorial force */
244             tx               = fscal*dx10;
245             ty               = fscal*dy10;
246             tz               = fscal*dz10;
247
248             /* Update vectorial force */
249             fix1            += tx;
250             fiy1            += ty;
251             fiz1            += tz;
252             f[j_coord_offset+DIM*0+XX] -= tx;
253             f[j_coord_offset+DIM*0+YY] -= ty;
254             f[j_coord_offset+DIM*0+ZZ] -= tz;
255
256             /**************************
257              * CALCULATE INTERACTIONS *
258              **************************/
259
260             qq20             = iq2*jq0;
261
262             /* REACTION-FIELD ELECTROSTATICS */
263             velec            = qq20*(rinv20+krf*rsq20-crf);
264             felec            = qq20*(rinv20*rinvsq20-krf2);
265
266             /* Update potential sums from outer loop */
267             velecsum        += velec;
268
269             fscal            = felec;
270
271             /* Calculate temporary vectorial force */
272             tx               = fscal*dx20;
273             ty               = fscal*dy20;
274             tz               = fscal*dz20;
275
276             /* Update vectorial force */
277             fix2            += tx;
278             fiy2            += ty;
279             fiz2            += tz;
280             f[j_coord_offset+DIM*0+XX] -= tx;
281             f[j_coord_offset+DIM*0+YY] -= ty;
282             f[j_coord_offset+DIM*0+ZZ] -= tz;
283
284             /* Inner loop uses 135 flops */
285         }
286         /* End of innermost loop */
287
288         tx = ty = tz = 0;
289         f[i_coord_offset+DIM*0+XX] += fix0;
290         f[i_coord_offset+DIM*0+YY] += fiy0;
291         f[i_coord_offset+DIM*0+ZZ] += fiz0;
292         tx                         += fix0;
293         ty                         += fiy0;
294         tz                         += fiz0;
295         f[i_coord_offset+DIM*1+XX] += fix1;
296         f[i_coord_offset+DIM*1+YY] += fiy1;
297         f[i_coord_offset+DIM*1+ZZ] += fiz1;
298         tx                         += fix1;
299         ty                         += fiy1;
300         tz                         += fiz1;
301         f[i_coord_offset+DIM*2+XX] += fix2;
302         f[i_coord_offset+DIM*2+YY] += fiy2;
303         f[i_coord_offset+DIM*2+ZZ] += fiz2;
304         tx                         += fix2;
305         ty                         += fiy2;
306         tz                         += fiz2;
307         fshift[i_shift_offset+XX]  += tx;
308         fshift[i_shift_offset+YY]  += ty;
309         fshift[i_shift_offset+ZZ]  += tz;
310
311         ggid                        = gid[iidx];
312         /* Update potential energies */
313         kernel_data->energygrp_elec[ggid] += velecsum;
314         kernel_data->energygrp_vdw[ggid] += vvdwsum;
315
316         /* Increment number of inner iterations */
317         inneriter                  += j_index_end - j_index_start;
318
319         /* Outer loop uses 32 flops */
320     }
321
322     /* Increment number of outer iterations */
323     outeriter        += nri;
324
325     /* Update outer/inner flops */
326
327     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3_VF,outeriter*32 + inneriter*135);
328 }
329 /*
330  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwBham_GeomW3P1_F_c
331  * Electrostatics interaction: ReactionField
332  * VdW interaction:            Buckingham
333  * Geometry:                   Water3-Particle
334  * Calculate force/pot:        Force
335  */
336 void
337 nb_kernel_ElecRF_VdwBham_GeomW3P1_F_c
338                     (t_nblist * gmx_restrict                nlist,
339                      rvec * gmx_restrict                    xx,
340                      rvec * gmx_restrict                    ff,
341                      t_forcerec * gmx_restrict              fr,
342                      t_mdatoms * gmx_restrict               mdatoms,
343                      nb_kernel_data_t * gmx_restrict        kernel_data,
344                      t_nrnb * gmx_restrict                  nrnb)
345 {
346     int              i_shift_offset,i_coord_offset,j_coord_offset;
347     int              j_index_start,j_index_end;
348     int              nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
349     real             shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
350     int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
351     real             *shiftvec,*fshift,*x,*f;
352     int              vdwioffset0;
353     real             ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
354     int              vdwioffset1;
355     real             ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
356     int              vdwioffset2;
357     real             ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
358     int              vdwjidx0;
359     real             jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
360     real             dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
361     real             dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
362     real             dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
363     real             velec,felec,velecsum,facel,crf,krf,krf2;
364     real             *charge;
365     int              nvdwtype;
366     real             rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
367     int              *vdwtype;
368     real             *vdwparam;
369
370     x                = xx[0];
371     f                = ff[0];
372
373     nri              = nlist->nri;
374     iinr             = nlist->iinr;
375     jindex           = nlist->jindex;
376     jjnr             = nlist->jjnr;
377     shiftidx         = nlist->shift;
378     gid              = nlist->gid;
379     shiftvec         = fr->shift_vec[0];
380     fshift           = fr->fshift[0];
381     facel            = fr->epsfac;
382     charge           = mdatoms->chargeA;
383     krf              = fr->ic->k_rf;
384     krf2             = krf*2.0;
385     crf              = fr->ic->c_rf;
386     nvdwtype         = fr->ntype;
387     vdwparam         = fr->nbfp;
388     vdwtype          = mdatoms->typeA;
389
390     /* Setup water-specific parameters */
391     inr              = nlist->iinr[0];
392     iq0              = facel*charge[inr+0];
393     iq1              = facel*charge[inr+1];
394     iq2              = facel*charge[inr+2];
395     vdwioffset0      = 3*nvdwtype*vdwtype[inr+0];
396
397     outeriter        = 0;
398     inneriter        = 0;
399
400     /* Start outer loop over neighborlists */
401     for(iidx=0; iidx<nri; iidx++)
402     {
403         /* Load shift vector for this list */
404         i_shift_offset   = DIM*shiftidx[iidx];
405         shX              = shiftvec[i_shift_offset+XX];
406         shY              = shiftvec[i_shift_offset+YY];
407         shZ              = shiftvec[i_shift_offset+ZZ];
408
409         /* Load limits for loop over neighbors */
410         j_index_start    = jindex[iidx];
411         j_index_end      = jindex[iidx+1];
412
413         /* Get outer coordinate index */
414         inr              = iinr[iidx];
415         i_coord_offset   = DIM*inr;
416
417         /* Load i particle coords and add shift vector */
418         ix0              = shX + x[i_coord_offset+DIM*0+XX];
419         iy0              = shY + x[i_coord_offset+DIM*0+YY];
420         iz0              = shZ + x[i_coord_offset+DIM*0+ZZ];
421         ix1              = shX + x[i_coord_offset+DIM*1+XX];
422         iy1              = shY + x[i_coord_offset+DIM*1+YY];
423         iz1              = shZ + x[i_coord_offset+DIM*1+ZZ];
424         ix2              = shX + x[i_coord_offset+DIM*2+XX];
425         iy2              = shY + x[i_coord_offset+DIM*2+YY];
426         iz2              = shZ + x[i_coord_offset+DIM*2+ZZ];
427
428         fix0             = 0.0;
429         fiy0             = 0.0;
430         fiz0             = 0.0;
431         fix1             = 0.0;
432         fiy1             = 0.0;
433         fiz1             = 0.0;
434         fix2             = 0.0;
435         fiy2             = 0.0;
436         fiz2             = 0.0;
437
438         /* Start inner kernel loop */
439         for(jidx=j_index_start; jidx<j_index_end; jidx++)
440         {
441             /* Get j neighbor index, and coordinate index */
442             jnr              = jjnr[jidx];
443             j_coord_offset   = DIM*jnr;
444
445             /* load j atom coordinates */
446             jx0              = x[j_coord_offset+DIM*0+XX];
447             jy0              = x[j_coord_offset+DIM*0+YY];
448             jz0              = x[j_coord_offset+DIM*0+ZZ];
449
450             /* Calculate displacement vector */
451             dx00             = ix0 - jx0;
452             dy00             = iy0 - jy0;
453             dz00             = iz0 - jz0;
454             dx10             = ix1 - jx0;
455             dy10             = iy1 - jy0;
456             dz10             = iz1 - jz0;
457             dx20             = ix2 - jx0;
458             dy20             = iy2 - jy0;
459             dz20             = iz2 - jz0;
460
461             /* Calculate squared distance and things based on it */
462             rsq00            = dx00*dx00+dy00*dy00+dz00*dz00;
463             rsq10            = dx10*dx10+dy10*dy10+dz10*dz10;
464             rsq20            = dx20*dx20+dy20*dy20+dz20*dz20;
465
466             rinv00           = gmx_invsqrt(rsq00);
467             rinv10           = gmx_invsqrt(rsq10);
468             rinv20           = gmx_invsqrt(rsq20);
469
470             rinvsq00         = rinv00*rinv00;
471             rinvsq10         = rinv10*rinv10;
472             rinvsq20         = rinv20*rinv20;
473
474             /* Load parameters for j particles */
475             jq0              = charge[jnr+0];
476             vdwjidx0         = 3*vdwtype[jnr+0];
477
478             /**************************
479              * CALCULATE INTERACTIONS *
480              **************************/
481
482             r00              = rsq00*rinv00;
483
484             qq00             = iq0*jq0;
485             c6_00            = vdwparam[vdwioffset0+vdwjidx0];
486             cexp1_00         = vdwparam[vdwioffset0+vdwjidx0+1];
487             cexp2_00         = vdwparam[vdwioffset0+vdwjidx0+2];
488
489             /* REACTION-FIELD ELECTROSTATICS */
490             felec            = qq00*(rinv00*rinvsq00-krf2);
491
492             /* BUCKINGHAM DISPERSION/REPULSION */
493             rinvsix          = rinvsq00*rinvsq00*rinvsq00;
494             vvdw6            = c6_00*rinvsix;
495             br               = cexp2_00*r00;
496             vvdwexp          = cexp1_00*exp(-br);
497             fvdw             = (br*vvdwexp-vvdw6)*rinvsq00;
498
499             fscal            = felec+fvdw;
500
501             /* Calculate temporary vectorial force */
502             tx               = fscal*dx00;
503             ty               = fscal*dy00;
504             tz               = fscal*dz00;
505
506             /* Update vectorial force */
507             fix0            += tx;
508             fiy0            += ty;
509             fiz0            += tz;
510             f[j_coord_offset+DIM*0+XX] -= tx;
511             f[j_coord_offset+DIM*0+YY] -= ty;
512             f[j_coord_offset+DIM*0+ZZ] -= tz;
513
514             /**************************
515              * CALCULATE INTERACTIONS *
516              **************************/
517
518             qq10             = iq1*jq0;
519
520             /* REACTION-FIELD ELECTROSTATICS */
521             felec            = qq10*(rinv10*rinvsq10-krf2);
522
523             fscal            = felec;
524
525             /* Calculate temporary vectorial force */
526             tx               = fscal*dx10;
527             ty               = fscal*dy10;
528             tz               = fscal*dz10;
529
530             /* Update vectorial force */
531             fix1            += tx;
532             fiy1            += ty;
533             fiz1            += tz;
534             f[j_coord_offset+DIM*0+XX] -= tx;
535             f[j_coord_offset+DIM*0+YY] -= ty;
536             f[j_coord_offset+DIM*0+ZZ] -= tz;
537
538             /**************************
539              * CALCULATE INTERACTIONS *
540              **************************/
541
542             qq20             = iq2*jq0;
543
544             /* REACTION-FIELD ELECTROSTATICS */
545             felec            = qq20*(rinv20*rinvsq20-krf2);
546
547             fscal            = felec;
548
549             /* Calculate temporary vectorial force */
550             tx               = fscal*dx20;
551             ty               = fscal*dy20;
552             tz               = fscal*dz20;
553
554             /* Update vectorial force */
555             fix2            += tx;
556             fiy2            += ty;
557             fiz2            += tz;
558             f[j_coord_offset+DIM*0+XX] -= tx;
559             f[j_coord_offset+DIM*0+YY] -= ty;
560             f[j_coord_offset+DIM*0+ZZ] -= tz;
561
562             /* Inner loop uses 117 flops */
563         }
564         /* End of innermost loop */
565
566         tx = ty = tz = 0;
567         f[i_coord_offset+DIM*0+XX] += fix0;
568         f[i_coord_offset+DIM*0+YY] += fiy0;
569         f[i_coord_offset+DIM*0+ZZ] += fiz0;
570         tx                         += fix0;
571         ty                         += fiy0;
572         tz                         += fiz0;
573         f[i_coord_offset+DIM*1+XX] += fix1;
574         f[i_coord_offset+DIM*1+YY] += fiy1;
575         f[i_coord_offset+DIM*1+ZZ] += fiz1;
576         tx                         += fix1;
577         ty                         += fiy1;
578         tz                         += fiz1;
579         f[i_coord_offset+DIM*2+XX] += fix2;
580         f[i_coord_offset+DIM*2+YY] += fiy2;
581         f[i_coord_offset+DIM*2+ZZ] += fiz2;
582         tx                         += fix2;
583         ty                         += fiy2;
584         tz                         += fiz2;
585         fshift[i_shift_offset+XX]  += tx;
586         fshift[i_shift_offset+YY]  += ty;
587         fshift[i_shift_offset+ZZ]  += tz;
588
589         /* Increment number of inner iterations */
590         inneriter                  += j_index_end - j_index_start;
591
592         /* Outer loop uses 30 flops */
593     }
594
595     /* Increment number of outer iterations */
596     outeriter        += nri;
597
598     /* Update outer/inner flops */
599
600     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3_F,outeriter*30 + inneriter*117);
601 }