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