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