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