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