1b71a1dfbcc981b4ebfb264487ef47c1c330fe6a
[alexxy/gromacs.git] / src / gromacs / gmxlib / nonbonded / nb_kernel_c / nb_kernel_ElecRF_VdwLJ_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 "gromacs/legacyheaders/types/simple.h"
44 #include "gromacs/math/vec.h"
45 #include "gromacs/legacyheaders/nrnb.h"
46
47 /*
48  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwLJ_GeomW3P1_VF_c
49  * Electrostatics interaction: ReactionField
50  * VdW interaction:            LennardJones
51  * Geometry:                   Water3-Particle
52  * Calculate force/pot:        PotentialAndForce
53  */
54 void
55 nb_kernel_ElecRF_VdwLJ_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     krf              = fr->ic->k_rf;
102     krf2             = krf*2.0;
103     crf              = fr->ic->c_rf;
104     nvdwtype         = fr->ntype;
105     vdwparam         = fr->nbfp;
106     vdwtype          = mdatoms->typeA;
107
108     /* Setup water-specific parameters */
109     inr              = nlist->iinr[0];
110     iq0              = facel*charge[inr+0];
111     iq1              = facel*charge[inr+1];
112     iq2              = facel*charge[inr+2];
113     vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
114
115     outeriter        = 0;
116     inneriter        = 0;
117
118     /* Start outer loop over neighborlists */
119     for(iidx=0; iidx<nri; iidx++)
120     {
121         /* Load shift vector for this list */
122         i_shift_offset   = DIM*shiftidx[iidx];
123         shX              = shiftvec[i_shift_offset+XX];
124         shY              = shiftvec[i_shift_offset+YY];
125         shZ              = shiftvec[i_shift_offset+ZZ];
126
127         /* Load limits for loop over neighbors */
128         j_index_start    = jindex[iidx];
129         j_index_end      = jindex[iidx+1];
130
131         /* Get outer coordinate index */
132         inr              = iinr[iidx];
133         i_coord_offset   = DIM*inr;
134
135         /* Load i particle coords and add shift vector */
136         ix0              = shX + x[i_coord_offset+DIM*0+XX];
137         iy0              = shY + x[i_coord_offset+DIM*0+YY];
138         iz0              = shZ + x[i_coord_offset+DIM*0+ZZ];
139         ix1              = shX + x[i_coord_offset+DIM*1+XX];
140         iy1              = shY + x[i_coord_offset+DIM*1+YY];
141         iz1              = shZ + x[i_coord_offset+DIM*1+ZZ];
142         ix2              = shX + x[i_coord_offset+DIM*2+XX];
143         iy2              = shY + x[i_coord_offset+DIM*2+YY];
144         iz2              = shZ + x[i_coord_offset+DIM*2+ZZ];
145
146         fix0             = 0.0;
147         fiy0             = 0.0;
148         fiz0             = 0.0;
149         fix1             = 0.0;
150         fiy1             = 0.0;
151         fiz1             = 0.0;
152         fix2             = 0.0;
153         fiy2             = 0.0;
154         fiz2             = 0.0;
155
156         /* Reset potential sums */
157         velecsum         = 0.0;
158         vvdwsum          = 0.0;
159
160         /* Start inner kernel loop */
161         for(jidx=j_index_start; jidx<j_index_end; jidx++)
162         {
163             /* Get j neighbor index, and coordinate index */
164             jnr              = jjnr[jidx];
165             j_coord_offset   = DIM*jnr;
166
167             /* load j atom coordinates */
168             jx0              = x[j_coord_offset+DIM*0+XX];
169             jy0              = x[j_coord_offset+DIM*0+YY];
170             jz0              = x[j_coord_offset+DIM*0+ZZ];
171
172             /* Calculate displacement vector */
173             dx00             = ix0 - jx0;
174             dy00             = iy0 - jy0;
175             dz00             = iz0 - jz0;
176             dx10             = ix1 - jx0;
177             dy10             = iy1 - jy0;
178             dz10             = iz1 - jz0;
179             dx20             = ix2 - jx0;
180             dy20             = iy2 - jy0;
181             dz20             = iz2 - jz0;
182
183             /* Calculate squared distance and things based on it */
184             rsq00            = dx00*dx00+dy00*dy00+dz00*dz00;
185             rsq10            = dx10*dx10+dy10*dy10+dz10*dz10;
186             rsq20            = dx20*dx20+dy20*dy20+dz20*dz20;
187
188             rinv00           = gmx_invsqrt(rsq00);
189             rinv10           = gmx_invsqrt(rsq10);
190             rinv20           = gmx_invsqrt(rsq20);
191
192             rinvsq00         = rinv00*rinv00;
193             rinvsq10         = rinv10*rinv10;
194             rinvsq20         = rinv20*rinv20;
195
196             /* Load parameters for j particles */
197             jq0              = charge[jnr+0];
198             vdwjidx0         = 2*vdwtype[jnr+0];
199
200             /**************************
201              * CALCULATE INTERACTIONS *
202              **************************/
203
204             qq00             = iq0*jq0;
205             c6_00            = vdwparam[vdwioffset0+vdwjidx0];
206             c12_00           = vdwparam[vdwioffset0+vdwjidx0+1];
207
208             /* REACTION-FIELD ELECTROSTATICS */
209             velec            = qq00*(rinv00+krf*rsq00-crf);
210             felec            = qq00*(rinv00*rinvsq00-krf2);
211
212             /* LENNARD-JONES DISPERSION/REPULSION */
213
214             rinvsix          = rinvsq00*rinvsq00*rinvsq00;
215             vvdw6            = c6_00*rinvsix;
216             vvdw12           = c12_00*rinvsix*rinvsix;
217             vvdw             = vvdw12*(1.0/12.0) - vvdw6*(1.0/6.0);
218             fvdw             = (vvdw12-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             /* REACTION-FIELD ELECTROSTATICS */
246             velec            = qq10*(rinv10+krf*rsq10-crf);
247             felec            = qq10*(rinv10*rinvsq10-krf2);
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             /* REACTION-FIELD ELECTROSTATICS */
274             velec            = qq20*(rinv20+krf*rsq20-crf);
275             felec            = qq20*(rinv20*rinvsq20-krf2);
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 108 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*108);
339 }
340 /*
341  * Gromacs nonbonded kernel:   nb_kernel_ElecRF_VdwLJ_GeomW3P1_F_c
342  * Electrostatics interaction: ReactionField
343  * VdW interaction:            LennardJones
344  * Geometry:                   Water3-Particle
345  * Calculate force/pot:        Force
346  */
347 void
348 nb_kernel_ElecRF_VdwLJ_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     krf              = fr->ic->k_rf;
395     krf2             = krf*2.0;
396     crf              = fr->ic->c_rf;
397     nvdwtype         = fr->ntype;
398     vdwparam         = fr->nbfp;
399     vdwtype          = mdatoms->typeA;
400
401     /* Setup water-specific parameters */
402     inr              = nlist->iinr[0];
403     iq0              = facel*charge[inr+0];
404     iq1              = facel*charge[inr+1];
405     iq2              = facel*charge[inr+2];
406     vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
407
408     outeriter        = 0;
409     inneriter        = 0;
410
411     /* Start outer loop over neighborlists */
412     for(iidx=0; iidx<nri; iidx++)
413     {
414         /* Load shift vector for this list */
415         i_shift_offset   = DIM*shiftidx[iidx];
416         shX              = shiftvec[i_shift_offset+XX];
417         shY              = shiftvec[i_shift_offset+YY];
418         shZ              = shiftvec[i_shift_offset+ZZ];
419
420         /* Load limits for loop over neighbors */
421         j_index_start    = jindex[iidx];
422         j_index_end      = jindex[iidx+1];
423
424         /* Get outer coordinate index */
425         inr              = iinr[iidx];
426         i_coord_offset   = DIM*inr;
427
428         /* Load i particle coords and add shift vector */
429         ix0              = shX + x[i_coord_offset+DIM*0+XX];
430         iy0              = shY + x[i_coord_offset+DIM*0+YY];
431         iz0              = shZ + x[i_coord_offset+DIM*0+ZZ];
432         ix1              = shX + x[i_coord_offset+DIM*1+XX];
433         iy1              = shY + x[i_coord_offset+DIM*1+YY];
434         iz1              = shZ + x[i_coord_offset+DIM*1+ZZ];
435         ix2              = shX + x[i_coord_offset+DIM*2+XX];
436         iy2              = shY + x[i_coord_offset+DIM*2+YY];
437         iz2              = shZ + x[i_coord_offset+DIM*2+ZZ];
438
439         fix0             = 0.0;
440         fiy0             = 0.0;
441         fiz0             = 0.0;
442         fix1             = 0.0;
443         fiy1             = 0.0;
444         fiz1             = 0.0;
445         fix2             = 0.0;
446         fiy2             = 0.0;
447         fiz2             = 0.0;
448
449         /* Start inner kernel loop */
450         for(jidx=j_index_start; jidx<j_index_end; jidx++)
451         {
452             /* Get j neighbor index, and coordinate index */
453             jnr              = jjnr[jidx];
454             j_coord_offset   = DIM*jnr;
455
456             /* load j atom coordinates */
457             jx0              = x[j_coord_offset+DIM*0+XX];
458             jy0              = x[j_coord_offset+DIM*0+YY];
459             jz0              = x[j_coord_offset+DIM*0+ZZ];
460
461             /* Calculate displacement vector */
462             dx00             = ix0 - jx0;
463             dy00             = iy0 - jy0;
464             dz00             = iz0 - jz0;
465             dx10             = ix1 - jx0;
466             dy10             = iy1 - jy0;
467             dz10             = iz1 - jz0;
468             dx20             = ix2 - jx0;
469             dy20             = iy2 - jy0;
470             dz20             = iz2 - jz0;
471
472             /* Calculate squared distance and things based on it */
473             rsq00            = dx00*dx00+dy00*dy00+dz00*dz00;
474             rsq10            = dx10*dx10+dy10*dy10+dz10*dz10;
475             rsq20            = dx20*dx20+dy20*dy20+dz20*dz20;
476
477             rinv00           = gmx_invsqrt(rsq00);
478             rinv10           = gmx_invsqrt(rsq10);
479             rinv20           = gmx_invsqrt(rsq20);
480
481             rinvsq00         = rinv00*rinv00;
482             rinvsq10         = rinv10*rinv10;
483             rinvsq20         = rinv20*rinv20;
484
485             /* Load parameters for j particles */
486             jq0              = charge[jnr+0];
487             vdwjidx0         = 2*vdwtype[jnr+0];
488
489             /**************************
490              * CALCULATE INTERACTIONS *
491              **************************/
492
493             qq00             = iq0*jq0;
494             c6_00            = vdwparam[vdwioffset0+vdwjidx0];
495             c12_00           = vdwparam[vdwioffset0+vdwjidx0+1];
496
497             /* REACTION-FIELD ELECTROSTATICS */
498             felec            = qq00*(rinv00*rinvsq00-krf2);
499
500             /* LENNARD-JONES DISPERSION/REPULSION */
501
502             rinvsix          = rinvsq00*rinvsq00*rinvsq00;
503             fvdw             = (c12_00*rinvsix-c6_00)*rinvsix*rinvsq00;
504
505             fscal            = felec+fvdw;
506
507             /* Calculate temporary vectorial force */
508             tx               = fscal*dx00;
509             ty               = fscal*dy00;
510             tz               = fscal*dz00;
511
512             /* Update vectorial force */
513             fix0            += tx;
514             fiy0            += ty;
515             fiz0            += tz;
516             f[j_coord_offset+DIM*0+XX] -= tx;
517             f[j_coord_offset+DIM*0+YY] -= ty;
518             f[j_coord_offset+DIM*0+ZZ] -= tz;
519
520             /**************************
521              * CALCULATE INTERACTIONS *
522              **************************/
523
524             qq10             = iq1*jq0;
525
526             /* REACTION-FIELD ELECTROSTATICS */
527             felec            = qq10*(rinv10*rinvsq10-krf2);
528
529             fscal            = felec;
530
531             /* Calculate temporary vectorial force */
532             tx               = fscal*dx10;
533             ty               = fscal*dy10;
534             tz               = fscal*dz10;
535
536             /* Update vectorial force */
537             fix1            += tx;
538             fiy1            += ty;
539             fiz1            += tz;
540             f[j_coord_offset+DIM*0+XX] -= tx;
541             f[j_coord_offset+DIM*0+YY] -= ty;
542             f[j_coord_offset+DIM*0+ZZ] -= tz;
543
544             /**************************
545              * CALCULATE INTERACTIONS *
546              **************************/
547
548             qq20             = iq2*jq0;
549
550             /* REACTION-FIELD ELECTROSTATICS */
551             felec            = qq20*(rinv20*rinvsq20-krf2);
552
553             fscal            = felec;
554
555             /* Calculate temporary vectorial force */
556             tx               = fscal*dx20;
557             ty               = fscal*dy20;
558             tz               = fscal*dz20;
559
560             /* Update vectorial force */
561             fix2            += tx;
562             fiy2            += ty;
563             fiz2            += tz;
564             f[j_coord_offset+DIM*0+XX] -= tx;
565             f[j_coord_offset+DIM*0+YY] -= ty;
566             f[j_coord_offset+DIM*0+ZZ] -= tz;
567
568             /* Inner loop uses 88 flops */
569         }
570         /* End of innermost loop */
571
572         tx = ty = tz = 0;
573         f[i_coord_offset+DIM*0+XX] += fix0;
574         f[i_coord_offset+DIM*0+YY] += fiy0;
575         f[i_coord_offset+DIM*0+ZZ] += fiz0;
576         tx                         += fix0;
577         ty                         += fiy0;
578         tz                         += fiz0;
579         f[i_coord_offset+DIM*1+XX] += fix1;
580         f[i_coord_offset+DIM*1+YY] += fiy1;
581         f[i_coord_offset+DIM*1+ZZ] += fiz1;
582         tx                         += fix1;
583         ty                         += fiy1;
584         tz                         += fiz1;
585         f[i_coord_offset+DIM*2+XX] += fix2;
586         f[i_coord_offset+DIM*2+YY] += fiy2;
587         f[i_coord_offset+DIM*2+ZZ] += fiz2;
588         tx                         += fix2;
589         ty                         += fiy2;
590         tz                         += fiz2;
591         fshift[i_shift_offset+XX]  += tx;
592         fshift[i_shift_offset+YY]  += ty;
593         fshift[i_shift_offset+ZZ]  += tz;
594
595         /* Increment number of inner iterations */
596         inneriter                  += j_index_end - j_index_start;
597
598         /* Outer loop uses 30 flops */
599     }
600
601     /* Increment number of outer iterations */
602     outeriter        += nri;
603
604     /* Update outer/inner flops */
605
606     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3_F,outeriter*30 + inneriter*88);
607 }