Remove all unnecessary HAVE_CONFIG_H
[alexxy/gromacs.git] / src / gromacs / gmxlib / nonbonded / nb_kernel_c / nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_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_ElecRFCut_VdwLJSh_GeomW4W4_VF_c
49  * Electrostatics interaction: ReactionField
50  * VdW interaction:            LennardJones
51  * Geometry:                   Water4-Water4
52  * Calculate force/pot:        PotentialAndForce
53  */
54 void
55 nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_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              vdwioffset3;
77     real             ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
78     int              vdwjidx0;
79     real             jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
80     int              vdwjidx1;
81     real             jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
82     int              vdwjidx2;
83     real             jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
84     int              vdwjidx3;
85     real             jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3;
86     real             dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
87     real             dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
88     real             dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
89     real             dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13,cexp1_13,cexp2_13;
90     real             dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
91     real             dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
92     real             dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23,cexp1_23,cexp2_23;
93     real             dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31,cexp1_31,cexp2_31;
94     real             dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32,cexp1_32,cexp2_32;
95     real             dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33,cexp1_33,cexp2_33;
96     real             velec,felec,velecsum,facel,crf,krf,krf2;
97     real             *charge;
98     int              nvdwtype;
99     real             rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
100     int              *vdwtype;
101     real             *vdwparam;
102
103     x                = xx[0];
104     f                = ff[0];
105
106     nri              = nlist->nri;
107     iinr             = nlist->iinr;
108     jindex           = nlist->jindex;
109     jjnr             = nlist->jjnr;
110     shiftidx         = nlist->shift;
111     gid              = nlist->gid;
112     shiftvec         = fr->shift_vec[0];
113     fshift           = fr->fshift[0];
114     facel            = fr->epsfac;
115     charge           = mdatoms->chargeA;
116     krf              = fr->ic->k_rf;
117     krf2             = krf*2.0;
118     crf              = fr->ic->c_rf;
119     nvdwtype         = fr->ntype;
120     vdwparam         = fr->nbfp;
121     vdwtype          = mdatoms->typeA;
122
123     /* Setup water-specific parameters */
124     inr              = nlist->iinr[0];
125     iq1              = facel*charge[inr+1];
126     iq2              = facel*charge[inr+2];
127     iq3              = facel*charge[inr+3];
128     vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
129
130     jq1              = charge[inr+1];
131     jq2              = charge[inr+2];
132     jq3              = charge[inr+3];
133     vdwjidx0         = 2*vdwtype[inr+0];
134     c6_00            = vdwparam[vdwioffset0+vdwjidx0];
135     c12_00           = vdwparam[vdwioffset0+vdwjidx0+1];
136     qq11             = iq1*jq1;
137     qq12             = iq1*jq2;
138     qq13             = iq1*jq3;
139     qq21             = iq2*jq1;
140     qq22             = iq2*jq2;
141     qq23             = iq2*jq3;
142     qq31             = iq3*jq1;
143     qq32             = iq3*jq2;
144     qq33             = iq3*jq3;
145
146     /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
147     rcutoff          = fr->rcoulomb;
148     rcutoff2         = rcutoff*rcutoff;
149
150     sh_vdw_invrcut6  = fr->ic->sh_invrc6;
151     rvdw             = fr->rvdw;
152
153     outeriter        = 0;
154     inneriter        = 0;
155
156     /* Start outer loop over neighborlists */
157     for(iidx=0; iidx<nri; iidx++)
158     {
159         /* Load shift vector for this list */
160         i_shift_offset   = DIM*shiftidx[iidx];
161         shX              = shiftvec[i_shift_offset+XX];
162         shY              = shiftvec[i_shift_offset+YY];
163         shZ              = shiftvec[i_shift_offset+ZZ];
164
165         /* Load limits for loop over neighbors */
166         j_index_start    = jindex[iidx];
167         j_index_end      = jindex[iidx+1];
168
169         /* Get outer coordinate index */
170         inr              = iinr[iidx];
171         i_coord_offset   = DIM*inr;
172
173         /* Load i particle coords and add shift vector */
174         ix0              = shX + x[i_coord_offset+DIM*0+XX];
175         iy0              = shY + x[i_coord_offset+DIM*0+YY];
176         iz0              = shZ + x[i_coord_offset+DIM*0+ZZ];
177         ix1              = shX + x[i_coord_offset+DIM*1+XX];
178         iy1              = shY + x[i_coord_offset+DIM*1+YY];
179         iz1              = shZ + x[i_coord_offset+DIM*1+ZZ];
180         ix2              = shX + x[i_coord_offset+DIM*2+XX];
181         iy2              = shY + x[i_coord_offset+DIM*2+YY];
182         iz2              = shZ + x[i_coord_offset+DIM*2+ZZ];
183         ix3              = shX + x[i_coord_offset+DIM*3+XX];
184         iy3              = shY + x[i_coord_offset+DIM*3+YY];
185         iz3              = shZ + x[i_coord_offset+DIM*3+ZZ];
186
187         fix0             = 0.0;
188         fiy0             = 0.0;
189         fiz0             = 0.0;
190         fix1             = 0.0;
191         fiy1             = 0.0;
192         fiz1             = 0.0;
193         fix2             = 0.0;
194         fiy2             = 0.0;
195         fiz2             = 0.0;
196         fix3             = 0.0;
197         fiy3             = 0.0;
198         fiz3             = 0.0;
199
200         /* Reset potential sums */
201         velecsum         = 0.0;
202         vvdwsum          = 0.0;
203
204         /* Start inner kernel loop */
205         for(jidx=j_index_start; jidx<j_index_end; jidx++)
206         {
207             /* Get j neighbor index, and coordinate index */
208             jnr              = jjnr[jidx];
209             j_coord_offset   = DIM*jnr;
210
211             /* load j atom coordinates */
212             jx0              = x[j_coord_offset+DIM*0+XX];
213             jy0              = x[j_coord_offset+DIM*0+YY];
214             jz0              = x[j_coord_offset+DIM*0+ZZ];
215             jx1              = x[j_coord_offset+DIM*1+XX];
216             jy1              = x[j_coord_offset+DIM*1+YY];
217             jz1              = x[j_coord_offset+DIM*1+ZZ];
218             jx2              = x[j_coord_offset+DIM*2+XX];
219             jy2              = x[j_coord_offset+DIM*2+YY];
220             jz2              = x[j_coord_offset+DIM*2+ZZ];
221             jx3              = x[j_coord_offset+DIM*3+XX];
222             jy3              = x[j_coord_offset+DIM*3+YY];
223             jz3              = x[j_coord_offset+DIM*3+ZZ];
224
225             /* Calculate displacement vector */
226             dx00             = ix0 - jx0;
227             dy00             = iy0 - jy0;
228             dz00             = iz0 - jz0;
229             dx11             = ix1 - jx1;
230             dy11             = iy1 - jy1;
231             dz11             = iz1 - jz1;
232             dx12             = ix1 - jx2;
233             dy12             = iy1 - jy2;
234             dz12             = iz1 - jz2;
235             dx13             = ix1 - jx3;
236             dy13             = iy1 - jy3;
237             dz13             = iz1 - jz3;
238             dx21             = ix2 - jx1;
239             dy21             = iy2 - jy1;
240             dz21             = iz2 - jz1;
241             dx22             = ix2 - jx2;
242             dy22             = iy2 - jy2;
243             dz22             = iz2 - jz2;
244             dx23             = ix2 - jx3;
245             dy23             = iy2 - jy3;
246             dz23             = iz2 - jz3;
247             dx31             = ix3 - jx1;
248             dy31             = iy3 - jy1;
249             dz31             = iz3 - jz1;
250             dx32             = ix3 - jx2;
251             dy32             = iy3 - jy2;
252             dz32             = iz3 - jz2;
253             dx33             = ix3 - jx3;
254             dy33             = iy3 - jy3;
255             dz33             = iz3 - jz3;
256
257             /* Calculate squared distance and things based on it */
258             rsq00            = dx00*dx00+dy00*dy00+dz00*dz00;
259             rsq11            = dx11*dx11+dy11*dy11+dz11*dz11;
260             rsq12            = dx12*dx12+dy12*dy12+dz12*dz12;
261             rsq13            = dx13*dx13+dy13*dy13+dz13*dz13;
262             rsq21            = dx21*dx21+dy21*dy21+dz21*dz21;
263             rsq22            = dx22*dx22+dy22*dy22+dz22*dz22;
264             rsq23            = dx23*dx23+dy23*dy23+dz23*dz23;
265             rsq31            = dx31*dx31+dy31*dy31+dz31*dz31;
266             rsq32            = dx32*dx32+dy32*dy32+dz32*dz32;
267             rsq33            = dx33*dx33+dy33*dy33+dz33*dz33;
268
269             rinv11           = gmx_invsqrt(rsq11);
270             rinv12           = gmx_invsqrt(rsq12);
271             rinv13           = gmx_invsqrt(rsq13);
272             rinv21           = gmx_invsqrt(rsq21);
273             rinv22           = gmx_invsqrt(rsq22);
274             rinv23           = gmx_invsqrt(rsq23);
275             rinv31           = gmx_invsqrt(rsq31);
276             rinv32           = gmx_invsqrt(rsq32);
277             rinv33           = gmx_invsqrt(rsq33);
278
279             rinvsq00         = 1.0/rsq00;
280             rinvsq11         = rinv11*rinv11;
281             rinvsq12         = rinv12*rinv12;
282             rinvsq13         = rinv13*rinv13;
283             rinvsq21         = rinv21*rinv21;
284             rinvsq22         = rinv22*rinv22;
285             rinvsq23         = rinv23*rinv23;
286             rinvsq31         = rinv31*rinv31;
287             rinvsq32         = rinv32*rinv32;
288             rinvsq33         = rinv33*rinv33;
289
290             /**************************
291              * CALCULATE INTERACTIONS *
292              **************************/
293
294             if (rsq00<rcutoff2)
295             {
296
297             /* LENNARD-JONES DISPERSION/REPULSION */
298
299             rinvsix          = rinvsq00*rinvsq00*rinvsq00;
300             vvdw6            = c6_00*rinvsix;
301             vvdw12           = c12_00*rinvsix*rinvsix;
302             vvdw             = (vvdw12 - c12_00*sh_vdw_invrcut6*sh_vdw_invrcut6)*(1.0/12.0) - (vvdw6 - c6_00*sh_vdw_invrcut6)*(1.0/6.0);
303             fvdw             = (vvdw12-vvdw6)*rinvsq00;
304
305             /* Update potential sums from outer loop */
306             vvdwsum         += vvdw;
307
308             fscal            = fvdw;
309
310             /* Calculate temporary vectorial force */
311             tx               = fscal*dx00;
312             ty               = fscal*dy00;
313             tz               = fscal*dz00;
314
315             /* Update vectorial force */
316             fix0            += tx;
317             fiy0            += ty;
318             fiz0            += tz;
319             f[j_coord_offset+DIM*0+XX] -= tx;
320             f[j_coord_offset+DIM*0+YY] -= ty;
321             f[j_coord_offset+DIM*0+ZZ] -= tz;
322
323             }
324
325             /**************************
326              * CALCULATE INTERACTIONS *
327              **************************/
328
329             if (rsq11<rcutoff2)
330             {
331
332             /* REACTION-FIELD ELECTROSTATICS */
333             velec            = qq11*(rinv11+krf*rsq11-crf);
334             felec            = qq11*(rinv11*rinvsq11-krf2);
335
336             /* Update potential sums from outer loop */
337             velecsum        += velec;
338
339             fscal            = felec;
340
341             /* Calculate temporary vectorial force */
342             tx               = fscal*dx11;
343             ty               = fscal*dy11;
344             tz               = fscal*dz11;
345
346             /* Update vectorial force */
347             fix1            += tx;
348             fiy1            += ty;
349             fiz1            += tz;
350             f[j_coord_offset+DIM*1+XX] -= tx;
351             f[j_coord_offset+DIM*1+YY] -= ty;
352             f[j_coord_offset+DIM*1+ZZ] -= tz;
353
354             }
355
356             /**************************
357              * CALCULATE INTERACTIONS *
358              **************************/
359
360             if (rsq12<rcutoff2)
361             {
362
363             /* REACTION-FIELD ELECTROSTATICS */
364             velec            = qq12*(rinv12+krf*rsq12-crf);
365             felec            = qq12*(rinv12*rinvsq12-krf2);
366
367             /* Update potential sums from outer loop */
368             velecsum        += velec;
369
370             fscal            = felec;
371
372             /* Calculate temporary vectorial force */
373             tx               = fscal*dx12;
374             ty               = fscal*dy12;
375             tz               = fscal*dz12;
376
377             /* Update vectorial force */
378             fix1            += tx;
379             fiy1            += ty;
380             fiz1            += tz;
381             f[j_coord_offset+DIM*2+XX] -= tx;
382             f[j_coord_offset+DIM*2+YY] -= ty;
383             f[j_coord_offset+DIM*2+ZZ] -= tz;
384
385             }
386
387             /**************************
388              * CALCULATE INTERACTIONS *
389              **************************/
390
391             if (rsq13<rcutoff2)
392             {
393
394             /* REACTION-FIELD ELECTROSTATICS */
395             velec            = qq13*(rinv13+krf*rsq13-crf);
396             felec            = qq13*(rinv13*rinvsq13-krf2);
397
398             /* Update potential sums from outer loop */
399             velecsum        += velec;
400
401             fscal            = felec;
402
403             /* Calculate temporary vectorial force */
404             tx               = fscal*dx13;
405             ty               = fscal*dy13;
406             tz               = fscal*dz13;
407
408             /* Update vectorial force */
409             fix1            += tx;
410             fiy1            += ty;
411             fiz1            += tz;
412             f[j_coord_offset+DIM*3+XX] -= tx;
413             f[j_coord_offset+DIM*3+YY] -= ty;
414             f[j_coord_offset+DIM*3+ZZ] -= tz;
415
416             }
417
418             /**************************
419              * CALCULATE INTERACTIONS *
420              **************************/
421
422             if (rsq21<rcutoff2)
423             {
424
425             /* REACTION-FIELD ELECTROSTATICS */
426             velec            = qq21*(rinv21+krf*rsq21-crf);
427             felec            = qq21*(rinv21*rinvsq21-krf2);
428
429             /* Update potential sums from outer loop */
430             velecsum        += velec;
431
432             fscal            = felec;
433
434             /* Calculate temporary vectorial force */
435             tx               = fscal*dx21;
436             ty               = fscal*dy21;
437             tz               = fscal*dz21;
438
439             /* Update vectorial force */
440             fix2            += tx;
441             fiy2            += ty;
442             fiz2            += tz;
443             f[j_coord_offset+DIM*1+XX] -= tx;
444             f[j_coord_offset+DIM*1+YY] -= ty;
445             f[j_coord_offset+DIM*1+ZZ] -= tz;
446
447             }
448
449             /**************************
450              * CALCULATE INTERACTIONS *
451              **************************/
452
453             if (rsq22<rcutoff2)
454             {
455
456             /* REACTION-FIELD ELECTROSTATICS */
457             velec            = qq22*(rinv22+krf*rsq22-crf);
458             felec            = qq22*(rinv22*rinvsq22-krf2);
459
460             /* Update potential sums from outer loop */
461             velecsum        += velec;
462
463             fscal            = felec;
464
465             /* Calculate temporary vectorial force */
466             tx               = fscal*dx22;
467             ty               = fscal*dy22;
468             tz               = fscal*dz22;
469
470             /* Update vectorial force */
471             fix2            += tx;
472             fiy2            += ty;
473             fiz2            += tz;
474             f[j_coord_offset+DIM*2+XX] -= tx;
475             f[j_coord_offset+DIM*2+YY] -= ty;
476             f[j_coord_offset+DIM*2+ZZ] -= tz;
477
478             }
479
480             /**************************
481              * CALCULATE INTERACTIONS *
482              **************************/
483
484             if (rsq23<rcutoff2)
485             {
486
487             /* REACTION-FIELD ELECTROSTATICS */
488             velec            = qq23*(rinv23+krf*rsq23-crf);
489             felec            = qq23*(rinv23*rinvsq23-krf2);
490
491             /* Update potential sums from outer loop */
492             velecsum        += velec;
493
494             fscal            = felec;
495
496             /* Calculate temporary vectorial force */
497             tx               = fscal*dx23;
498             ty               = fscal*dy23;
499             tz               = fscal*dz23;
500
501             /* Update vectorial force */
502             fix2            += tx;
503             fiy2            += ty;
504             fiz2            += tz;
505             f[j_coord_offset+DIM*3+XX] -= tx;
506             f[j_coord_offset+DIM*3+YY] -= ty;
507             f[j_coord_offset+DIM*3+ZZ] -= tz;
508
509             }
510
511             /**************************
512              * CALCULATE INTERACTIONS *
513              **************************/
514
515             if (rsq31<rcutoff2)
516             {
517
518             /* REACTION-FIELD ELECTROSTATICS */
519             velec            = qq31*(rinv31+krf*rsq31-crf);
520             felec            = qq31*(rinv31*rinvsq31-krf2);
521
522             /* Update potential sums from outer loop */
523             velecsum        += velec;
524
525             fscal            = felec;
526
527             /* Calculate temporary vectorial force */
528             tx               = fscal*dx31;
529             ty               = fscal*dy31;
530             tz               = fscal*dz31;
531
532             /* Update vectorial force */
533             fix3            += tx;
534             fiy3            += ty;
535             fiz3            += tz;
536             f[j_coord_offset+DIM*1+XX] -= tx;
537             f[j_coord_offset+DIM*1+YY] -= ty;
538             f[j_coord_offset+DIM*1+ZZ] -= tz;
539
540             }
541
542             /**************************
543              * CALCULATE INTERACTIONS *
544              **************************/
545
546             if (rsq32<rcutoff2)
547             {
548
549             /* REACTION-FIELD ELECTROSTATICS */
550             velec            = qq32*(rinv32+krf*rsq32-crf);
551             felec            = qq32*(rinv32*rinvsq32-krf2);
552
553             /* Update potential sums from outer loop */
554             velecsum        += velec;
555
556             fscal            = felec;
557
558             /* Calculate temporary vectorial force */
559             tx               = fscal*dx32;
560             ty               = fscal*dy32;
561             tz               = fscal*dz32;
562
563             /* Update vectorial force */
564             fix3            += tx;
565             fiy3            += ty;
566             fiz3            += tz;
567             f[j_coord_offset+DIM*2+XX] -= tx;
568             f[j_coord_offset+DIM*2+YY] -= ty;
569             f[j_coord_offset+DIM*2+ZZ] -= tz;
570
571             }
572
573             /**************************
574              * CALCULATE INTERACTIONS *
575              **************************/
576
577             if (rsq33<rcutoff2)
578             {
579
580             /* REACTION-FIELD ELECTROSTATICS */
581             velec            = qq33*(rinv33+krf*rsq33-crf);
582             felec            = qq33*(rinv33*rinvsq33-krf2);
583
584             /* Update potential sums from outer loop */
585             velecsum        += velec;
586
587             fscal            = felec;
588
589             /* Calculate temporary vectorial force */
590             tx               = fscal*dx33;
591             ty               = fscal*dy33;
592             tz               = fscal*dz33;
593
594             /* Update vectorial force */
595             fix3            += tx;
596             fiy3            += ty;
597             fiz3            += tz;
598             f[j_coord_offset+DIM*3+XX] -= tx;
599             f[j_coord_offset+DIM*3+YY] -= ty;
600             f[j_coord_offset+DIM*3+ZZ] -= tz;
601
602             }
603
604             /* Inner loop uses 316 flops */
605         }
606         /* End of innermost loop */
607
608         tx = ty = tz = 0;
609         f[i_coord_offset+DIM*0+XX] += fix0;
610         f[i_coord_offset+DIM*0+YY] += fiy0;
611         f[i_coord_offset+DIM*0+ZZ] += fiz0;
612         tx                         += fix0;
613         ty                         += fiy0;
614         tz                         += fiz0;
615         f[i_coord_offset+DIM*1+XX] += fix1;
616         f[i_coord_offset+DIM*1+YY] += fiy1;
617         f[i_coord_offset+DIM*1+ZZ] += fiz1;
618         tx                         += fix1;
619         ty                         += fiy1;
620         tz                         += fiz1;
621         f[i_coord_offset+DIM*2+XX] += fix2;
622         f[i_coord_offset+DIM*2+YY] += fiy2;
623         f[i_coord_offset+DIM*2+ZZ] += fiz2;
624         tx                         += fix2;
625         ty                         += fiy2;
626         tz                         += fiz2;
627         f[i_coord_offset+DIM*3+XX] += fix3;
628         f[i_coord_offset+DIM*3+YY] += fiy3;
629         f[i_coord_offset+DIM*3+ZZ] += fiz3;
630         tx                         += fix3;
631         ty                         += fiy3;
632         tz                         += fiz3;
633         fshift[i_shift_offset+XX]  += tx;
634         fshift[i_shift_offset+YY]  += ty;
635         fshift[i_shift_offset+ZZ]  += tz;
636
637         ggid                        = gid[iidx];
638         /* Update potential energies */
639         kernel_data->energygrp_elec[ggid] += velecsum;
640         kernel_data->energygrp_vdw[ggid] += vvdwsum;
641
642         /* Increment number of inner iterations */
643         inneriter                  += j_index_end - j_index_start;
644
645         /* Outer loop uses 41 flops */
646     }
647
648     /* Increment number of outer iterations */
649     outeriter        += nri;
650
651     /* Update outer/inner flops */
652
653     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4W4_VF,outeriter*41 + inneriter*316);
654 }
655 /*
656  * Gromacs nonbonded kernel:   nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_F_c
657  * Electrostatics interaction: ReactionField
658  * VdW interaction:            LennardJones
659  * Geometry:                   Water4-Water4
660  * Calculate force/pot:        Force
661  */
662 void
663 nb_kernel_ElecRFCut_VdwLJSh_GeomW4W4_F_c
664                     (t_nblist                    * gmx_restrict       nlist,
665                      rvec                        * gmx_restrict          xx,
666                      rvec                        * gmx_restrict          ff,
667                      t_forcerec                  * gmx_restrict          fr,
668                      t_mdatoms                   * gmx_restrict     mdatoms,
669                      nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
670                      t_nrnb                      * gmx_restrict        nrnb)
671 {
672     int              i_shift_offset,i_coord_offset,j_coord_offset;
673     int              j_index_start,j_index_end;
674     int              nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
675     real             shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
676     int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
677     real             *shiftvec,*fshift,*x,*f;
678     int              vdwioffset0;
679     real             ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
680     int              vdwioffset1;
681     real             ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
682     int              vdwioffset2;
683     real             ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
684     int              vdwioffset3;
685     real             ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
686     int              vdwjidx0;
687     real             jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
688     int              vdwjidx1;
689     real             jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
690     int              vdwjidx2;
691     real             jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
692     int              vdwjidx3;
693     real             jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3;
694     real             dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
695     real             dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
696     real             dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
697     real             dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13,cexp1_13,cexp2_13;
698     real             dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
699     real             dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
700     real             dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23,cexp1_23,cexp2_23;
701     real             dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31,cexp1_31,cexp2_31;
702     real             dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32,cexp1_32,cexp2_32;
703     real             dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33,cexp1_33,cexp2_33;
704     real             velec,felec,velecsum,facel,crf,krf,krf2;
705     real             *charge;
706     int              nvdwtype;
707     real             rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
708     int              *vdwtype;
709     real             *vdwparam;
710
711     x                = xx[0];
712     f                = ff[0];
713
714     nri              = nlist->nri;
715     iinr             = nlist->iinr;
716     jindex           = nlist->jindex;
717     jjnr             = nlist->jjnr;
718     shiftidx         = nlist->shift;
719     gid              = nlist->gid;
720     shiftvec         = fr->shift_vec[0];
721     fshift           = fr->fshift[0];
722     facel            = fr->epsfac;
723     charge           = mdatoms->chargeA;
724     krf              = fr->ic->k_rf;
725     krf2             = krf*2.0;
726     crf              = fr->ic->c_rf;
727     nvdwtype         = fr->ntype;
728     vdwparam         = fr->nbfp;
729     vdwtype          = mdatoms->typeA;
730
731     /* Setup water-specific parameters */
732     inr              = nlist->iinr[0];
733     iq1              = facel*charge[inr+1];
734     iq2              = facel*charge[inr+2];
735     iq3              = facel*charge[inr+3];
736     vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
737
738     jq1              = charge[inr+1];
739     jq2              = charge[inr+2];
740     jq3              = charge[inr+3];
741     vdwjidx0         = 2*vdwtype[inr+0];
742     c6_00            = vdwparam[vdwioffset0+vdwjidx0];
743     c12_00           = vdwparam[vdwioffset0+vdwjidx0+1];
744     qq11             = iq1*jq1;
745     qq12             = iq1*jq2;
746     qq13             = iq1*jq3;
747     qq21             = iq2*jq1;
748     qq22             = iq2*jq2;
749     qq23             = iq2*jq3;
750     qq31             = iq3*jq1;
751     qq32             = iq3*jq2;
752     qq33             = iq3*jq3;
753
754     /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
755     rcutoff          = fr->rcoulomb;
756     rcutoff2         = rcutoff*rcutoff;
757
758     sh_vdw_invrcut6  = fr->ic->sh_invrc6;
759     rvdw             = fr->rvdw;
760
761     outeriter        = 0;
762     inneriter        = 0;
763
764     /* Start outer loop over neighborlists */
765     for(iidx=0; iidx<nri; iidx++)
766     {
767         /* Load shift vector for this list */
768         i_shift_offset   = DIM*shiftidx[iidx];
769         shX              = shiftvec[i_shift_offset+XX];
770         shY              = shiftvec[i_shift_offset+YY];
771         shZ              = shiftvec[i_shift_offset+ZZ];
772
773         /* Load limits for loop over neighbors */
774         j_index_start    = jindex[iidx];
775         j_index_end      = jindex[iidx+1];
776
777         /* Get outer coordinate index */
778         inr              = iinr[iidx];
779         i_coord_offset   = DIM*inr;
780
781         /* Load i particle coords and add shift vector */
782         ix0              = shX + x[i_coord_offset+DIM*0+XX];
783         iy0              = shY + x[i_coord_offset+DIM*0+YY];
784         iz0              = shZ + x[i_coord_offset+DIM*0+ZZ];
785         ix1              = shX + x[i_coord_offset+DIM*1+XX];
786         iy1              = shY + x[i_coord_offset+DIM*1+YY];
787         iz1              = shZ + x[i_coord_offset+DIM*1+ZZ];
788         ix2              = shX + x[i_coord_offset+DIM*2+XX];
789         iy2              = shY + x[i_coord_offset+DIM*2+YY];
790         iz2              = shZ + x[i_coord_offset+DIM*2+ZZ];
791         ix3              = shX + x[i_coord_offset+DIM*3+XX];
792         iy3              = shY + x[i_coord_offset+DIM*3+YY];
793         iz3              = shZ + x[i_coord_offset+DIM*3+ZZ];
794
795         fix0             = 0.0;
796         fiy0             = 0.0;
797         fiz0             = 0.0;
798         fix1             = 0.0;
799         fiy1             = 0.0;
800         fiz1             = 0.0;
801         fix2             = 0.0;
802         fiy2             = 0.0;
803         fiz2             = 0.0;
804         fix3             = 0.0;
805         fiy3             = 0.0;
806         fiz3             = 0.0;
807
808         /* Start inner kernel loop */
809         for(jidx=j_index_start; jidx<j_index_end; jidx++)
810         {
811             /* Get j neighbor index, and coordinate index */
812             jnr              = jjnr[jidx];
813             j_coord_offset   = DIM*jnr;
814
815             /* load j atom coordinates */
816             jx0              = x[j_coord_offset+DIM*0+XX];
817             jy0              = x[j_coord_offset+DIM*0+YY];
818             jz0              = x[j_coord_offset+DIM*0+ZZ];
819             jx1              = x[j_coord_offset+DIM*1+XX];
820             jy1              = x[j_coord_offset+DIM*1+YY];
821             jz1              = x[j_coord_offset+DIM*1+ZZ];
822             jx2              = x[j_coord_offset+DIM*2+XX];
823             jy2              = x[j_coord_offset+DIM*2+YY];
824             jz2              = x[j_coord_offset+DIM*2+ZZ];
825             jx3              = x[j_coord_offset+DIM*3+XX];
826             jy3              = x[j_coord_offset+DIM*3+YY];
827             jz3              = x[j_coord_offset+DIM*3+ZZ];
828
829             /* Calculate displacement vector */
830             dx00             = ix0 - jx0;
831             dy00             = iy0 - jy0;
832             dz00             = iz0 - jz0;
833             dx11             = ix1 - jx1;
834             dy11             = iy1 - jy1;
835             dz11             = iz1 - jz1;
836             dx12             = ix1 - jx2;
837             dy12             = iy1 - jy2;
838             dz12             = iz1 - jz2;
839             dx13             = ix1 - jx3;
840             dy13             = iy1 - jy3;
841             dz13             = iz1 - jz3;
842             dx21             = ix2 - jx1;
843             dy21             = iy2 - jy1;
844             dz21             = iz2 - jz1;
845             dx22             = ix2 - jx2;
846             dy22             = iy2 - jy2;
847             dz22             = iz2 - jz2;
848             dx23             = ix2 - jx3;
849             dy23             = iy2 - jy3;
850             dz23             = iz2 - jz3;
851             dx31             = ix3 - jx1;
852             dy31             = iy3 - jy1;
853             dz31             = iz3 - jz1;
854             dx32             = ix3 - jx2;
855             dy32             = iy3 - jy2;
856             dz32             = iz3 - jz2;
857             dx33             = ix3 - jx3;
858             dy33             = iy3 - jy3;
859             dz33             = iz3 - jz3;
860
861             /* Calculate squared distance and things based on it */
862             rsq00            = dx00*dx00+dy00*dy00+dz00*dz00;
863             rsq11            = dx11*dx11+dy11*dy11+dz11*dz11;
864             rsq12            = dx12*dx12+dy12*dy12+dz12*dz12;
865             rsq13            = dx13*dx13+dy13*dy13+dz13*dz13;
866             rsq21            = dx21*dx21+dy21*dy21+dz21*dz21;
867             rsq22            = dx22*dx22+dy22*dy22+dz22*dz22;
868             rsq23            = dx23*dx23+dy23*dy23+dz23*dz23;
869             rsq31            = dx31*dx31+dy31*dy31+dz31*dz31;
870             rsq32            = dx32*dx32+dy32*dy32+dz32*dz32;
871             rsq33            = dx33*dx33+dy33*dy33+dz33*dz33;
872
873             rinv11           = gmx_invsqrt(rsq11);
874             rinv12           = gmx_invsqrt(rsq12);
875             rinv13           = gmx_invsqrt(rsq13);
876             rinv21           = gmx_invsqrt(rsq21);
877             rinv22           = gmx_invsqrt(rsq22);
878             rinv23           = gmx_invsqrt(rsq23);
879             rinv31           = gmx_invsqrt(rsq31);
880             rinv32           = gmx_invsqrt(rsq32);
881             rinv33           = gmx_invsqrt(rsq33);
882
883             rinvsq00         = 1.0/rsq00;
884             rinvsq11         = rinv11*rinv11;
885             rinvsq12         = rinv12*rinv12;
886             rinvsq13         = rinv13*rinv13;
887             rinvsq21         = rinv21*rinv21;
888             rinvsq22         = rinv22*rinv22;
889             rinvsq23         = rinv23*rinv23;
890             rinvsq31         = rinv31*rinv31;
891             rinvsq32         = rinv32*rinv32;
892             rinvsq33         = rinv33*rinv33;
893
894             /**************************
895              * CALCULATE INTERACTIONS *
896              **************************/
897
898             if (rsq00<rcutoff2)
899             {
900
901             /* LENNARD-JONES DISPERSION/REPULSION */
902
903             rinvsix          = rinvsq00*rinvsq00*rinvsq00;
904             fvdw             = (c12_00*rinvsix-c6_00)*rinvsix*rinvsq00;
905
906             fscal            = fvdw;
907
908             /* Calculate temporary vectorial force */
909             tx               = fscal*dx00;
910             ty               = fscal*dy00;
911             tz               = fscal*dz00;
912
913             /* Update vectorial force */
914             fix0            += tx;
915             fiy0            += ty;
916             fiz0            += tz;
917             f[j_coord_offset+DIM*0+XX] -= tx;
918             f[j_coord_offset+DIM*0+YY] -= ty;
919             f[j_coord_offset+DIM*0+ZZ] -= tz;
920
921             }
922
923             /**************************
924              * CALCULATE INTERACTIONS *
925              **************************/
926
927             if (rsq11<rcutoff2)
928             {
929
930             /* REACTION-FIELD ELECTROSTATICS */
931             felec            = qq11*(rinv11*rinvsq11-krf2);
932
933             fscal            = felec;
934
935             /* Calculate temporary vectorial force */
936             tx               = fscal*dx11;
937             ty               = fscal*dy11;
938             tz               = fscal*dz11;
939
940             /* Update vectorial force */
941             fix1            += tx;
942             fiy1            += ty;
943             fiz1            += tz;
944             f[j_coord_offset+DIM*1+XX] -= tx;
945             f[j_coord_offset+DIM*1+YY] -= ty;
946             f[j_coord_offset+DIM*1+ZZ] -= tz;
947
948             }
949
950             /**************************
951              * CALCULATE INTERACTIONS *
952              **************************/
953
954             if (rsq12<rcutoff2)
955             {
956
957             /* REACTION-FIELD ELECTROSTATICS */
958             felec            = qq12*(rinv12*rinvsq12-krf2);
959
960             fscal            = felec;
961
962             /* Calculate temporary vectorial force */
963             tx               = fscal*dx12;
964             ty               = fscal*dy12;
965             tz               = fscal*dz12;
966
967             /* Update vectorial force */
968             fix1            += tx;
969             fiy1            += ty;
970             fiz1            += tz;
971             f[j_coord_offset+DIM*2+XX] -= tx;
972             f[j_coord_offset+DIM*2+YY] -= ty;
973             f[j_coord_offset+DIM*2+ZZ] -= tz;
974
975             }
976
977             /**************************
978              * CALCULATE INTERACTIONS *
979              **************************/
980
981             if (rsq13<rcutoff2)
982             {
983
984             /* REACTION-FIELD ELECTROSTATICS */
985             felec            = qq13*(rinv13*rinvsq13-krf2);
986
987             fscal            = felec;
988
989             /* Calculate temporary vectorial force */
990             tx               = fscal*dx13;
991             ty               = fscal*dy13;
992             tz               = fscal*dz13;
993
994             /* Update vectorial force */
995             fix1            += tx;
996             fiy1            += ty;
997             fiz1            += tz;
998             f[j_coord_offset+DIM*3+XX] -= tx;
999             f[j_coord_offset+DIM*3+YY] -= ty;
1000             f[j_coord_offset+DIM*3+ZZ] -= tz;
1001
1002             }
1003
1004             /**************************
1005              * CALCULATE INTERACTIONS *
1006              **************************/
1007
1008             if (rsq21<rcutoff2)
1009             {
1010
1011             /* REACTION-FIELD ELECTROSTATICS */
1012             felec            = qq21*(rinv21*rinvsq21-krf2);
1013
1014             fscal            = felec;
1015
1016             /* Calculate temporary vectorial force */
1017             tx               = fscal*dx21;
1018             ty               = fscal*dy21;
1019             tz               = fscal*dz21;
1020
1021             /* Update vectorial force */
1022             fix2            += tx;
1023             fiy2            += ty;
1024             fiz2            += tz;
1025             f[j_coord_offset+DIM*1+XX] -= tx;
1026             f[j_coord_offset+DIM*1+YY] -= ty;
1027             f[j_coord_offset+DIM*1+ZZ] -= tz;
1028
1029             }
1030
1031             /**************************
1032              * CALCULATE INTERACTIONS *
1033              **************************/
1034
1035             if (rsq22<rcutoff2)
1036             {
1037
1038             /* REACTION-FIELD ELECTROSTATICS */
1039             felec            = qq22*(rinv22*rinvsq22-krf2);
1040
1041             fscal            = felec;
1042
1043             /* Calculate temporary vectorial force */
1044             tx               = fscal*dx22;
1045             ty               = fscal*dy22;
1046             tz               = fscal*dz22;
1047
1048             /* Update vectorial force */
1049             fix2            += tx;
1050             fiy2            += ty;
1051             fiz2            += tz;
1052             f[j_coord_offset+DIM*2+XX] -= tx;
1053             f[j_coord_offset+DIM*2+YY] -= ty;
1054             f[j_coord_offset+DIM*2+ZZ] -= tz;
1055
1056             }
1057
1058             /**************************
1059              * CALCULATE INTERACTIONS *
1060              **************************/
1061
1062             if (rsq23<rcutoff2)
1063             {
1064
1065             /* REACTION-FIELD ELECTROSTATICS */
1066             felec            = qq23*(rinv23*rinvsq23-krf2);
1067
1068             fscal            = felec;
1069
1070             /* Calculate temporary vectorial force */
1071             tx               = fscal*dx23;
1072             ty               = fscal*dy23;
1073             tz               = fscal*dz23;
1074
1075             /* Update vectorial force */
1076             fix2            += tx;
1077             fiy2            += ty;
1078             fiz2            += tz;
1079             f[j_coord_offset+DIM*3+XX] -= tx;
1080             f[j_coord_offset+DIM*3+YY] -= ty;
1081             f[j_coord_offset+DIM*3+ZZ] -= tz;
1082
1083             }
1084
1085             /**************************
1086              * CALCULATE INTERACTIONS *
1087              **************************/
1088
1089             if (rsq31<rcutoff2)
1090             {
1091
1092             /* REACTION-FIELD ELECTROSTATICS */
1093             felec            = qq31*(rinv31*rinvsq31-krf2);
1094
1095             fscal            = felec;
1096
1097             /* Calculate temporary vectorial force */
1098             tx               = fscal*dx31;
1099             ty               = fscal*dy31;
1100             tz               = fscal*dz31;
1101
1102             /* Update vectorial force */
1103             fix3            += tx;
1104             fiy3            += ty;
1105             fiz3            += tz;
1106             f[j_coord_offset+DIM*1+XX] -= tx;
1107             f[j_coord_offset+DIM*1+YY] -= ty;
1108             f[j_coord_offset+DIM*1+ZZ] -= tz;
1109
1110             }
1111
1112             /**************************
1113              * CALCULATE INTERACTIONS *
1114              **************************/
1115
1116             if (rsq32<rcutoff2)
1117             {
1118
1119             /* REACTION-FIELD ELECTROSTATICS */
1120             felec            = qq32*(rinv32*rinvsq32-krf2);
1121
1122             fscal            = felec;
1123
1124             /* Calculate temporary vectorial force */
1125             tx               = fscal*dx32;
1126             ty               = fscal*dy32;
1127             tz               = fscal*dz32;
1128
1129             /* Update vectorial force */
1130             fix3            += tx;
1131             fiy3            += ty;
1132             fiz3            += tz;
1133             f[j_coord_offset+DIM*2+XX] -= tx;
1134             f[j_coord_offset+DIM*2+YY] -= ty;
1135             f[j_coord_offset+DIM*2+ZZ] -= tz;
1136
1137             }
1138
1139             /**************************
1140              * CALCULATE INTERACTIONS *
1141              **************************/
1142
1143             if (rsq33<rcutoff2)
1144             {
1145
1146             /* REACTION-FIELD ELECTROSTATICS */
1147             felec            = qq33*(rinv33*rinvsq33-krf2);
1148
1149             fscal            = felec;
1150
1151             /* Calculate temporary vectorial force */
1152             tx               = fscal*dx33;
1153             ty               = fscal*dy33;
1154             tz               = fscal*dz33;
1155
1156             /* Update vectorial force */
1157             fix3            += tx;
1158             fiy3            += ty;
1159             fiz3            += tz;
1160             f[j_coord_offset+DIM*3+XX] -= tx;
1161             f[j_coord_offset+DIM*3+YY] -= ty;
1162             f[j_coord_offset+DIM*3+ZZ] -= tz;
1163
1164             }
1165
1166             /* Inner loop uses 261 flops */
1167         }
1168         /* End of innermost loop */
1169
1170         tx = ty = tz = 0;
1171         f[i_coord_offset+DIM*0+XX] += fix0;
1172         f[i_coord_offset+DIM*0+YY] += fiy0;
1173         f[i_coord_offset+DIM*0+ZZ] += fiz0;
1174         tx                         += fix0;
1175         ty                         += fiy0;
1176         tz                         += fiz0;
1177         f[i_coord_offset+DIM*1+XX] += fix1;
1178         f[i_coord_offset+DIM*1+YY] += fiy1;
1179         f[i_coord_offset+DIM*1+ZZ] += fiz1;
1180         tx                         += fix1;
1181         ty                         += fiy1;
1182         tz                         += fiz1;
1183         f[i_coord_offset+DIM*2+XX] += fix2;
1184         f[i_coord_offset+DIM*2+YY] += fiy2;
1185         f[i_coord_offset+DIM*2+ZZ] += fiz2;
1186         tx                         += fix2;
1187         ty                         += fiy2;
1188         tz                         += fiz2;
1189         f[i_coord_offset+DIM*3+XX] += fix3;
1190         f[i_coord_offset+DIM*3+YY] += fiy3;
1191         f[i_coord_offset+DIM*3+ZZ] += fiz3;
1192         tx                         += fix3;
1193         ty                         += fiy3;
1194         tz                         += fiz3;
1195         fshift[i_shift_offset+XX]  += tx;
1196         fshift[i_shift_offset+YY]  += ty;
1197         fshift[i_shift_offset+ZZ]  += tz;
1198
1199         /* Increment number of inner iterations */
1200         inneriter                  += j_index_end - j_index_start;
1201
1202         /* Outer loop uses 39 flops */
1203     }
1204
1205     /* Increment number of outer iterations */
1206     outeriter        += nri;
1207
1208     /* Update outer/inner flops */
1209
1210     inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4W4_F,outeriter*39 + inneriter*261);
1211 }