Remove all unnecessary HAVE_CONFIG_H
[alexxy/gromacs.git] / src / gromacs / gmxlib / nonbonded / nb_kernel_c / nb_kernel_ElecCoul_VdwBham_GeomW3P1_c.c
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
5  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6  * and including many others, as listed in the AUTHORS file in the
7  * top-level source directory and at http://www.gromacs.org.
8  *
9  * GROMACS is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public License
11  * as published by the Free Software Foundation; either version 2.1
12  * of the License, or (at your option) any later version.
13  *
14  * GROMACS is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with GROMACS; if not, see
21  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
23  *
24  * If you want to redistribute modifications to GROMACS, please
25  * consider that scientific software is very special. Version
26  * control is crucial - bugs must be traceable. We will be happy to
27  * consider code for inclusion in the official distribution, but
28  * derived work must not be called official GROMACS. Details are found
29  * in the README & COPYING files - if they are missing, get the
30  * official version at http://www.gromacs.org.
31  *
32  * To help us fund GROMACS development, we humbly ask that you cite
33  * the research papers on the package. Check out http://www.gromacs.org.
34  */
35 /*
36  * Note: this file was generated by the GROMACS c kernel generator.
37  */
38 #include "config.h"
39
40 #include <math.h>
41
42 #include "../nb_kernel.h"
43 #include "types/simple.h"
44 #include "gromacs/math/vec.h"
45 #include "nrnb.h"
46
47 /*
48  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwBham_GeomW3P1_VF_c
49  * Electrostatics interaction: Coulomb
50  * VdW interaction:            Buckingham
51  * Geometry:                   Water3-Particle
52  * Calculate force/pot:        PotentialAndForce
53  */
54 void
55 nb_kernel_ElecCoul_VdwBham_GeomW3P1_VF_c
56                     (t_nblist                    * gmx_restrict       nlist,
57                      rvec                        * gmx_restrict          xx,
58                      rvec                        * gmx_restrict          ff,
59                      t_forcerec                  * gmx_restrict          fr,
60                      t_mdatoms                   * gmx_restrict     mdatoms,
61                      nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
62                      t_nrnb                      * gmx_restrict        nrnb)
63 {
64     int              i_shift_offset,i_coord_offset,j_coord_offset;
65     int              j_index_start,j_index_end;
66     int              nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
67     real             shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
68     int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
69     real             *shiftvec,*fshift,*x,*f;
70     int              vdwioffset0;
71     real             ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
72     int              vdwioffset1;
73     real             ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
74     int              vdwioffset2;
75     real             ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
76     int              vdwjidx0;
77     real             jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
78     real             dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
79     real             dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
80     real             dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
81     real             velec,felec,velecsum,facel,crf,krf,krf2;
82     real             *charge;
83     int              nvdwtype;
84     real             rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
85     int              *vdwtype;
86     real             *vdwparam;
87
88     x                = xx[0];
89     f                = ff[0];
90
91     nri              = nlist->nri;
92     iinr             = nlist->iinr;
93     jindex           = nlist->jindex;
94     jjnr             = nlist->jjnr;
95     shiftidx         = nlist->shift;
96     gid              = nlist->gid;
97     shiftvec         = fr->shift_vec[0];
98     fshift           = fr->fshift[0];
99     facel            = fr->epsfac;
100     charge           = mdatoms->chargeA;
101     nvdwtype         = fr->ntype;
102     vdwparam         = fr->nbfp;
103     vdwtype          = mdatoms->typeA;
104
105     /* Setup water-specific parameters */
106     inr              = nlist->iinr[0];
107     iq0              = facel*charge[inr+0];
108     iq1              = facel*charge[inr+1];
109     iq2              = facel*charge[inr+2];
110     vdwioffset0      = 3*nvdwtype*vdwtype[inr+0];
111
112     outeriter        = 0;
113     inneriter        = 0;
114
115     /* Start outer loop over neighborlists */
116     for(iidx=0; iidx<nri; iidx++)
117     {
118         /* Load shift vector for this list */
119         i_shift_offset   = DIM*shiftidx[iidx];
120         shX              = shiftvec[i_shift_offset+XX];
121         shY              = shiftvec[i_shift_offset+YY];
122         shZ              = shiftvec[i_shift_offset+ZZ];
123
124         /* Load limits for loop over neighbors */
125         j_index_start    = jindex[iidx];
126         j_index_end      = jindex[iidx+1];
127
128         /* Get outer coordinate index */
129         inr              = iinr[iidx];
130         i_coord_offset   = DIM*inr;
131
132         /* Load i particle coords and add shift vector */
133         ix0              = shX + x[i_coord_offset+DIM*0+XX];
134         iy0              = shY + x[i_coord_offset+DIM*0+YY];
135         iz0              = shZ + x[i_coord_offset+DIM*0+ZZ];
136         ix1              = shX + x[i_coord_offset+DIM*1+XX];
137         iy1              = shY + x[i_coord_offset+DIM*1+YY];
138         iz1              = shZ + x[i_coord_offset+DIM*1+ZZ];
139         ix2              = shX + x[i_coord_offset+DIM*2+XX];
140         iy2              = shY + x[i_coord_offset+DIM*2+YY];
141         iz2              = shZ + x[i_coord_offset+DIM*2+ZZ];
142
143         fix0             = 0.0;
144         fiy0             = 0.0;
145         fiz0             = 0.0;
146         fix1             = 0.0;
147         fiy1             = 0.0;
148         fiz1             = 0.0;
149         fix2             = 0.0;
150         fiy2             = 0.0;
151         fiz2             = 0.0;
152
153         /* Reset potential sums */
154         velecsum         = 0.0;
155         vvdwsum          = 0.0;
156
157         /* Start inner kernel loop */
158         for(jidx=j_index_start; jidx<j_index_end; jidx++)
159         {
160             /* Get j neighbor index, and coordinate index */
161             jnr              = jjnr[jidx];
162             j_coord_offset   = DIM*jnr;
163
164             /* load j atom coordinates */
165             jx0              = x[j_coord_offset+DIM*0+XX];
166             jy0              = x[j_coord_offset+DIM*0+YY];
167             jz0              = x[j_coord_offset+DIM*0+ZZ];
168
169             /* Calculate displacement vector */
170             dx00             = ix0 - jx0;
171             dy00             = iy0 - jy0;
172             dz00             = iz0 - jz0;
173             dx10             = ix1 - jx0;
174             dy10             = iy1 - jy0;
175             dz10             = iz1 - jz0;
176             dx20             = ix2 - jx0;
177             dy20             = iy2 - jy0;
178             dz20             = iz2 - jz0;
179
180             /* Calculate squared distance and things based on it */
181             rsq00            = dx00*dx00+dy00*dy00+dz00*dz00;
182             rsq10            = dx10*dx10+dy10*dy10+dz10*dz10;
183             rsq20            = dx20*dx20+dy20*dy20+dz20*dz20;
184
185             rinv00           = gmx_invsqrt(rsq00);
186             rinv10           = gmx_invsqrt(rsq10);
187             rinv20           = gmx_invsqrt(rsq20);
188
189             rinvsq00         = rinv00*rinv00;
190             rinvsq10         = rinv10*rinv10;
191             rinvsq20         = rinv20*rinv20;
192
193             /* Load parameters for j particles */
194             jq0              = charge[jnr+0];
195             vdwjidx0         = 3*vdwtype[jnr+0];
196
197             /**************************
198              * CALCULATE INTERACTIONS *
199              **************************/
200
201             r00              = rsq00*rinv00;
202
203             qq00             = iq0*jq0;
204             c6_00            = vdwparam[vdwioffset0+vdwjidx0];
205             cexp1_00         = vdwparam[vdwioffset0+vdwjidx0+1];
206             cexp2_00         = vdwparam[vdwioffset0+vdwjidx0+2];
207
208             /* COULOMB ELECTROSTATICS */
209             velec            = qq00*rinv00;
210             felec            = velec*rinvsq00;
211
212             /* BUCKINGHAM DISPERSION/REPULSION */
213             rinvsix          = rinvsq00*rinvsq00*rinvsq00;
214             vvdw6            = c6_00*rinvsix;
215             br               = cexp2_00*r00;
216             vvdwexp          = cexp1_00*exp(-br);
217             vvdw             = vvdwexp - vvdw6*(1.0/6.0);
218             fvdw             = (br*vvdwexp-vvdw6)*rinvsq00;
219
220             /* Update potential sums from outer loop */
221             velecsum        += velec;
222             vvdwsum         += vvdw;
223
224             fscal            = felec+fvdw;
225
226             /* Calculate temporary vectorial force */
227             tx               = fscal*dx00;
228             ty               = fscal*dy00;
229             tz               = fscal*dz00;
230
231             /* Update vectorial force */
232             fix0            += tx;
233             fiy0            += ty;
234             fiz0            += tz;
235             f[j_coord_offset+DIM*0+XX] -= tx;
236             f[j_coord_offset+DIM*0+YY] -= ty;
237             f[j_coord_offset+DIM*0+ZZ] -= tz;
238
239             /**************************
240              * CALCULATE INTERACTIONS *
241              **************************/
242
243             qq10             = iq1*jq0;
244
245             /* COULOMB ELECTROSTATICS */
246             velec            = qq10*rinv10;
247             felec            = velec*rinvsq10;
248
249             /* Update potential sums from outer loop */
250             velecsum        += velec;
251
252             fscal            = felec;
253
254             /* Calculate temporary vectorial force */
255             tx               = fscal*dx10;
256             ty               = fscal*dy10;
257             tz               = fscal*dz10;
258
259             /* Update vectorial force */
260             fix1            += tx;
261             fiy1            += ty;
262             fiz1            += tz;
263             f[j_coord_offset+DIM*0+XX] -= tx;
264             f[j_coord_offset+DIM*0+YY] -= ty;
265             f[j_coord_offset+DIM*0+ZZ] -= tz;
266
267             /**************************
268              * CALCULATE INTERACTIONS *
269              **************************/
270
271             qq20             = iq2*jq0;
272
273             /* COULOMB ELECTROSTATICS */
274             velec            = qq20*rinv20;
275             felec            = velec*rinvsq20;
276
277             /* Update potential sums from outer loop */
278             velecsum        += velec;
279
280             fscal            = felec;
281
282             /* Calculate temporary vectorial force */
283             tx               = fscal*dx20;
284             ty               = fscal*dy20;
285             tz               = fscal*dz20;
286
287             /* Update vectorial force */
288             fix2            += tx;
289             fiy2            += ty;
290             fiz2            += tz;
291             f[j_coord_offset+DIM*0+XX] -= tx;
292             f[j_coord_offset+DIM*0+YY] -= ty;
293             f[j_coord_offset+DIM*0+ZZ] -= tz;
294
295             /* Inner loop uses 123 flops */
296         }
297         /* End of innermost loop */
298
299         tx = ty = tz = 0;
300         f[i_coord_offset+DIM*0+XX] += fix0;
301         f[i_coord_offset+DIM*0+YY] += fiy0;
302         f[i_coord_offset+DIM*0+ZZ] += fiz0;
303         tx                         += fix0;
304         ty                         += fiy0;
305         tz                         += fiz0;
306         f[i_coord_offset+DIM*1+XX] += fix1;
307         f[i_coord_offset+DIM*1+YY] += fiy1;
308         f[i_coord_offset+DIM*1+ZZ] += fiz1;
309         tx                         += fix1;
310         ty                         += fiy1;
311         tz                         += fiz1;
312         f[i_coord_offset+DIM*2+XX] += fix2;
313         f[i_coord_offset+DIM*2+YY] += fiy2;
314         f[i_coord_offset+DIM*2+ZZ] += fiz2;
315         tx                         += fix2;
316         ty                         += fiy2;
317         tz                         += fiz2;
318         fshift[i_shift_offset+XX]  += tx;
319         fshift[i_shift_offset+YY]  += ty;
320         fshift[i_shift_offset+ZZ]  += tz;
321
322         ggid                        = gid[iidx];
323         /* Update potential energies */
324         kernel_data->energygrp_elec[ggid] += velecsum;
325         kernel_data->energygrp_vdw[ggid] += vvdwsum;
326
327         /* Increment number of inner iterations */
328         inneriter                  += j_index_end - j_index_start;
329
330         /* Outer loop uses 32 flops */
331     }
332
333     /* Increment number of outer iterations */
334     outeriter        += nri;
335
336     /* Update outer/inner flops */
337
338     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3_VF,outeriter*32 + inneriter*123);
339 }
340 /*
341  * Gromacs nonbonded kernel:   nb_kernel_ElecCoul_VdwBham_GeomW3P1_F_c
342  * Electrostatics interaction: Coulomb
343  * VdW interaction:            Buckingham
344  * Geometry:                   Water3-Particle
345  * Calculate force/pot:        Force
346  */
347 void
348 nb_kernel_ElecCoul_VdwBham_GeomW3P1_F_c
349                     (t_nblist                    * gmx_restrict       nlist,
350                      rvec                        * gmx_restrict          xx,
351                      rvec                        * gmx_restrict          ff,
352                      t_forcerec                  * gmx_restrict          fr,
353                      t_mdatoms                   * gmx_restrict     mdatoms,
354                      nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
355                      t_nrnb                      * gmx_restrict        nrnb)
356 {
357     int              i_shift_offset,i_coord_offset,j_coord_offset;
358     int              j_index_start,j_index_end;
359     int              nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
360     real             shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
361     int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
362     real             *shiftvec,*fshift,*x,*f;
363     int              vdwioffset0;
364     real             ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
365     int              vdwioffset1;
366     real             ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
367     int              vdwioffset2;
368     real             ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
369     int              vdwjidx0;
370     real             jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
371     real             dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
372     real             dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
373     real             dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
374     real             velec,felec,velecsum,facel,crf,krf,krf2;
375     real             *charge;
376     int              nvdwtype;
377     real             rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
378     int              *vdwtype;
379     real             *vdwparam;
380
381     x                = xx[0];
382     f                = ff[0];
383
384     nri              = nlist->nri;
385     iinr             = nlist->iinr;
386     jindex           = nlist->jindex;
387     jjnr             = nlist->jjnr;
388     shiftidx         = nlist->shift;
389     gid              = nlist->gid;
390     shiftvec         = fr->shift_vec[0];
391     fshift           = fr->fshift[0];
392     facel            = fr->epsfac;
393     charge           = mdatoms->chargeA;
394     nvdwtype         = fr->ntype;
395     vdwparam         = fr->nbfp;
396     vdwtype          = mdatoms->typeA;
397
398     /* Setup water-specific parameters */
399     inr              = nlist->iinr[0];
400     iq0              = facel*charge[inr+0];
401     iq1              = facel*charge[inr+1];
402     iq2              = facel*charge[inr+2];
403     vdwioffset0      = 3*nvdwtype*vdwtype[inr+0];
404
405     outeriter        = 0;
406     inneriter        = 0;
407
408     /* Start outer loop over neighborlists */
409     for(iidx=0; iidx<nri; iidx++)
410     {
411         /* Load shift vector for this list */
412         i_shift_offset   = DIM*shiftidx[iidx];
413         shX              = shiftvec[i_shift_offset+XX];
414         shY              = shiftvec[i_shift_offset+YY];
415         shZ              = shiftvec[i_shift_offset+ZZ];
416
417         /* Load limits for loop over neighbors */
418         j_index_start    = jindex[iidx];
419         j_index_end      = jindex[iidx+1];
420
421         /* Get outer coordinate index */
422         inr              = iinr[iidx];
423         i_coord_offset   = DIM*inr;
424
425         /* Load i particle coords and add shift vector */
426         ix0              = shX + x[i_coord_offset+DIM*0+XX];
427         iy0              = shY + x[i_coord_offset+DIM*0+YY];
428         iz0              = shZ + x[i_coord_offset+DIM*0+ZZ];
429         ix1              = shX + x[i_coord_offset+DIM*1+XX];
430         iy1              = shY + x[i_coord_offset+DIM*1+YY];
431         iz1              = shZ + x[i_coord_offset+DIM*1+ZZ];
432         ix2              = shX + x[i_coord_offset+DIM*2+XX];
433         iy2              = shY + x[i_coord_offset+DIM*2+YY];
434         iz2              = shZ + x[i_coord_offset+DIM*2+ZZ];
435
436         fix0             = 0.0;
437         fiy0             = 0.0;
438         fiz0             = 0.0;
439         fix1             = 0.0;
440         fiy1             = 0.0;
441         fiz1             = 0.0;
442         fix2             = 0.0;
443         fiy2             = 0.0;
444         fiz2             = 0.0;
445
446         /* Start inner kernel loop */
447         for(jidx=j_index_start; jidx<j_index_end; jidx++)
448         {
449             /* Get j neighbor index, and coordinate index */
450             jnr              = jjnr[jidx];
451             j_coord_offset   = DIM*jnr;
452
453             /* load j atom coordinates */
454             jx0              = x[j_coord_offset+DIM*0+XX];
455             jy0              = x[j_coord_offset+DIM*0+YY];
456             jz0              = x[j_coord_offset+DIM*0+ZZ];
457
458             /* Calculate displacement vector */
459             dx00             = ix0 - jx0;
460             dy00             = iy0 - jy0;
461             dz00             = iz0 - jz0;
462             dx10             = ix1 - jx0;
463             dy10             = iy1 - jy0;
464             dz10             = iz1 - jz0;
465             dx20             = ix2 - jx0;
466             dy20             = iy2 - jy0;
467             dz20             = iz2 - jz0;
468
469             /* Calculate squared distance and things based on it */
470             rsq00            = dx00*dx00+dy00*dy00+dz00*dz00;
471             rsq10            = dx10*dx10+dy10*dy10+dz10*dz10;
472             rsq20            = dx20*dx20+dy20*dy20+dz20*dz20;
473
474             rinv00           = gmx_invsqrt(rsq00);
475             rinv10           = gmx_invsqrt(rsq10);
476             rinv20           = gmx_invsqrt(rsq20);
477
478             rinvsq00         = rinv00*rinv00;
479             rinvsq10         = rinv10*rinv10;
480             rinvsq20         = rinv20*rinv20;
481
482             /* Load parameters for j particles */
483             jq0              = charge[jnr+0];
484             vdwjidx0         = 3*vdwtype[jnr+0];
485
486             /**************************
487              * CALCULATE INTERACTIONS *
488              **************************/
489
490             r00              = rsq00*rinv00;
491
492             qq00             = iq0*jq0;
493             c6_00            = vdwparam[vdwioffset0+vdwjidx0];
494             cexp1_00         = vdwparam[vdwioffset0+vdwjidx0+1];
495             cexp2_00         = vdwparam[vdwioffset0+vdwjidx0+2];
496
497             /* COULOMB ELECTROSTATICS */
498             velec            = qq00*rinv00;
499             felec            = velec*rinvsq00;
500
501             /* BUCKINGHAM DISPERSION/REPULSION */
502             rinvsix          = rinvsq00*rinvsq00*rinvsq00;
503             vvdw6            = c6_00*rinvsix;
504             br               = cexp2_00*r00;
505             vvdwexp          = cexp1_00*exp(-br);
506             fvdw             = (br*vvdwexp-vvdw6)*rinvsq00;
507
508             fscal            = felec+fvdw;
509
510             /* Calculate temporary vectorial force */
511             tx               = fscal*dx00;
512             ty               = fscal*dy00;
513             tz               = fscal*dz00;
514
515             /* Update vectorial force */
516             fix0            += tx;
517             fiy0            += ty;
518             fiz0            += tz;
519             f[j_coord_offset+DIM*0+XX] -= tx;
520             f[j_coord_offset+DIM*0+YY] -= ty;
521             f[j_coord_offset+DIM*0+ZZ] -= tz;
522
523             /**************************
524              * CALCULATE INTERACTIONS *
525              **************************/
526
527             qq10             = iq1*jq0;
528
529             /* COULOMB ELECTROSTATICS */
530             velec            = qq10*rinv10;
531             felec            = velec*rinvsq10;
532
533             fscal            = felec;
534
535             /* Calculate temporary vectorial force */
536             tx               = fscal*dx10;
537             ty               = fscal*dy10;
538             tz               = fscal*dz10;
539
540             /* Update vectorial force */
541             fix1            += tx;
542             fiy1            += ty;
543             fiz1            += tz;
544             f[j_coord_offset+DIM*0+XX] -= tx;
545             f[j_coord_offset+DIM*0+YY] -= ty;
546             f[j_coord_offset+DIM*0+ZZ] -= tz;
547
548             /**************************
549              * CALCULATE INTERACTIONS *
550              **************************/
551
552             qq20             = iq2*jq0;
553
554             /* COULOMB ELECTROSTATICS */
555             velec            = qq20*rinv20;
556             felec            = velec*rinvsq20;
557
558             fscal            = felec;
559
560             /* Calculate temporary vectorial force */
561             tx               = fscal*dx20;
562             ty               = fscal*dy20;
563             tz               = fscal*dz20;
564
565             /* Update vectorial force */
566             fix2            += tx;
567             fiy2            += ty;
568             fiz2            += tz;
569             f[j_coord_offset+DIM*0+XX] -= tx;
570             f[j_coord_offset+DIM*0+YY] -= ty;
571             f[j_coord_offset+DIM*0+ZZ] -= tz;
572
573             /* Inner loop uses 117 flops */
574         }
575         /* End of innermost loop */
576
577         tx = ty = tz = 0;
578         f[i_coord_offset+DIM*0+XX] += fix0;
579         f[i_coord_offset+DIM*0+YY] += fiy0;
580         f[i_coord_offset+DIM*0+ZZ] += fiz0;
581         tx                         += fix0;
582         ty                         += fiy0;
583         tz                         += fiz0;
584         f[i_coord_offset+DIM*1+XX] += fix1;
585         f[i_coord_offset+DIM*1+YY] += fiy1;
586         f[i_coord_offset+DIM*1+ZZ] += fiz1;
587         tx                         += fix1;
588         ty                         += fiy1;
589         tz                         += fiz1;
590         f[i_coord_offset+DIM*2+XX] += fix2;
591         f[i_coord_offset+DIM*2+YY] += fiy2;
592         f[i_coord_offset+DIM*2+ZZ] += fiz2;
593         tx                         += fix2;
594         ty                         += fiy2;
595         tz                         += fiz2;
596         fshift[i_shift_offset+XX]  += tx;
597         fshift[i_shift_offset+YY]  += ty;
598         fshift[i_shift_offset+ZZ]  += tz;
599
600         /* Increment number of inner iterations */
601         inneriter                  += j_index_end - j_index_start;
602
603         /* Outer loop uses 30 flops */
604     }
605
606     /* Increment number of outer iterations */
607     outeriter        += nri;
608
609     /* Update outer/inner flops */
610
611     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3_F,outeriter*30 + inneriter*117);
612 }