2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
36 * Note: this file was generated by the GROMACS c kernel generator.
44 #include "../nb_kernel.h"
45 #include "gromacs/legacyheaders/types/simple.h"
46 #include "gromacs/math/vec.h"
47 #include "gromacs/legacyheaders/nrnb.h"
50 * Gromacs nonbonded kernel: nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_VF_c
51 * Electrostatics interaction: Ewald
52 * VdW interaction: LJEwald
53 * Geometry: Water4-Particle
54 * Calculate force/pot: PotentialAndForce
57 nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_VF_c
58 (t_nblist * gmx_restrict nlist,
59 rvec * gmx_restrict xx,
60 rvec * gmx_restrict ff,
61 t_forcerec * gmx_restrict fr,
62 t_mdatoms * gmx_restrict mdatoms,
63 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
64 t_nrnb * gmx_restrict nrnb)
66 int i_shift_offset,i_coord_offset,j_coord_offset;
67 int j_index_start,j_index_end;
68 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
69 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
70 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
71 real *shiftvec,*fshift,*x,*f;
73 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
75 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
77 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
79 real ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
81 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
82 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
83 real dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
84 real dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
85 real dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30,cexp1_30,cexp2_30;
86 real velec,felec,velecsum,facel,crf,krf,krf2;
89 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
96 real ewclj,ewclj2,ewclj6,ewcljrsq,poly,exponent,sh_lj_ewald;
99 real ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace;
107 jindex = nlist->jindex;
109 shiftidx = nlist->shift;
111 shiftvec = fr->shift_vec[0];
112 fshift = fr->fshift[0];
114 charge = mdatoms->chargeA;
115 nvdwtype = fr->ntype;
117 vdwtype = mdatoms->typeA;
118 vdwgridparam = fr->ljpme_c6grid;
119 ewclj = fr->ewaldcoeff_lj;
120 sh_lj_ewald = fr->ic->sh_lj_ewald;
121 ewclj2 = ewclj*ewclj;
122 ewclj6 = ewclj2*ewclj2*ewclj2;
124 sh_ewald = fr->ic->sh_ewald;
125 ewtab = fr->ic->tabq_coul_FDV0;
126 ewtabscale = fr->ic->tabq_scale;
127 ewtabhalfspace = 0.5/ewtabscale;
129 /* Setup water-specific parameters */
130 inr = nlist->iinr[0];
131 iq1 = facel*charge[inr+1];
132 iq2 = facel*charge[inr+2];
133 iq3 = facel*charge[inr+3];
134 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
136 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
137 rcutoff = fr->rcoulomb;
138 rcutoff2 = rcutoff*rcutoff;
140 sh_vdw_invrcut6 = fr->ic->sh_invrc6;
146 /* Start outer loop over neighborlists */
147 for(iidx=0; iidx<nri; iidx++)
149 /* Load shift vector for this list */
150 i_shift_offset = DIM*shiftidx[iidx];
151 shX = shiftvec[i_shift_offset+XX];
152 shY = shiftvec[i_shift_offset+YY];
153 shZ = shiftvec[i_shift_offset+ZZ];
155 /* Load limits for loop over neighbors */
156 j_index_start = jindex[iidx];
157 j_index_end = jindex[iidx+1];
159 /* Get outer coordinate index */
161 i_coord_offset = DIM*inr;
163 /* Load i particle coords and add shift vector */
164 ix0 = shX + x[i_coord_offset+DIM*0+XX];
165 iy0 = shY + x[i_coord_offset+DIM*0+YY];
166 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
167 ix1 = shX + x[i_coord_offset+DIM*1+XX];
168 iy1 = shY + x[i_coord_offset+DIM*1+YY];
169 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
170 ix2 = shX + x[i_coord_offset+DIM*2+XX];
171 iy2 = shY + x[i_coord_offset+DIM*2+YY];
172 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
173 ix3 = shX + x[i_coord_offset+DIM*3+XX];
174 iy3 = shY + x[i_coord_offset+DIM*3+YY];
175 iz3 = shZ + x[i_coord_offset+DIM*3+ZZ];
190 /* Reset potential sums */
194 /* Start inner kernel loop */
195 for(jidx=j_index_start; jidx<j_index_end; jidx++)
197 /* Get j neighbor index, and coordinate index */
199 j_coord_offset = DIM*jnr;
201 /* load j atom coordinates */
202 jx0 = x[j_coord_offset+DIM*0+XX];
203 jy0 = x[j_coord_offset+DIM*0+YY];
204 jz0 = x[j_coord_offset+DIM*0+ZZ];
206 /* Calculate displacement vector */
220 /* Calculate squared distance and things based on it */
221 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
222 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
223 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
224 rsq30 = dx30*dx30+dy30*dy30+dz30*dz30;
226 rinv00 = gmx_invsqrt(rsq00);
227 rinv10 = gmx_invsqrt(rsq10);
228 rinv20 = gmx_invsqrt(rsq20);
229 rinv30 = gmx_invsqrt(rsq30);
231 rinvsq00 = rinv00*rinv00;
232 rinvsq10 = rinv10*rinv10;
233 rinvsq20 = rinv20*rinv20;
234 rinvsq30 = rinv30*rinv30;
236 /* Load parameters for j particles */
238 vdwjidx0 = 2*vdwtype[jnr+0];
240 /**************************
241 * CALCULATE INTERACTIONS *
242 **************************/
249 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
250 c12_00 = vdwparam[vdwioffset0+vdwjidx0+1];
251 c6grid_00 = vdwgridparam[vdwioffset0+vdwjidx0];
253 rinvsix = rinvsq00*rinvsq00*rinvsq00;
254 ewcljrsq = ewclj2*rsq00;
255 exponent = exp(-ewcljrsq);
256 poly = exponent*(1.0 + ewcljrsq + ewcljrsq*ewcljrsq*0.5);
257 vvdw6 = (c6_00-c6grid_00*(1.0-poly))*rinvsix;
258 vvdw12 = c12_00*rinvsix*rinvsix;
259 vvdw = (vvdw12 - c12_00*sh_vdw_invrcut6*sh_vdw_invrcut6)*(1.0/12.0) - (vvdw6 - c6_00*sh_vdw_invrcut6 - c6grid_00*sh_lj_ewald)*(1.0/6.0);
260 fvdw = (vvdw12 - vvdw6 - c6grid_00*(1.0/6.0)*exponent*ewclj6)*rinvsq00;
262 /* Update potential sums from outer loop */
267 /* Calculate temporary vectorial force */
272 /* Update vectorial force */
276 f[j_coord_offset+DIM*0+XX] -= tx;
277 f[j_coord_offset+DIM*0+YY] -= ty;
278 f[j_coord_offset+DIM*0+ZZ] -= tz;
282 /**************************
283 * CALCULATE INTERACTIONS *
284 **************************/
293 /* EWALD ELECTROSTATICS */
295 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
296 ewrt = r10*ewtabscale;
300 felec = ewtab[ewitab]+eweps*ewtab[ewitab+1];
301 velec = qq10*((rinv10-sh_ewald)-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
302 felec = qq10*rinv10*(rinvsq10-felec);
304 /* Update potential sums from outer loop */
309 /* Calculate temporary vectorial force */
314 /* Update vectorial force */
318 f[j_coord_offset+DIM*0+XX] -= tx;
319 f[j_coord_offset+DIM*0+YY] -= ty;
320 f[j_coord_offset+DIM*0+ZZ] -= tz;
324 /**************************
325 * CALCULATE INTERACTIONS *
326 **************************/
335 /* EWALD ELECTROSTATICS */
337 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
338 ewrt = r20*ewtabscale;
342 felec = ewtab[ewitab]+eweps*ewtab[ewitab+1];
343 velec = qq20*((rinv20-sh_ewald)-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
344 felec = qq20*rinv20*(rinvsq20-felec);
346 /* Update potential sums from outer loop */
351 /* Calculate temporary vectorial force */
356 /* Update vectorial force */
360 f[j_coord_offset+DIM*0+XX] -= tx;
361 f[j_coord_offset+DIM*0+YY] -= ty;
362 f[j_coord_offset+DIM*0+ZZ] -= tz;
366 /**************************
367 * CALCULATE INTERACTIONS *
368 **************************/
377 /* EWALD ELECTROSTATICS */
379 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
380 ewrt = r30*ewtabscale;
384 felec = ewtab[ewitab]+eweps*ewtab[ewitab+1];
385 velec = qq30*((rinv30-sh_ewald)-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
386 felec = qq30*rinv30*(rinvsq30-felec);
388 /* Update potential sums from outer loop */
393 /* Calculate temporary vectorial force */
398 /* Update vectorial force */
402 f[j_coord_offset+DIM*0+XX] -= tx;
403 f[j_coord_offset+DIM*0+YY] -= ty;
404 f[j_coord_offset+DIM*0+ZZ] -= tz;
408 /* Inner loop uses 181 flops */
410 /* End of innermost loop */
413 f[i_coord_offset+DIM*0+XX] += fix0;
414 f[i_coord_offset+DIM*0+YY] += fiy0;
415 f[i_coord_offset+DIM*0+ZZ] += fiz0;
419 f[i_coord_offset+DIM*1+XX] += fix1;
420 f[i_coord_offset+DIM*1+YY] += fiy1;
421 f[i_coord_offset+DIM*1+ZZ] += fiz1;
425 f[i_coord_offset+DIM*2+XX] += fix2;
426 f[i_coord_offset+DIM*2+YY] += fiy2;
427 f[i_coord_offset+DIM*2+ZZ] += fiz2;
431 f[i_coord_offset+DIM*3+XX] += fix3;
432 f[i_coord_offset+DIM*3+YY] += fiy3;
433 f[i_coord_offset+DIM*3+ZZ] += fiz3;
437 fshift[i_shift_offset+XX] += tx;
438 fshift[i_shift_offset+YY] += ty;
439 fshift[i_shift_offset+ZZ] += tz;
442 /* Update potential energies */
443 kernel_data->energygrp_elec[ggid] += velecsum;
444 kernel_data->energygrp_vdw[ggid] += vvdwsum;
446 /* Increment number of inner iterations */
447 inneriter += j_index_end - j_index_start;
449 /* Outer loop uses 41 flops */
452 /* Increment number of outer iterations */
455 /* Update outer/inner flops */
457 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_VF,outeriter*41 + inneriter*181);
460 * Gromacs nonbonded kernel: nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_F_c
461 * Electrostatics interaction: Ewald
462 * VdW interaction: LJEwald
463 * Geometry: Water4-Particle
464 * Calculate force/pot: Force
467 nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_F_c
468 (t_nblist * gmx_restrict nlist,
469 rvec * gmx_restrict xx,
470 rvec * gmx_restrict ff,
471 t_forcerec * gmx_restrict fr,
472 t_mdatoms * gmx_restrict mdatoms,
473 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
474 t_nrnb * gmx_restrict nrnb)
476 int i_shift_offset,i_coord_offset,j_coord_offset;
477 int j_index_start,j_index_end;
478 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
479 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
480 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
481 real *shiftvec,*fshift,*x,*f;
483 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
485 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
487 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
489 real ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
491 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
492 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
493 real dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
494 real dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
495 real dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30,cexp1_30,cexp2_30;
496 real velec,felec,velecsum,facel,crf,krf,krf2;
499 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
506 real ewclj,ewclj2,ewclj6,ewcljrsq,poly,exponent,sh_lj_ewald;
509 real ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace;
517 jindex = nlist->jindex;
519 shiftidx = nlist->shift;
521 shiftvec = fr->shift_vec[0];
522 fshift = fr->fshift[0];
524 charge = mdatoms->chargeA;
525 nvdwtype = fr->ntype;
527 vdwtype = mdatoms->typeA;
528 vdwgridparam = fr->ljpme_c6grid;
529 ewclj = fr->ewaldcoeff_lj;
530 sh_lj_ewald = fr->ic->sh_lj_ewald;
531 ewclj2 = ewclj*ewclj;
532 ewclj6 = ewclj2*ewclj2*ewclj2;
534 sh_ewald = fr->ic->sh_ewald;
535 ewtab = fr->ic->tabq_coul_F;
536 ewtabscale = fr->ic->tabq_scale;
537 ewtabhalfspace = 0.5/ewtabscale;
539 /* Setup water-specific parameters */
540 inr = nlist->iinr[0];
541 iq1 = facel*charge[inr+1];
542 iq2 = facel*charge[inr+2];
543 iq3 = facel*charge[inr+3];
544 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
546 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
547 rcutoff = fr->rcoulomb;
548 rcutoff2 = rcutoff*rcutoff;
550 sh_vdw_invrcut6 = fr->ic->sh_invrc6;
556 /* Start outer loop over neighborlists */
557 for(iidx=0; iidx<nri; iidx++)
559 /* Load shift vector for this list */
560 i_shift_offset = DIM*shiftidx[iidx];
561 shX = shiftvec[i_shift_offset+XX];
562 shY = shiftvec[i_shift_offset+YY];
563 shZ = shiftvec[i_shift_offset+ZZ];
565 /* Load limits for loop over neighbors */
566 j_index_start = jindex[iidx];
567 j_index_end = jindex[iidx+1];
569 /* Get outer coordinate index */
571 i_coord_offset = DIM*inr;
573 /* Load i particle coords and add shift vector */
574 ix0 = shX + x[i_coord_offset+DIM*0+XX];
575 iy0 = shY + x[i_coord_offset+DIM*0+YY];
576 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
577 ix1 = shX + x[i_coord_offset+DIM*1+XX];
578 iy1 = shY + x[i_coord_offset+DIM*1+YY];
579 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
580 ix2 = shX + x[i_coord_offset+DIM*2+XX];
581 iy2 = shY + x[i_coord_offset+DIM*2+YY];
582 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
583 ix3 = shX + x[i_coord_offset+DIM*3+XX];
584 iy3 = shY + x[i_coord_offset+DIM*3+YY];
585 iz3 = shZ + x[i_coord_offset+DIM*3+ZZ];
600 /* Start inner kernel loop */
601 for(jidx=j_index_start; jidx<j_index_end; jidx++)
603 /* Get j neighbor index, and coordinate index */
605 j_coord_offset = DIM*jnr;
607 /* load j atom coordinates */
608 jx0 = x[j_coord_offset+DIM*0+XX];
609 jy0 = x[j_coord_offset+DIM*0+YY];
610 jz0 = x[j_coord_offset+DIM*0+ZZ];
612 /* Calculate displacement vector */
626 /* Calculate squared distance and things based on it */
627 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
628 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
629 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
630 rsq30 = dx30*dx30+dy30*dy30+dz30*dz30;
632 rinv00 = gmx_invsqrt(rsq00);
633 rinv10 = gmx_invsqrt(rsq10);
634 rinv20 = gmx_invsqrt(rsq20);
635 rinv30 = gmx_invsqrt(rsq30);
637 rinvsq00 = rinv00*rinv00;
638 rinvsq10 = rinv10*rinv10;
639 rinvsq20 = rinv20*rinv20;
640 rinvsq30 = rinv30*rinv30;
642 /* Load parameters for j particles */
644 vdwjidx0 = 2*vdwtype[jnr+0];
646 /**************************
647 * CALCULATE INTERACTIONS *
648 **************************/
655 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
656 c12_00 = vdwparam[vdwioffset0+vdwjidx0+1];
657 c6grid_00 = vdwgridparam[vdwioffset0+vdwjidx0];
659 rinvsix = rinvsq00*rinvsq00*rinvsq00;
660 ewcljrsq = ewclj2*rsq00;
661 exponent = exp(-ewcljrsq);
662 poly = exponent*(1.0 + ewcljrsq + ewcljrsq*ewcljrsq*0.5);
663 fvdw = (((c12_00*rinvsix - c6_00 + c6grid_00*(1.0-poly))*rinvsix) - c6grid_00*(1.0/6.0)*exponent*ewclj6)*rinvsq00;
667 /* Calculate temporary vectorial force */
672 /* Update vectorial force */
676 f[j_coord_offset+DIM*0+XX] -= tx;
677 f[j_coord_offset+DIM*0+YY] -= ty;
678 f[j_coord_offset+DIM*0+ZZ] -= tz;
682 /**************************
683 * CALCULATE INTERACTIONS *
684 **************************/
693 /* EWALD ELECTROSTATICS */
695 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
696 ewrt = r10*ewtabscale;
699 felec = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
700 felec = qq10*rinv10*(rinvsq10-felec);
704 /* Calculate temporary vectorial force */
709 /* Update vectorial force */
713 f[j_coord_offset+DIM*0+XX] -= tx;
714 f[j_coord_offset+DIM*0+YY] -= ty;
715 f[j_coord_offset+DIM*0+ZZ] -= tz;
719 /**************************
720 * CALCULATE INTERACTIONS *
721 **************************/
730 /* EWALD ELECTROSTATICS */
732 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
733 ewrt = r20*ewtabscale;
736 felec = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
737 felec = qq20*rinv20*(rinvsq20-felec);
741 /* Calculate temporary vectorial force */
746 /* Update vectorial force */
750 f[j_coord_offset+DIM*0+XX] -= tx;
751 f[j_coord_offset+DIM*0+YY] -= ty;
752 f[j_coord_offset+DIM*0+ZZ] -= tz;
756 /**************************
757 * CALCULATE INTERACTIONS *
758 **************************/
767 /* EWALD ELECTROSTATICS */
769 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
770 ewrt = r30*ewtabscale;
773 felec = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
774 felec = qq30*rinv30*(rinvsq30-felec);
778 /* Calculate temporary vectorial force */
783 /* Update vectorial force */
787 f[j_coord_offset+DIM*0+XX] -= tx;
788 f[j_coord_offset+DIM*0+YY] -= ty;
789 f[j_coord_offset+DIM*0+ZZ] -= tz;
793 /* Inner loop uses 146 flops */
795 /* End of innermost loop */
798 f[i_coord_offset+DIM*0+XX] += fix0;
799 f[i_coord_offset+DIM*0+YY] += fiy0;
800 f[i_coord_offset+DIM*0+ZZ] += fiz0;
804 f[i_coord_offset+DIM*1+XX] += fix1;
805 f[i_coord_offset+DIM*1+YY] += fiy1;
806 f[i_coord_offset+DIM*1+ZZ] += fiz1;
810 f[i_coord_offset+DIM*2+XX] += fix2;
811 f[i_coord_offset+DIM*2+YY] += fiy2;
812 f[i_coord_offset+DIM*2+ZZ] += fiz2;
816 f[i_coord_offset+DIM*3+XX] += fix3;
817 f[i_coord_offset+DIM*3+YY] += fiy3;
818 f[i_coord_offset+DIM*3+ZZ] += fiz3;
822 fshift[i_shift_offset+XX] += tx;
823 fshift[i_shift_offset+YY] += ty;
824 fshift[i_shift_offset+ZZ] += tz;
826 /* Increment number of inner iterations */
827 inneriter += j_index_end - j_index_start;
829 /* Outer loop uses 39 flops */
832 /* Increment number of outer iterations */
835 /* Update outer/inner flops */
837 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_F,outeriter*39 + inneriter*146);