6565b719663389f21b41ebfd99364120bdebd36e
[alexxy/gromacs.git] / src / gmxlib / nonbonded / nb_kernel_c / nb_kernel_ElecEwSh_VdwNone_GeomW4W4_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_GeomW4W4_VF_c
35  * Electrostatics interaction: Ewald
36  * VdW interaction:            None
37  * Geometry:                   Water4-Water4
38  * Calculate force/pot:        PotentialAndForce
39  */
40 void
41 nb_kernel_ElecEwSh_VdwNone_GeomW4W4_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              vdwioffset1;
57     real             ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
58     int              vdwioffset2;
59     real             ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
60     int              vdwioffset3;
61     real             ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
62     int              vdwjidx1;
63     real             jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
64     int              vdwjidx2;
65     real             jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
66     int              vdwjidx3;
67     real             jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3;
68     real             dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
69     real             dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
70     real             dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13,cexp1_13,cexp2_13;
71     real             dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
72     real             dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
73     real             dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23,cexp1_23,cexp2_23;
74     real             dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31,cexp1_31,cexp2_31;
75     real             dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32,cexp1_32,cexp2_32;
76     real             dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33,cexp1_33,cexp2_33;
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     iq1              = facel*charge[inr+1];
105     iq2              = facel*charge[inr+2];
106     iq3              = facel*charge[inr+3];
107
108     jq1              = charge[inr+1];
109     jq2              = charge[inr+2];
110     jq3              = charge[inr+3];
111     qq11             = iq1*jq1;
112     qq12             = iq1*jq2;
113     qq13             = iq1*jq3;
114     qq21             = iq2*jq1;
115     qq22             = iq2*jq2;
116     qq23             = iq2*jq3;
117     qq31             = iq3*jq1;
118     qq32             = iq3*jq2;
119     qq33             = iq3*jq3;
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         ix1              = shX + x[i_coord_offset+DIM*1+XX];
147         iy1              = shY + x[i_coord_offset+DIM*1+YY];
148         iz1              = shZ + x[i_coord_offset+DIM*1+ZZ];
149         ix2              = shX + x[i_coord_offset+DIM*2+XX];
150         iy2              = shY + x[i_coord_offset+DIM*2+YY];
151         iz2              = shZ + x[i_coord_offset+DIM*2+ZZ];
152         ix3              = shX + x[i_coord_offset+DIM*3+XX];
153         iy3              = shY + x[i_coord_offset+DIM*3+YY];
154         iz3              = shZ + x[i_coord_offset+DIM*3+ZZ];
155
156         fix1             = 0.0;
157         fiy1             = 0.0;
158         fiz1             = 0.0;
159         fix2             = 0.0;
160         fiy2             = 0.0;
161         fiz2             = 0.0;
162         fix3             = 0.0;
163         fiy3             = 0.0;
164         fiz3             = 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             jx1              = x[j_coord_offset+DIM*1+XX];
178             jy1              = x[j_coord_offset+DIM*1+YY];
179             jz1              = x[j_coord_offset+DIM*1+ZZ];
180             jx2              = x[j_coord_offset+DIM*2+XX];
181             jy2              = x[j_coord_offset+DIM*2+YY];
182             jz2              = x[j_coord_offset+DIM*2+ZZ];
183             jx3              = x[j_coord_offset+DIM*3+XX];
184             jy3              = x[j_coord_offset+DIM*3+YY];
185             jz3              = x[j_coord_offset+DIM*3+ZZ];
186
187             /* Calculate displacement vector */
188             dx11             = ix1 - jx1;
189             dy11             = iy1 - jy1;
190             dz11             = iz1 - jz1;
191             dx12             = ix1 - jx2;
192             dy12             = iy1 - jy2;
193             dz12             = iz1 - jz2;
194             dx13             = ix1 - jx3;
195             dy13             = iy1 - jy3;
196             dz13             = iz1 - jz3;
197             dx21             = ix2 - jx1;
198             dy21             = iy2 - jy1;
199             dz21             = iz2 - jz1;
200             dx22             = ix2 - jx2;
201             dy22             = iy2 - jy2;
202             dz22             = iz2 - jz2;
203             dx23             = ix2 - jx3;
204             dy23             = iy2 - jy3;
205             dz23             = iz2 - jz3;
206             dx31             = ix3 - jx1;
207             dy31             = iy3 - jy1;
208             dz31             = iz3 - jz1;
209             dx32             = ix3 - jx2;
210             dy32             = iy3 - jy2;
211             dz32             = iz3 - jz2;
212             dx33             = ix3 - jx3;
213             dy33             = iy3 - jy3;
214             dz33             = iz3 - jz3;
215
216             /* Calculate squared distance and things based on it */
217             rsq11            = dx11*dx11+dy11*dy11+dz11*dz11;
218             rsq12            = dx12*dx12+dy12*dy12+dz12*dz12;
219             rsq13            = dx13*dx13+dy13*dy13+dz13*dz13;
220             rsq21            = dx21*dx21+dy21*dy21+dz21*dz21;
221             rsq22            = dx22*dx22+dy22*dy22+dz22*dz22;
222             rsq23            = dx23*dx23+dy23*dy23+dz23*dz23;
223             rsq31            = dx31*dx31+dy31*dy31+dz31*dz31;
224             rsq32            = dx32*dx32+dy32*dy32+dz32*dz32;
225             rsq33            = dx33*dx33+dy33*dy33+dz33*dz33;
226
227             rinv11           = gmx_invsqrt(rsq11);
228             rinv12           = gmx_invsqrt(rsq12);
229             rinv13           = gmx_invsqrt(rsq13);
230             rinv21           = gmx_invsqrt(rsq21);
231             rinv22           = gmx_invsqrt(rsq22);
232             rinv23           = gmx_invsqrt(rsq23);
233             rinv31           = gmx_invsqrt(rsq31);
234             rinv32           = gmx_invsqrt(rsq32);
235             rinv33           = gmx_invsqrt(rsq33);
236
237             rinvsq11         = rinv11*rinv11;
238             rinvsq12         = rinv12*rinv12;
239             rinvsq13         = rinv13*rinv13;
240             rinvsq21         = rinv21*rinv21;
241             rinvsq22         = rinv22*rinv22;
242             rinvsq23         = rinv23*rinv23;
243             rinvsq31         = rinv31*rinv31;
244             rinvsq32         = rinv32*rinv32;
245             rinvsq33         = rinv33*rinv33;
246
247             /**************************
248              * CALCULATE INTERACTIONS *
249              **************************/
250
251             if (rsq11<rcutoff2)
252             {
253
254             r11              = rsq11*rinv11;
255
256             /* EWALD ELECTROSTATICS */
257
258             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
259             ewrt             = r11*ewtabscale;
260             ewitab           = ewrt;
261             eweps            = ewrt-ewitab;
262             ewitab           = 4*ewitab;
263             felec            = ewtab[ewitab]+eweps*ewtab[ewitab+1];
264             velec            = qq11*((rinv11-sh_ewald)-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
265             felec            = qq11*rinv11*(rinvsq11-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*dx11;
274             ty               = fscal*dy11;
275             tz               = fscal*dz11;
276
277             /* Update vectorial force */
278             fix1            += tx;
279             fiy1            += ty;
280             fiz1            += tz;
281             f[j_coord_offset+DIM*1+XX] -= tx;
282             f[j_coord_offset+DIM*1+YY] -= ty;
283             f[j_coord_offset+DIM*1+ZZ] -= tz;
284
285             }
286
287             /**************************
288              * CALCULATE INTERACTIONS *
289              **************************/
290
291             if (rsq12<rcutoff2)
292             {
293
294             r12              = rsq12*rinv12;
295
296             /* EWALD ELECTROSTATICS */
297
298             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
299             ewrt             = r12*ewtabscale;
300             ewitab           = ewrt;
301             eweps            = ewrt-ewitab;
302             ewitab           = 4*ewitab;
303             felec            = ewtab[ewitab]+eweps*ewtab[ewitab+1];
304             velec            = qq12*((rinv12-sh_ewald)-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
305             felec            = qq12*rinv12*(rinvsq12-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*dx12;
314             ty               = fscal*dy12;
315             tz               = fscal*dz12;
316
317             /* Update vectorial force */
318             fix1            += tx;
319             fiy1            += ty;
320             fiz1            += tz;
321             f[j_coord_offset+DIM*2+XX] -= tx;
322             f[j_coord_offset+DIM*2+YY] -= ty;
323             f[j_coord_offset+DIM*2+ZZ] -= tz;
324
325             }
326
327             /**************************
328              * CALCULATE INTERACTIONS *
329              **************************/
330
331             if (rsq13<rcutoff2)
332             {
333
334             r13              = rsq13*rinv13;
335
336             /* EWALD ELECTROSTATICS */
337
338             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
339             ewrt             = r13*ewtabscale;
340             ewitab           = ewrt;
341             eweps            = ewrt-ewitab;
342             ewitab           = 4*ewitab;
343             felec            = ewtab[ewitab]+eweps*ewtab[ewitab+1];
344             velec            = qq13*((rinv13-sh_ewald)-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
345             felec            = qq13*rinv13*(rinvsq13-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*dx13;
354             ty               = fscal*dy13;
355             tz               = fscal*dz13;
356
357             /* Update vectorial force */
358             fix1            += tx;
359             fiy1            += ty;
360             fiz1            += tz;
361             f[j_coord_offset+DIM*3+XX] -= tx;
362             f[j_coord_offset+DIM*3+YY] -= ty;
363             f[j_coord_offset+DIM*3+ZZ] -= tz;
364
365             }
366
367             /**************************
368              * CALCULATE INTERACTIONS *
369              **************************/
370
371             if (rsq21<rcutoff2)
372             {
373
374             r21              = rsq21*rinv21;
375
376             /* EWALD ELECTROSTATICS */
377
378             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
379             ewrt             = r21*ewtabscale;
380             ewitab           = ewrt;
381             eweps            = ewrt-ewitab;
382             ewitab           = 4*ewitab;
383             felec            = ewtab[ewitab]+eweps*ewtab[ewitab+1];
384             velec            = qq21*((rinv21-sh_ewald)-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
385             felec            = qq21*rinv21*(rinvsq21-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*dx21;
394             ty               = fscal*dy21;
395             tz               = fscal*dz21;
396
397             /* Update vectorial force */
398             fix2            += tx;
399             fiy2            += ty;
400             fiz2            += tz;
401             f[j_coord_offset+DIM*1+XX] -= tx;
402             f[j_coord_offset+DIM*1+YY] -= ty;
403             f[j_coord_offset+DIM*1+ZZ] -= tz;
404
405             }
406
407             /**************************
408              * CALCULATE INTERACTIONS *
409              **************************/
410
411             if (rsq22<rcutoff2)
412             {
413
414             r22              = rsq22*rinv22;
415
416             /* EWALD ELECTROSTATICS */
417
418             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
419             ewrt             = r22*ewtabscale;
420             ewitab           = ewrt;
421             eweps            = ewrt-ewitab;
422             ewitab           = 4*ewitab;
423             felec            = ewtab[ewitab]+eweps*ewtab[ewitab+1];
424             velec            = qq22*((rinv22-sh_ewald)-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
425             felec            = qq22*rinv22*(rinvsq22-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*dx22;
434             ty               = fscal*dy22;
435             tz               = fscal*dz22;
436
437             /* Update vectorial force */
438             fix2            += tx;
439             fiy2            += ty;
440             fiz2            += tz;
441             f[j_coord_offset+DIM*2+XX] -= tx;
442             f[j_coord_offset+DIM*2+YY] -= ty;
443             f[j_coord_offset+DIM*2+ZZ] -= tz;
444
445             }
446
447             /**************************
448              * CALCULATE INTERACTIONS *
449              **************************/
450
451             if (rsq23<rcutoff2)
452             {
453
454             r23              = rsq23*rinv23;
455
456             /* EWALD ELECTROSTATICS */
457
458             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
459             ewrt             = r23*ewtabscale;
460             ewitab           = ewrt;
461             eweps            = ewrt-ewitab;
462             ewitab           = 4*ewitab;
463             felec            = ewtab[ewitab]+eweps*ewtab[ewitab+1];
464             velec            = qq23*((rinv23-sh_ewald)-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
465             felec            = qq23*rinv23*(rinvsq23-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*dx23;
474             ty               = fscal*dy23;
475             tz               = fscal*dz23;
476
477             /* Update vectorial force */
478             fix2            += tx;
479             fiy2            += ty;
480             fiz2            += tz;
481             f[j_coord_offset+DIM*3+XX] -= tx;
482             f[j_coord_offset+DIM*3+YY] -= ty;
483             f[j_coord_offset+DIM*3+ZZ] -= tz;
484
485             }
486
487             /**************************
488              * CALCULATE INTERACTIONS *
489              **************************/
490
491             if (rsq31<rcutoff2)
492             {
493
494             r31              = rsq31*rinv31;
495
496             /* EWALD ELECTROSTATICS */
497
498             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
499             ewrt             = r31*ewtabscale;
500             ewitab           = ewrt;
501             eweps            = ewrt-ewitab;
502             ewitab           = 4*ewitab;
503             felec            = ewtab[ewitab]+eweps*ewtab[ewitab+1];
504             velec            = qq31*((rinv31-sh_ewald)-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
505             felec            = qq31*rinv31*(rinvsq31-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*dx31;
514             ty               = fscal*dy31;
515             tz               = fscal*dz31;
516
517             /* Update vectorial force */
518             fix3            += tx;
519             fiy3            += ty;
520             fiz3            += tz;
521             f[j_coord_offset+DIM*1+XX] -= tx;
522             f[j_coord_offset+DIM*1+YY] -= ty;
523             f[j_coord_offset+DIM*1+ZZ] -= tz;
524
525             }
526
527             /**************************
528              * CALCULATE INTERACTIONS *
529              **************************/
530
531             if (rsq32<rcutoff2)
532             {
533
534             r32              = rsq32*rinv32;
535
536             /* EWALD ELECTROSTATICS */
537
538             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
539             ewrt             = r32*ewtabscale;
540             ewitab           = ewrt;
541             eweps            = ewrt-ewitab;
542             ewitab           = 4*ewitab;
543             felec            = ewtab[ewitab]+eweps*ewtab[ewitab+1];
544             velec            = qq32*((rinv32-sh_ewald)-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
545             felec            = qq32*rinv32*(rinvsq32-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*dx32;
554             ty               = fscal*dy32;
555             tz               = fscal*dz32;
556
557             /* Update vectorial force */
558             fix3            += tx;
559             fiy3            += ty;
560             fiz3            += tz;
561             f[j_coord_offset+DIM*2+XX] -= tx;
562             f[j_coord_offset+DIM*2+YY] -= ty;
563             f[j_coord_offset+DIM*2+ZZ] -= tz;
564
565             }
566
567             /**************************
568              * CALCULATE INTERACTIONS *
569              **************************/
570
571             if (rsq33<rcutoff2)
572             {
573
574             r33              = rsq33*rinv33;
575
576             /* EWALD ELECTROSTATICS */
577
578             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
579             ewrt             = r33*ewtabscale;
580             ewitab           = ewrt;
581             eweps            = ewrt-ewitab;
582             ewitab           = 4*ewitab;
583             felec            = ewtab[ewitab]+eweps*ewtab[ewitab+1];
584             velec            = qq33*((rinv33-sh_ewald)-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
585             felec            = qq33*rinv33*(rinvsq33-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*dx33;
594             ty               = fscal*dy33;
595             tz               = fscal*dz33;
596
597             /* Update vectorial force */
598             fix3            += tx;
599             fiy3            += ty;
600             fiz3            += tz;
601             f[j_coord_offset+DIM*3+XX] -= tx;
602             f[j_coord_offset+DIM*3+YY] -= ty;
603             f[j_coord_offset+DIM*3+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*1+XX] += fix1;
613         f[i_coord_offset+DIM*1+YY] += fiy1;
614         f[i_coord_offset+DIM*1+ZZ] += fiz1;
615         tx                         += fix1;
616         ty                         += fiy1;
617         tz                         += fiz1;
618         f[i_coord_offset+DIM*2+XX] += fix2;
619         f[i_coord_offset+DIM*2+YY] += fiy2;
620         f[i_coord_offset+DIM*2+ZZ] += fiz2;
621         tx                         += fix2;
622         ty                         += fiy2;
623         tz                         += fiz2;
624         f[i_coord_offset+DIM*3+XX] += fix3;
625         f[i_coord_offset+DIM*3+YY] += fiy3;
626         f[i_coord_offset+DIM*3+ZZ] += fiz3;
627         tx                         += fix3;
628         ty                         += fiy3;
629         tz                         += fiz3;
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_W4W4_VF,outeriter*31 + inneriter*369);
650 }
651 /*
652  * Gromacs nonbonded kernel:   nb_kernel_ElecEwSh_VdwNone_GeomW4W4_F_c
653  * Electrostatics interaction: Ewald
654  * VdW interaction:            None
655  * Geometry:                   Water4-Water4
656  * Calculate force/pot:        Force
657  */
658 void
659 nb_kernel_ElecEwSh_VdwNone_GeomW4W4_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              vdwioffset1;
675     real             ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
676     int              vdwioffset2;
677     real             ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
678     int              vdwioffset3;
679     real             ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
680     int              vdwjidx1;
681     real             jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
682     int              vdwjidx2;
683     real             jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
684     int              vdwjidx3;
685     real             jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3;
686     real             dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
687     real             dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
688     real             dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13,cexp1_13,cexp2_13;
689     real             dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
690     real             dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
691     real             dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23,cexp1_23,cexp2_23;
692     real             dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31,cexp1_31,cexp2_31;
693     real             dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32,cexp1_32,cexp2_32;
694     real             dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33,cexp1_33,cexp2_33;
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     iq1              = facel*charge[inr+1];
723     iq2              = facel*charge[inr+2];
724     iq3              = facel*charge[inr+3];
725
726     jq1              = charge[inr+1];
727     jq2              = charge[inr+2];
728     jq3              = charge[inr+3];
729     qq11             = iq1*jq1;
730     qq12             = iq1*jq2;
731     qq13             = iq1*jq3;
732     qq21             = iq2*jq1;
733     qq22             = iq2*jq2;
734     qq23             = iq2*jq3;
735     qq31             = iq3*jq1;
736     qq32             = iq3*jq2;
737     qq33             = iq3*jq3;
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         ix1              = shX + x[i_coord_offset+DIM*1+XX];
765         iy1              = shY + x[i_coord_offset+DIM*1+YY];
766         iz1              = shZ + x[i_coord_offset+DIM*1+ZZ];
767         ix2              = shX + x[i_coord_offset+DIM*2+XX];
768         iy2              = shY + x[i_coord_offset+DIM*2+YY];
769         iz2              = shZ + x[i_coord_offset+DIM*2+ZZ];
770         ix3              = shX + x[i_coord_offset+DIM*3+XX];
771         iy3              = shY + x[i_coord_offset+DIM*3+YY];
772         iz3              = shZ + x[i_coord_offset+DIM*3+ZZ];
773
774         fix1             = 0.0;
775         fiy1             = 0.0;
776         fiz1             = 0.0;
777         fix2             = 0.0;
778         fiy2             = 0.0;
779         fiz2             = 0.0;
780         fix3             = 0.0;
781         fiy3             = 0.0;
782         fiz3             = 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             jx1              = x[j_coord_offset+DIM*1+XX];
793             jy1              = x[j_coord_offset+DIM*1+YY];
794             jz1              = x[j_coord_offset+DIM*1+ZZ];
795             jx2              = x[j_coord_offset+DIM*2+XX];
796             jy2              = x[j_coord_offset+DIM*2+YY];
797             jz2              = x[j_coord_offset+DIM*2+ZZ];
798             jx3              = x[j_coord_offset+DIM*3+XX];
799             jy3              = x[j_coord_offset+DIM*3+YY];
800             jz3              = x[j_coord_offset+DIM*3+ZZ];
801
802             /* Calculate displacement vector */
803             dx11             = ix1 - jx1;
804             dy11             = iy1 - jy1;
805             dz11             = iz1 - jz1;
806             dx12             = ix1 - jx2;
807             dy12             = iy1 - jy2;
808             dz12             = iz1 - jz2;
809             dx13             = ix1 - jx3;
810             dy13             = iy1 - jy3;
811             dz13             = iz1 - jz3;
812             dx21             = ix2 - jx1;
813             dy21             = iy2 - jy1;
814             dz21             = iz2 - jz1;
815             dx22             = ix2 - jx2;
816             dy22             = iy2 - jy2;
817             dz22             = iz2 - jz2;
818             dx23             = ix2 - jx3;
819             dy23             = iy2 - jy3;
820             dz23             = iz2 - jz3;
821             dx31             = ix3 - jx1;
822             dy31             = iy3 - jy1;
823             dz31             = iz3 - jz1;
824             dx32             = ix3 - jx2;
825             dy32             = iy3 - jy2;
826             dz32             = iz3 - jz2;
827             dx33             = ix3 - jx3;
828             dy33             = iy3 - jy3;
829             dz33             = iz3 - jz3;
830
831             /* Calculate squared distance and things based on it */
832             rsq11            = dx11*dx11+dy11*dy11+dz11*dz11;
833             rsq12            = dx12*dx12+dy12*dy12+dz12*dz12;
834             rsq13            = dx13*dx13+dy13*dy13+dz13*dz13;
835             rsq21            = dx21*dx21+dy21*dy21+dz21*dz21;
836             rsq22            = dx22*dx22+dy22*dy22+dz22*dz22;
837             rsq23            = dx23*dx23+dy23*dy23+dz23*dz23;
838             rsq31            = dx31*dx31+dy31*dy31+dz31*dz31;
839             rsq32            = dx32*dx32+dy32*dy32+dz32*dz32;
840             rsq33            = dx33*dx33+dy33*dy33+dz33*dz33;
841
842             rinv11           = gmx_invsqrt(rsq11);
843             rinv12           = gmx_invsqrt(rsq12);
844             rinv13           = gmx_invsqrt(rsq13);
845             rinv21           = gmx_invsqrt(rsq21);
846             rinv22           = gmx_invsqrt(rsq22);
847             rinv23           = gmx_invsqrt(rsq23);
848             rinv31           = gmx_invsqrt(rsq31);
849             rinv32           = gmx_invsqrt(rsq32);
850             rinv33           = gmx_invsqrt(rsq33);
851
852             rinvsq11         = rinv11*rinv11;
853             rinvsq12         = rinv12*rinv12;
854             rinvsq13         = rinv13*rinv13;
855             rinvsq21         = rinv21*rinv21;
856             rinvsq22         = rinv22*rinv22;
857             rinvsq23         = rinv23*rinv23;
858             rinvsq31         = rinv31*rinv31;
859             rinvsq32         = rinv32*rinv32;
860             rinvsq33         = rinv33*rinv33;
861
862             /**************************
863              * CALCULATE INTERACTIONS *
864              **************************/
865
866             if (rsq11<rcutoff2)
867             {
868
869             r11              = rsq11*rinv11;
870
871             /* EWALD ELECTROSTATICS */
872
873             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
874             ewrt             = r11*ewtabscale;
875             ewitab           = ewrt;
876             eweps            = ewrt-ewitab;
877             felec            = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
878             felec            = qq11*rinv11*(rinvsq11-felec);
879
880             fscal            = felec;
881
882             /* Calculate temporary vectorial force */
883             tx               = fscal*dx11;
884             ty               = fscal*dy11;
885             tz               = fscal*dz11;
886
887             /* Update vectorial force */
888             fix1            += tx;
889             fiy1            += ty;
890             fiz1            += tz;
891             f[j_coord_offset+DIM*1+XX] -= tx;
892             f[j_coord_offset+DIM*1+YY] -= ty;
893             f[j_coord_offset+DIM*1+ZZ] -= tz;
894
895             }
896
897             /**************************
898              * CALCULATE INTERACTIONS *
899              **************************/
900
901             if (rsq12<rcutoff2)
902             {
903
904             r12              = rsq12*rinv12;
905
906             /* EWALD ELECTROSTATICS */
907
908             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
909             ewrt             = r12*ewtabscale;
910             ewitab           = ewrt;
911             eweps            = ewrt-ewitab;
912             felec            = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
913             felec            = qq12*rinv12*(rinvsq12-felec);
914
915             fscal            = felec;
916
917             /* Calculate temporary vectorial force */
918             tx               = fscal*dx12;
919             ty               = fscal*dy12;
920             tz               = fscal*dz12;
921
922             /* Update vectorial force */
923             fix1            += tx;
924             fiy1            += ty;
925             fiz1            += tz;
926             f[j_coord_offset+DIM*2+XX] -= tx;
927             f[j_coord_offset+DIM*2+YY] -= ty;
928             f[j_coord_offset+DIM*2+ZZ] -= tz;
929
930             }
931
932             /**************************
933              * CALCULATE INTERACTIONS *
934              **************************/
935
936             if (rsq13<rcutoff2)
937             {
938
939             r13              = rsq13*rinv13;
940
941             /* EWALD ELECTROSTATICS */
942
943             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
944             ewrt             = r13*ewtabscale;
945             ewitab           = ewrt;
946             eweps            = ewrt-ewitab;
947             felec            = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
948             felec            = qq13*rinv13*(rinvsq13-felec);
949
950             fscal            = felec;
951
952             /* Calculate temporary vectorial force */
953             tx               = fscal*dx13;
954             ty               = fscal*dy13;
955             tz               = fscal*dz13;
956
957             /* Update vectorial force */
958             fix1            += tx;
959             fiy1            += ty;
960             fiz1            += tz;
961             f[j_coord_offset+DIM*3+XX] -= tx;
962             f[j_coord_offset+DIM*3+YY] -= ty;
963             f[j_coord_offset+DIM*3+ZZ] -= tz;
964
965             }
966
967             /**************************
968              * CALCULATE INTERACTIONS *
969              **************************/
970
971             if (rsq21<rcutoff2)
972             {
973
974             r21              = rsq21*rinv21;
975
976             /* EWALD ELECTROSTATICS */
977
978             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
979             ewrt             = r21*ewtabscale;
980             ewitab           = ewrt;
981             eweps            = ewrt-ewitab;
982             felec            = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
983             felec            = qq21*rinv21*(rinvsq21-felec);
984
985             fscal            = felec;
986
987             /* Calculate temporary vectorial force */
988             tx               = fscal*dx21;
989             ty               = fscal*dy21;
990             tz               = fscal*dz21;
991
992             /* Update vectorial force */
993             fix2            += tx;
994             fiy2            += ty;
995             fiz2            += tz;
996             f[j_coord_offset+DIM*1+XX] -= tx;
997             f[j_coord_offset+DIM*1+YY] -= ty;
998             f[j_coord_offset+DIM*1+ZZ] -= tz;
999
1000             }
1001
1002             /**************************
1003              * CALCULATE INTERACTIONS *
1004              **************************/
1005
1006             if (rsq22<rcutoff2)
1007             {
1008
1009             r22              = rsq22*rinv22;
1010
1011             /* EWALD ELECTROSTATICS */
1012
1013             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1014             ewrt             = r22*ewtabscale;
1015             ewitab           = ewrt;
1016             eweps            = ewrt-ewitab;
1017             felec            = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
1018             felec            = qq22*rinv22*(rinvsq22-felec);
1019
1020             fscal            = felec;
1021
1022             /* Calculate temporary vectorial force */
1023             tx               = fscal*dx22;
1024             ty               = fscal*dy22;
1025             tz               = fscal*dz22;
1026
1027             /* Update vectorial force */
1028             fix2            += tx;
1029             fiy2            += ty;
1030             fiz2            += tz;
1031             f[j_coord_offset+DIM*2+XX] -= tx;
1032             f[j_coord_offset+DIM*2+YY] -= ty;
1033             f[j_coord_offset+DIM*2+ZZ] -= tz;
1034
1035             }
1036
1037             /**************************
1038              * CALCULATE INTERACTIONS *
1039              **************************/
1040
1041             if (rsq23<rcutoff2)
1042             {
1043
1044             r23              = rsq23*rinv23;
1045
1046             /* EWALD ELECTROSTATICS */
1047
1048             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1049             ewrt             = r23*ewtabscale;
1050             ewitab           = ewrt;
1051             eweps            = ewrt-ewitab;
1052             felec            = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
1053             felec            = qq23*rinv23*(rinvsq23-felec);
1054
1055             fscal            = felec;
1056
1057             /* Calculate temporary vectorial force */
1058             tx               = fscal*dx23;
1059             ty               = fscal*dy23;
1060             tz               = fscal*dz23;
1061
1062             /* Update vectorial force */
1063             fix2            += tx;
1064             fiy2            += ty;
1065             fiz2            += tz;
1066             f[j_coord_offset+DIM*3+XX] -= tx;
1067             f[j_coord_offset+DIM*3+YY] -= ty;
1068             f[j_coord_offset+DIM*3+ZZ] -= tz;
1069
1070             }
1071
1072             /**************************
1073              * CALCULATE INTERACTIONS *
1074              **************************/
1075
1076             if (rsq31<rcutoff2)
1077             {
1078
1079             r31              = rsq31*rinv31;
1080
1081             /* EWALD ELECTROSTATICS */
1082
1083             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1084             ewrt             = r31*ewtabscale;
1085             ewitab           = ewrt;
1086             eweps            = ewrt-ewitab;
1087             felec            = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
1088             felec            = qq31*rinv31*(rinvsq31-felec);
1089
1090             fscal            = felec;
1091
1092             /* Calculate temporary vectorial force */
1093             tx               = fscal*dx31;
1094             ty               = fscal*dy31;
1095             tz               = fscal*dz31;
1096
1097             /* Update vectorial force */
1098             fix3            += tx;
1099             fiy3            += ty;
1100             fiz3            += tz;
1101             f[j_coord_offset+DIM*1+XX] -= tx;
1102             f[j_coord_offset+DIM*1+YY] -= ty;
1103             f[j_coord_offset+DIM*1+ZZ] -= tz;
1104
1105             }
1106
1107             /**************************
1108              * CALCULATE INTERACTIONS *
1109              **************************/
1110
1111             if (rsq32<rcutoff2)
1112             {
1113
1114             r32              = rsq32*rinv32;
1115
1116             /* EWALD ELECTROSTATICS */
1117
1118             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1119             ewrt             = r32*ewtabscale;
1120             ewitab           = ewrt;
1121             eweps            = ewrt-ewitab;
1122             felec            = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
1123             felec            = qq32*rinv32*(rinvsq32-felec);
1124
1125             fscal            = felec;
1126
1127             /* Calculate temporary vectorial force */
1128             tx               = fscal*dx32;
1129             ty               = fscal*dy32;
1130             tz               = fscal*dz32;
1131
1132             /* Update vectorial force */
1133             fix3            += tx;
1134             fiy3            += ty;
1135             fiz3            += tz;
1136             f[j_coord_offset+DIM*2+XX] -= tx;
1137             f[j_coord_offset+DIM*2+YY] -= ty;
1138             f[j_coord_offset+DIM*2+ZZ] -= tz;
1139
1140             }
1141
1142             /**************************
1143              * CALCULATE INTERACTIONS *
1144              **************************/
1145
1146             if (rsq33<rcutoff2)
1147             {
1148
1149             r33              = rsq33*rinv33;
1150
1151             /* EWALD ELECTROSTATICS */
1152
1153             /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
1154             ewrt             = r33*ewtabscale;
1155             ewitab           = ewrt;
1156             eweps            = ewrt-ewitab;
1157             felec            = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
1158             felec            = qq33*rinv33*(rinvsq33-felec);
1159
1160             fscal            = felec;
1161
1162             /* Calculate temporary vectorial force */
1163             tx               = fscal*dx33;
1164             ty               = fscal*dy33;
1165             tz               = fscal*dz33;
1166
1167             /* Update vectorial force */
1168             fix3            += tx;
1169             fiy3            += ty;
1170             fiz3            += tz;
1171             f[j_coord_offset+DIM*3+XX] -= tx;
1172             f[j_coord_offset+DIM*3+YY] -= ty;
1173             f[j_coord_offset+DIM*3+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*1+XX] += fix1;
1183         f[i_coord_offset+DIM*1+YY] += fiy1;
1184         f[i_coord_offset+DIM*1+ZZ] += fiz1;
1185         tx                         += fix1;
1186         ty                         += fiy1;
1187         tz                         += fiz1;
1188         f[i_coord_offset+DIM*2+XX] += fix2;
1189         f[i_coord_offset+DIM*2+YY] += fiy2;
1190         f[i_coord_offset+DIM*2+ZZ] += fiz2;
1191         tx                         += fix2;
1192         ty                         += fiy2;
1193         tz                         += fiz2;
1194         f[i_coord_offset+DIM*3+XX] += fix3;
1195         f[i_coord_offset+DIM*3+YY] += fiy3;
1196         f[i_coord_offset+DIM*3+ZZ] += fiz3;
1197         tx                         += fix3;
1198         ty                         += fiy3;
1199         tz                         += fiz3;
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_W4W4_F,outeriter*30 + inneriter*297);
1216 }