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.
42 #include "../nb_kernel.h"
43 #include "types/simple.h"
44 #include "gromacs/math/vec.h"
48 * Gromacs nonbonded kernel: nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_VF_c
49 * Electrostatics interaction: Ewald
50 * VdW interaction: LJEwald
51 * Geometry: Water4-Particle
52 * Calculate force/pot: PotentialAndForce
55 nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_VF_c
56 (t_nblist * gmx_restrict nlist,
57 rvec * gmx_restrict xx,
58 rvec * gmx_restrict ff,
59 t_forcerec * gmx_restrict fr,
60 t_mdatoms * gmx_restrict mdatoms,
61 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
62 t_nrnb * gmx_restrict nrnb)
64 int i_shift_offset,i_coord_offset,j_coord_offset;
65 int j_index_start,j_index_end;
66 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
67 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
68 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
69 real *shiftvec,*fshift,*x,*f;
71 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
73 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
75 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
77 real ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
79 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
80 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
81 real dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
82 real dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
83 real dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30,cexp1_30,cexp2_30;
84 real velec,felec,velecsum,facel,crf,krf,krf2;
87 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
94 real ewclj,ewclj2,ewclj6,ewcljrsq,poly,exponent,sh_lj_ewald;
97 real ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace;
105 jindex = nlist->jindex;
107 shiftidx = nlist->shift;
109 shiftvec = fr->shift_vec[0];
110 fshift = fr->fshift[0];
112 charge = mdatoms->chargeA;
113 nvdwtype = fr->ntype;
115 vdwtype = mdatoms->typeA;
116 vdwgridparam = fr->ljpme_c6grid;
117 ewclj = fr->ewaldcoeff_lj;
118 sh_lj_ewald = fr->ic->sh_lj_ewald;
119 ewclj2 = ewclj*ewclj;
120 ewclj6 = ewclj2*ewclj2*ewclj2;
122 sh_ewald = fr->ic->sh_ewald;
123 ewtab = fr->ic->tabq_coul_FDV0;
124 ewtabscale = fr->ic->tabq_scale;
125 ewtabhalfspace = 0.5/ewtabscale;
127 /* Setup water-specific parameters */
128 inr = nlist->iinr[0];
129 iq1 = facel*charge[inr+1];
130 iq2 = facel*charge[inr+2];
131 iq3 = facel*charge[inr+3];
132 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
134 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
135 rcutoff = fr->rcoulomb;
136 rcutoff2 = rcutoff*rcutoff;
138 sh_vdw_invrcut6 = fr->ic->sh_invrc6;
144 /* Start outer loop over neighborlists */
145 for(iidx=0; iidx<nri; iidx++)
147 /* Load shift vector for this list */
148 i_shift_offset = DIM*shiftidx[iidx];
149 shX = shiftvec[i_shift_offset+XX];
150 shY = shiftvec[i_shift_offset+YY];
151 shZ = shiftvec[i_shift_offset+ZZ];
153 /* Load limits for loop over neighbors */
154 j_index_start = jindex[iidx];
155 j_index_end = jindex[iidx+1];
157 /* Get outer coordinate index */
159 i_coord_offset = DIM*inr;
161 /* Load i particle coords and add shift vector */
162 ix0 = shX + x[i_coord_offset+DIM*0+XX];
163 iy0 = shY + x[i_coord_offset+DIM*0+YY];
164 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
165 ix1 = shX + x[i_coord_offset+DIM*1+XX];
166 iy1 = shY + x[i_coord_offset+DIM*1+YY];
167 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
168 ix2 = shX + x[i_coord_offset+DIM*2+XX];
169 iy2 = shY + x[i_coord_offset+DIM*2+YY];
170 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
171 ix3 = shX + x[i_coord_offset+DIM*3+XX];
172 iy3 = shY + x[i_coord_offset+DIM*3+YY];
173 iz3 = shZ + x[i_coord_offset+DIM*3+ZZ];
188 /* Reset potential sums */
192 /* Start inner kernel loop */
193 for(jidx=j_index_start; jidx<j_index_end; jidx++)
195 /* Get j neighbor index, and coordinate index */
197 j_coord_offset = DIM*jnr;
199 /* load j atom coordinates */
200 jx0 = x[j_coord_offset+DIM*0+XX];
201 jy0 = x[j_coord_offset+DIM*0+YY];
202 jz0 = x[j_coord_offset+DIM*0+ZZ];
204 /* Calculate displacement vector */
218 /* Calculate squared distance and things based on it */
219 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
220 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
221 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
222 rsq30 = dx30*dx30+dy30*dy30+dz30*dz30;
224 rinv00 = gmx_invsqrt(rsq00);
225 rinv10 = gmx_invsqrt(rsq10);
226 rinv20 = gmx_invsqrt(rsq20);
227 rinv30 = gmx_invsqrt(rsq30);
229 rinvsq00 = rinv00*rinv00;
230 rinvsq10 = rinv10*rinv10;
231 rinvsq20 = rinv20*rinv20;
232 rinvsq30 = rinv30*rinv30;
234 /* Load parameters for j particles */
236 vdwjidx0 = 2*vdwtype[jnr+0];
238 /**************************
239 * CALCULATE INTERACTIONS *
240 **************************/
247 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
248 c12_00 = vdwparam[vdwioffset0+vdwjidx0+1];
249 c6grid_00 = vdwgridparam[vdwioffset0+vdwjidx0];
251 rinvsix = rinvsq00*rinvsq00*rinvsq00;
252 ewcljrsq = ewclj2*rsq00;
253 exponent = exp(-ewcljrsq);
254 poly = exponent*(1.0 + ewcljrsq + ewcljrsq*ewcljrsq*0.5);
255 vvdw6 = (c6_00-c6grid_00*(1.0-poly))*rinvsix;
256 vvdw12 = c12_00*rinvsix*rinvsix;
257 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);
258 fvdw = (vvdw12 - vvdw6 - c6grid_00*(1.0/6.0)*exponent*ewclj6)*rinvsq00;
260 /* Update potential sums from outer loop */
265 /* Calculate temporary vectorial force */
270 /* Update vectorial force */
274 f[j_coord_offset+DIM*0+XX] -= tx;
275 f[j_coord_offset+DIM*0+YY] -= ty;
276 f[j_coord_offset+DIM*0+ZZ] -= tz;
280 /**************************
281 * CALCULATE INTERACTIONS *
282 **************************/
291 /* EWALD ELECTROSTATICS */
293 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
294 ewrt = r10*ewtabscale;
298 felec = ewtab[ewitab]+eweps*ewtab[ewitab+1];
299 velec = qq10*((rinv10-sh_ewald)-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
300 felec = qq10*rinv10*(rinvsq10-felec);
302 /* Update potential sums from outer loop */
307 /* Calculate temporary vectorial force */
312 /* Update vectorial force */
316 f[j_coord_offset+DIM*0+XX] -= tx;
317 f[j_coord_offset+DIM*0+YY] -= ty;
318 f[j_coord_offset+DIM*0+ZZ] -= tz;
322 /**************************
323 * CALCULATE INTERACTIONS *
324 **************************/
333 /* EWALD ELECTROSTATICS */
335 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
336 ewrt = r20*ewtabscale;
340 felec = ewtab[ewitab]+eweps*ewtab[ewitab+1];
341 velec = qq20*((rinv20-sh_ewald)-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
342 felec = qq20*rinv20*(rinvsq20-felec);
344 /* Update potential sums from outer loop */
349 /* Calculate temporary vectorial force */
354 /* Update vectorial force */
358 f[j_coord_offset+DIM*0+XX] -= tx;
359 f[j_coord_offset+DIM*0+YY] -= ty;
360 f[j_coord_offset+DIM*0+ZZ] -= tz;
364 /**************************
365 * CALCULATE INTERACTIONS *
366 **************************/
375 /* EWALD ELECTROSTATICS */
377 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
378 ewrt = r30*ewtabscale;
382 felec = ewtab[ewitab]+eweps*ewtab[ewitab+1];
383 velec = qq30*((rinv30-sh_ewald)-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
384 felec = qq30*rinv30*(rinvsq30-felec);
386 /* Update potential sums from outer loop */
391 /* Calculate temporary vectorial force */
396 /* Update vectorial force */
400 f[j_coord_offset+DIM*0+XX] -= tx;
401 f[j_coord_offset+DIM*0+YY] -= ty;
402 f[j_coord_offset+DIM*0+ZZ] -= tz;
406 /* Inner loop uses 181 flops */
408 /* End of innermost loop */
411 f[i_coord_offset+DIM*0+XX] += fix0;
412 f[i_coord_offset+DIM*0+YY] += fiy0;
413 f[i_coord_offset+DIM*0+ZZ] += fiz0;
417 f[i_coord_offset+DIM*1+XX] += fix1;
418 f[i_coord_offset+DIM*1+YY] += fiy1;
419 f[i_coord_offset+DIM*1+ZZ] += fiz1;
423 f[i_coord_offset+DIM*2+XX] += fix2;
424 f[i_coord_offset+DIM*2+YY] += fiy2;
425 f[i_coord_offset+DIM*2+ZZ] += fiz2;
429 f[i_coord_offset+DIM*3+XX] += fix3;
430 f[i_coord_offset+DIM*3+YY] += fiy3;
431 f[i_coord_offset+DIM*3+ZZ] += fiz3;
435 fshift[i_shift_offset+XX] += tx;
436 fshift[i_shift_offset+YY] += ty;
437 fshift[i_shift_offset+ZZ] += tz;
440 /* Update potential energies */
441 kernel_data->energygrp_elec[ggid] += velecsum;
442 kernel_data->energygrp_vdw[ggid] += vvdwsum;
444 /* Increment number of inner iterations */
445 inneriter += j_index_end - j_index_start;
447 /* Outer loop uses 41 flops */
450 /* Increment number of outer iterations */
453 /* Update outer/inner flops */
455 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_VF,outeriter*41 + inneriter*181);
458 * Gromacs nonbonded kernel: nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_F_c
459 * Electrostatics interaction: Ewald
460 * VdW interaction: LJEwald
461 * Geometry: Water4-Particle
462 * Calculate force/pot: Force
465 nb_kernel_ElecEwSh_VdwLJEwSh_GeomW4P1_F_c
466 (t_nblist * gmx_restrict nlist,
467 rvec * gmx_restrict xx,
468 rvec * gmx_restrict ff,
469 t_forcerec * gmx_restrict fr,
470 t_mdatoms * gmx_restrict mdatoms,
471 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
472 t_nrnb * gmx_restrict nrnb)
474 int i_shift_offset,i_coord_offset,j_coord_offset;
475 int j_index_start,j_index_end;
476 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
477 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
478 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
479 real *shiftvec,*fshift,*x,*f;
481 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
483 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
485 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
487 real ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
489 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
490 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
491 real dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
492 real dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
493 real dx30,dy30,dz30,rsq30,rinv30,rinvsq30,r30,qq30,c6_30,c12_30,cexp1_30,cexp2_30;
494 real velec,felec,velecsum,facel,crf,krf,krf2;
497 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
504 real ewclj,ewclj2,ewclj6,ewcljrsq,poly,exponent,sh_lj_ewald;
507 real ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace;
515 jindex = nlist->jindex;
517 shiftidx = nlist->shift;
519 shiftvec = fr->shift_vec[0];
520 fshift = fr->fshift[0];
522 charge = mdatoms->chargeA;
523 nvdwtype = fr->ntype;
525 vdwtype = mdatoms->typeA;
526 vdwgridparam = fr->ljpme_c6grid;
527 ewclj = fr->ewaldcoeff_lj;
528 sh_lj_ewald = fr->ic->sh_lj_ewald;
529 ewclj2 = ewclj*ewclj;
530 ewclj6 = ewclj2*ewclj2*ewclj2;
532 sh_ewald = fr->ic->sh_ewald;
533 ewtab = fr->ic->tabq_coul_F;
534 ewtabscale = fr->ic->tabq_scale;
535 ewtabhalfspace = 0.5/ewtabscale;
537 /* Setup water-specific parameters */
538 inr = nlist->iinr[0];
539 iq1 = facel*charge[inr+1];
540 iq2 = facel*charge[inr+2];
541 iq3 = facel*charge[inr+3];
542 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
544 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
545 rcutoff = fr->rcoulomb;
546 rcutoff2 = rcutoff*rcutoff;
548 sh_vdw_invrcut6 = fr->ic->sh_invrc6;
554 /* Start outer loop over neighborlists */
555 for(iidx=0; iidx<nri; iidx++)
557 /* Load shift vector for this list */
558 i_shift_offset = DIM*shiftidx[iidx];
559 shX = shiftvec[i_shift_offset+XX];
560 shY = shiftvec[i_shift_offset+YY];
561 shZ = shiftvec[i_shift_offset+ZZ];
563 /* Load limits for loop over neighbors */
564 j_index_start = jindex[iidx];
565 j_index_end = jindex[iidx+1];
567 /* Get outer coordinate index */
569 i_coord_offset = DIM*inr;
571 /* Load i particle coords and add shift vector */
572 ix0 = shX + x[i_coord_offset+DIM*0+XX];
573 iy0 = shY + x[i_coord_offset+DIM*0+YY];
574 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
575 ix1 = shX + x[i_coord_offset+DIM*1+XX];
576 iy1 = shY + x[i_coord_offset+DIM*1+YY];
577 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
578 ix2 = shX + x[i_coord_offset+DIM*2+XX];
579 iy2 = shY + x[i_coord_offset+DIM*2+YY];
580 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
581 ix3 = shX + x[i_coord_offset+DIM*3+XX];
582 iy3 = shY + x[i_coord_offset+DIM*3+YY];
583 iz3 = shZ + x[i_coord_offset+DIM*3+ZZ];
598 /* Start inner kernel loop */
599 for(jidx=j_index_start; jidx<j_index_end; jidx++)
601 /* Get j neighbor index, and coordinate index */
603 j_coord_offset = DIM*jnr;
605 /* load j atom coordinates */
606 jx0 = x[j_coord_offset+DIM*0+XX];
607 jy0 = x[j_coord_offset+DIM*0+YY];
608 jz0 = x[j_coord_offset+DIM*0+ZZ];
610 /* Calculate displacement vector */
624 /* Calculate squared distance and things based on it */
625 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
626 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
627 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
628 rsq30 = dx30*dx30+dy30*dy30+dz30*dz30;
630 rinv00 = gmx_invsqrt(rsq00);
631 rinv10 = gmx_invsqrt(rsq10);
632 rinv20 = gmx_invsqrt(rsq20);
633 rinv30 = gmx_invsqrt(rsq30);
635 rinvsq00 = rinv00*rinv00;
636 rinvsq10 = rinv10*rinv10;
637 rinvsq20 = rinv20*rinv20;
638 rinvsq30 = rinv30*rinv30;
640 /* Load parameters for j particles */
642 vdwjidx0 = 2*vdwtype[jnr+0];
644 /**************************
645 * CALCULATE INTERACTIONS *
646 **************************/
653 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
654 c12_00 = vdwparam[vdwioffset0+vdwjidx0+1];
655 c6grid_00 = vdwgridparam[vdwioffset0+vdwjidx0];
657 rinvsix = rinvsq00*rinvsq00*rinvsq00;
658 ewcljrsq = ewclj2*rsq00;
659 exponent = exp(-ewcljrsq);
660 poly = exponent*(1.0 + ewcljrsq + ewcljrsq*ewcljrsq*0.5);
661 fvdw = (((c12_00*rinvsix - c6_00 + c6grid_00*(1.0-poly))*rinvsix) - c6grid_00*(1.0/6.0)*exponent*ewclj6)*rinvsq00;
665 /* Calculate temporary vectorial force */
670 /* Update vectorial force */
674 f[j_coord_offset+DIM*0+XX] -= tx;
675 f[j_coord_offset+DIM*0+YY] -= ty;
676 f[j_coord_offset+DIM*0+ZZ] -= tz;
680 /**************************
681 * CALCULATE INTERACTIONS *
682 **************************/
691 /* EWALD ELECTROSTATICS */
693 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
694 ewrt = r10*ewtabscale;
697 felec = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
698 felec = qq10*rinv10*(rinvsq10-felec);
702 /* Calculate temporary vectorial force */
707 /* Update vectorial force */
711 f[j_coord_offset+DIM*0+XX] -= tx;
712 f[j_coord_offset+DIM*0+YY] -= ty;
713 f[j_coord_offset+DIM*0+ZZ] -= tz;
717 /**************************
718 * CALCULATE INTERACTIONS *
719 **************************/
728 /* EWALD ELECTROSTATICS */
730 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
731 ewrt = r20*ewtabscale;
734 felec = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
735 felec = qq20*rinv20*(rinvsq20-felec);
739 /* Calculate temporary vectorial force */
744 /* Update vectorial force */
748 f[j_coord_offset+DIM*0+XX] -= tx;
749 f[j_coord_offset+DIM*0+YY] -= ty;
750 f[j_coord_offset+DIM*0+ZZ] -= tz;
754 /**************************
755 * CALCULATE INTERACTIONS *
756 **************************/
765 /* EWALD ELECTROSTATICS */
767 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
768 ewrt = r30*ewtabscale;
771 felec = (1.0-eweps)*ewtab[ewitab]+eweps*ewtab[ewitab+1];
772 felec = qq30*rinv30*(rinvsq30-felec);
776 /* Calculate temporary vectorial force */
781 /* Update vectorial force */
785 f[j_coord_offset+DIM*0+XX] -= tx;
786 f[j_coord_offset+DIM*0+YY] -= ty;
787 f[j_coord_offset+DIM*0+ZZ] -= tz;
791 /* Inner loop uses 146 flops */
793 /* End of innermost loop */
796 f[i_coord_offset+DIM*0+XX] += fix0;
797 f[i_coord_offset+DIM*0+YY] += fiy0;
798 f[i_coord_offset+DIM*0+ZZ] += fiz0;
802 f[i_coord_offset+DIM*1+XX] += fix1;
803 f[i_coord_offset+DIM*1+YY] += fiy1;
804 f[i_coord_offset+DIM*1+ZZ] += fiz1;
808 f[i_coord_offset+DIM*2+XX] += fix2;
809 f[i_coord_offset+DIM*2+YY] += fiy2;
810 f[i_coord_offset+DIM*2+ZZ] += fiz2;
814 f[i_coord_offset+DIM*3+XX] += fix3;
815 f[i_coord_offset+DIM*3+YY] += fiy3;
816 f[i_coord_offset+DIM*3+ZZ] += fiz3;
820 fshift[i_shift_offset+XX] += tx;
821 fshift[i_shift_offset+YY] += ty;
822 fshift[i_shift_offset+ZZ] += tz;
824 /* Increment number of inner iterations */
825 inneriter += j_index_end - j_index_start;
827 /* Outer loop uses 39 flops */
830 /* Increment number of outer iterations */
833 /* Update outer/inner flops */
835 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4_F,outeriter*39 + inneriter*146);