2 * Note: this file was generated by the Gromacs c kernel generator.
4 * This source code is part of
8 * Copyright (c) 2001-2012, The GROMACS Development Team
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
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
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.
28 #include "../nb_kernel.h"
29 #include "types/simple.h"
34 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_c
35 * Electrostatics interaction: Coulomb
36 * VdW interaction: CubicSplineTable
37 * Geometry: Water3-Water3
38 * Calculate force/pot: PotentialAndForce
41 nb_kernel_ElecCoul_VdwCSTab_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)
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;
57 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
59 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
61 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
63 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
65 real jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
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;
80 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
84 real rt,vfeps,vftabscale,Y,F,Geps,Heps2,Fp,VV,FF;
92 jindex = nlist->jindex;
94 shiftidx = nlist->shift;
96 shiftvec = fr->shift_vec[0];
97 fshift = fr->fshift[0];
99 charge = mdatoms->chargeA;
100 nvdwtype = fr->ntype;
102 vdwtype = mdatoms->typeA;
104 vftab = kernel_data->table_vdw->data;
105 vftabscale = kernel_data->table_vdw->scale;
107 /* Setup water-specific parameters */
108 inr = nlist->iinr[0];
109 iq0 = facel*charge[inr+0];
110 iq1 = facel*charge[inr+1];
111 iq2 = facel*charge[inr+2];
112 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
117 vdwjidx0 = 2*vdwtype[inr+0];
119 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
120 c12_00 = vdwparam[vdwioffset0+vdwjidx0+1];
133 /* Start outer loop over neighborlists */
134 for(iidx=0; iidx<nri; iidx++)
136 /* Load shift vector for this list */
137 i_shift_offset = DIM*shiftidx[iidx];
138 shX = shiftvec[i_shift_offset+XX];
139 shY = shiftvec[i_shift_offset+YY];
140 shZ = shiftvec[i_shift_offset+ZZ];
142 /* Load limits for loop over neighbors */
143 j_index_start = jindex[iidx];
144 j_index_end = jindex[iidx+1];
146 /* Get outer coordinate index */
148 i_coord_offset = DIM*inr;
150 /* Load i particle coords and add shift vector */
151 ix0 = shX + x[i_coord_offset+DIM*0+XX];
152 iy0 = shY + x[i_coord_offset+DIM*0+YY];
153 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
154 ix1 = shX + x[i_coord_offset+DIM*1+XX];
155 iy1 = shY + x[i_coord_offset+DIM*1+YY];
156 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
157 ix2 = shX + x[i_coord_offset+DIM*2+XX];
158 iy2 = shY + x[i_coord_offset+DIM*2+YY];
159 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
171 /* Reset potential sums */
175 /* Start inner kernel loop */
176 for(jidx=j_index_start; jidx<j_index_end; jidx++)
178 /* Get j neighbor index, and coordinate index */
180 j_coord_offset = DIM*jnr;
182 /* load j atom coordinates */
183 jx0 = x[j_coord_offset+DIM*0+XX];
184 jy0 = x[j_coord_offset+DIM*0+YY];
185 jz0 = x[j_coord_offset+DIM*0+ZZ];
186 jx1 = x[j_coord_offset+DIM*1+XX];
187 jy1 = x[j_coord_offset+DIM*1+YY];
188 jz1 = x[j_coord_offset+DIM*1+ZZ];
189 jx2 = x[j_coord_offset+DIM*2+XX];
190 jy2 = x[j_coord_offset+DIM*2+YY];
191 jz2 = x[j_coord_offset+DIM*2+ZZ];
193 /* Calculate displacement vector */
222 /* Calculate squared distance and things based on it */
223 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
224 rsq01 = dx01*dx01+dy01*dy01+dz01*dz01;
225 rsq02 = dx02*dx02+dy02*dy02+dz02*dz02;
226 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
227 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
228 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
229 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
230 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
231 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
233 rinv00 = gmx_invsqrt(rsq00);
234 rinv01 = gmx_invsqrt(rsq01);
235 rinv02 = gmx_invsqrt(rsq02);
236 rinv10 = gmx_invsqrt(rsq10);
237 rinv11 = gmx_invsqrt(rsq11);
238 rinv12 = gmx_invsqrt(rsq12);
239 rinv20 = gmx_invsqrt(rsq20);
240 rinv21 = gmx_invsqrt(rsq21);
241 rinv22 = gmx_invsqrt(rsq22);
243 rinvsq00 = rinv00*rinv00;
244 rinvsq01 = rinv01*rinv01;
245 rinvsq02 = rinv02*rinv02;
246 rinvsq10 = rinv10*rinv10;
247 rinvsq11 = rinv11*rinv11;
248 rinvsq12 = rinv12*rinv12;
249 rinvsq20 = rinv20*rinv20;
250 rinvsq21 = rinv21*rinv21;
251 rinvsq22 = rinv22*rinv22;
253 /**************************
254 * CALCULATE INTERACTIONS *
255 **************************/
259 /* Calculate table index by multiplying r with table scale and truncate to integer */
265 /* COULOMB ELECTROSTATICS */
267 felec = velec*rinvsq00;
269 /* CUBIC SPLINE TABLE DISPERSION */
273 Geps = vfeps*vftab[vfitab+2];
274 Heps2 = vfeps*vfeps*vftab[vfitab+3];
278 FF = Fp+Geps+2.0*Heps2;
281 /* CUBIC SPLINE TABLE REPULSION */
284 Geps = vfeps*vftab[vfitab+6];
285 Heps2 = vfeps*vfeps*vftab[vfitab+7];
289 FF = Fp+Geps+2.0*Heps2;
292 fvdw = -(fvdw6+fvdw12)*vftabscale*rinv00;
294 /* Update potential sums from outer loop */
300 /* Calculate temporary vectorial force */
305 /* Update vectorial force */
309 f[j_coord_offset+DIM*0+XX] -= tx;
310 f[j_coord_offset+DIM*0+YY] -= ty;
311 f[j_coord_offset+DIM*0+ZZ] -= tz;
313 /**************************
314 * CALCULATE INTERACTIONS *
315 **************************/
317 /* COULOMB ELECTROSTATICS */
319 felec = velec*rinvsq01;
321 /* Update potential sums from outer loop */
326 /* Calculate temporary vectorial force */
331 /* Update vectorial force */
335 f[j_coord_offset+DIM*1+XX] -= tx;
336 f[j_coord_offset+DIM*1+YY] -= ty;
337 f[j_coord_offset+DIM*1+ZZ] -= tz;
339 /**************************
340 * CALCULATE INTERACTIONS *
341 **************************/
343 /* COULOMB ELECTROSTATICS */
345 felec = velec*rinvsq02;
347 /* Update potential sums from outer loop */
352 /* Calculate temporary vectorial force */
357 /* Update vectorial force */
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;
365 /**************************
366 * CALCULATE INTERACTIONS *
367 **************************/
369 /* COULOMB ELECTROSTATICS */
371 felec = velec*rinvsq10;
373 /* Update potential sums from outer loop */
378 /* Calculate temporary vectorial force */
383 /* Update vectorial force */
387 f[j_coord_offset+DIM*0+XX] -= tx;
388 f[j_coord_offset+DIM*0+YY] -= ty;
389 f[j_coord_offset+DIM*0+ZZ] -= tz;
391 /**************************
392 * CALCULATE INTERACTIONS *
393 **************************/
395 /* COULOMB ELECTROSTATICS */
397 felec = velec*rinvsq11;
399 /* Update potential sums from outer loop */
404 /* Calculate temporary vectorial force */
409 /* Update vectorial force */
413 f[j_coord_offset+DIM*1+XX] -= tx;
414 f[j_coord_offset+DIM*1+YY] -= ty;
415 f[j_coord_offset+DIM*1+ZZ] -= tz;
417 /**************************
418 * CALCULATE INTERACTIONS *
419 **************************/
421 /* COULOMB ELECTROSTATICS */
423 felec = velec*rinvsq12;
425 /* Update potential sums from outer loop */
430 /* Calculate temporary vectorial force */
435 /* Update vectorial force */
439 f[j_coord_offset+DIM*2+XX] -= tx;
440 f[j_coord_offset+DIM*2+YY] -= ty;
441 f[j_coord_offset+DIM*2+ZZ] -= tz;
443 /**************************
444 * CALCULATE INTERACTIONS *
445 **************************/
447 /* COULOMB ELECTROSTATICS */
449 felec = velec*rinvsq20;
451 /* Update potential sums from outer loop */
456 /* Calculate temporary vectorial force */
461 /* Update vectorial force */
465 f[j_coord_offset+DIM*0+XX] -= tx;
466 f[j_coord_offset+DIM*0+YY] -= ty;
467 f[j_coord_offset+DIM*0+ZZ] -= tz;
469 /**************************
470 * CALCULATE INTERACTIONS *
471 **************************/
473 /* COULOMB ELECTROSTATICS */
475 felec = velec*rinvsq21;
477 /* Update potential sums from outer loop */
482 /* Calculate temporary vectorial force */
487 /* Update vectorial force */
491 f[j_coord_offset+DIM*1+XX] -= tx;
492 f[j_coord_offset+DIM*1+YY] -= ty;
493 f[j_coord_offset+DIM*1+ZZ] -= tz;
495 /**************************
496 * CALCULATE INTERACTIONS *
497 **************************/
499 /* COULOMB ELECTROSTATICS */
501 felec = velec*rinvsq22;
503 /* Update potential sums from outer loop */
508 /* Calculate temporary vectorial force */
513 /* Update vectorial force */
517 f[j_coord_offset+DIM*2+XX] -= tx;
518 f[j_coord_offset+DIM*2+YY] -= ty;
519 f[j_coord_offset+DIM*2+ZZ] -= tz;
521 /* Inner loop uses 277 flops */
523 /* End of innermost loop */
526 f[i_coord_offset+DIM*0+XX] += fix0;
527 f[i_coord_offset+DIM*0+YY] += fiy0;
528 f[i_coord_offset+DIM*0+ZZ] += fiz0;
532 f[i_coord_offset+DIM*1+XX] += fix1;
533 f[i_coord_offset+DIM*1+YY] += fiy1;
534 f[i_coord_offset+DIM*1+ZZ] += fiz1;
538 f[i_coord_offset+DIM*2+XX] += fix2;
539 f[i_coord_offset+DIM*2+YY] += fiy2;
540 f[i_coord_offset+DIM*2+ZZ] += fiz2;
544 fshift[i_shift_offset+XX] += tx;
545 fshift[i_shift_offset+YY] += ty;
546 fshift[i_shift_offset+ZZ] += tz;
549 /* Update potential energies */
550 kernel_data->energygrp_elec[ggid] += velecsum;
551 kernel_data->energygrp_vdw[ggid] += vvdwsum;
553 /* Increment number of inner iterations */
554 inneriter += j_index_end - j_index_start;
556 /* Outer loop uses 32 flops */
559 /* Increment number of outer iterations */
562 /* Update outer/inner flops */
564 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_VF,outeriter*32 + inneriter*277);
567 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_c
568 * Electrostatics interaction: Coulomb
569 * VdW interaction: CubicSplineTable
570 * Geometry: Water3-Water3
571 * Calculate force/pot: Force
574 nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_c
575 (t_nblist * gmx_restrict nlist,
576 rvec * gmx_restrict xx,
577 rvec * gmx_restrict ff,
578 t_forcerec * gmx_restrict fr,
579 t_mdatoms * gmx_restrict mdatoms,
580 nb_kernel_data_t * gmx_restrict kernel_data,
581 t_nrnb * gmx_restrict nrnb)
583 int i_shift_offset,i_coord_offset,j_coord_offset;
584 int j_index_start,j_index_end;
585 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
586 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
587 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
588 real *shiftvec,*fshift,*x,*f;
590 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
592 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
594 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
596 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
598 real jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
600 real jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
601 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
602 real dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01,cexp1_01,cexp2_01;
603 real dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02,cexp1_02,cexp2_02;
604 real dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
605 real dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
606 real dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
607 real dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
608 real dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
609 real dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
610 real velec,felec,velecsum,facel,crf,krf,krf2;
613 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
617 real rt,vfeps,vftabscale,Y,F,Geps,Heps2,Fp,VV,FF;
625 jindex = nlist->jindex;
627 shiftidx = nlist->shift;
629 shiftvec = fr->shift_vec[0];
630 fshift = fr->fshift[0];
632 charge = mdatoms->chargeA;
633 nvdwtype = fr->ntype;
635 vdwtype = mdatoms->typeA;
637 vftab = kernel_data->table_vdw->data;
638 vftabscale = kernel_data->table_vdw->scale;
640 /* Setup water-specific parameters */
641 inr = nlist->iinr[0];
642 iq0 = facel*charge[inr+0];
643 iq1 = facel*charge[inr+1];
644 iq2 = facel*charge[inr+2];
645 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
650 vdwjidx0 = 2*vdwtype[inr+0];
652 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
653 c12_00 = vdwparam[vdwioffset0+vdwjidx0+1];
666 /* Start outer loop over neighborlists */
667 for(iidx=0; iidx<nri; iidx++)
669 /* Load shift vector for this list */
670 i_shift_offset = DIM*shiftidx[iidx];
671 shX = shiftvec[i_shift_offset+XX];
672 shY = shiftvec[i_shift_offset+YY];
673 shZ = shiftvec[i_shift_offset+ZZ];
675 /* Load limits for loop over neighbors */
676 j_index_start = jindex[iidx];
677 j_index_end = jindex[iidx+1];
679 /* Get outer coordinate index */
681 i_coord_offset = DIM*inr;
683 /* Load i particle coords and add shift vector */
684 ix0 = shX + x[i_coord_offset+DIM*0+XX];
685 iy0 = shY + x[i_coord_offset+DIM*0+YY];
686 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
687 ix1 = shX + x[i_coord_offset+DIM*1+XX];
688 iy1 = shY + x[i_coord_offset+DIM*1+YY];
689 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
690 ix2 = shX + x[i_coord_offset+DIM*2+XX];
691 iy2 = shY + x[i_coord_offset+DIM*2+YY];
692 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
704 /* Start inner kernel loop */
705 for(jidx=j_index_start; jidx<j_index_end; jidx++)
707 /* Get j neighbor index, and coordinate index */
709 j_coord_offset = DIM*jnr;
711 /* load j atom coordinates */
712 jx0 = x[j_coord_offset+DIM*0+XX];
713 jy0 = x[j_coord_offset+DIM*0+YY];
714 jz0 = x[j_coord_offset+DIM*0+ZZ];
715 jx1 = x[j_coord_offset+DIM*1+XX];
716 jy1 = x[j_coord_offset+DIM*1+YY];
717 jz1 = x[j_coord_offset+DIM*1+ZZ];
718 jx2 = x[j_coord_offset+DIM*2+XX];
719 jy2 = x[j_coord_offset+DIM*2+YY];
720 jz2 = x[j_coord_offset+DIM*2+ZZ];
722 /* Calculate displacement vector */
751 /* Calculate squared distance and things based on it */
752 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
753 rsq01 = dx01*dx01+dy01*dy01+dz01*dz01;
754 rsq02 = dx02*dx02+dy02*dy02+dz02*dz02;
755 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
756 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
757 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
758 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
759 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
760 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
762 rinv00 = gmx_invsqrt(rsq00);
763 rinv01 = gmx_invsqrt(rsq01);
764 rinv02 = gmx_invsqrt(rsq02);
765 rinv10 = gmx_invsqrt(rsq10);
766 rinv11 = gmx_invsqrt(rsq11);
767 rinv12 = gmx_invsqrt(rsq12);
768 rinv20 = gmx_invsqrt(rsq20);
769 rinv21 = gmx_invsqrt(rsq21);
770 rinv22 = gmx_invsqrt(rsq22);
772 rinvsq00 = rinv00*rinv00;
773 rinvsq01 = rinv01*rinv01;
774 rinvsq02 = rinv02*rinv02;
775 rinvsq10 = rinv10*rinv10;
776 rinvsq11 = rinv11*rinv11;
777 rinvsq12 = rinv12*rinv12;
778 rinvsq20 = rinv20*rinv20;
779 rinvsq21 = rinv21*rinv21;
780 rinvsq22 = rinv22*rinv22;
782 /**************************
783 * CALCULATE INTERACTIONS *
784 **************************/
788 /* Calculate table index by multiplying r with table scale and truncate to integer */
794 /* COULOMB ELECTROSTATICS */
796 felec = velec*rinvsq00;
798 /* CUBIC SPLINE TABLE DISPERSION */
801 Geps = vfeps*vftab[vfitab+2];
802 Heps2 = vfeps*vfeps*vftab[vfitab+3];
804 FF = Fp+Geps+2.0*Heps2;
807 /* CUBIC SPLINE TABLE REPULSION */
809 Geps = vfeps*vftab[vfitab+6];
810 Heps2 = vfeps*vfeps*vftab[vfitab+7];
812 FF = Fp+Geps+2.0*Heps2;
814 fvdw = -(fvdw6+fvdw12)*vftabscale*rinv00;
818 /* Calculate temporary vectorial force */
823 /* Update vectorial force */
827 f[j_coord_offset+DIM*0+XX] -= tx;
828 f[j_coord_offset+DIM*0+YY] -= ty;
829 f[j_coord_offset+DIM*0+ZZ] -= tz;
831 /**************************
832 * CALCULATE INTERACTIONS *
833 **************************/
835 /* COULOMB ELECTROSTATICS */
837 felec = velec*rinvsq01;
841 /* Calculate temporary vectorial force */
846 /* Update vectorial force */
850 f[j_coord_offset+DIM*1+XX] -= tx;
851 f[j_coord_offset+DIM*1+YY] -= ty;
852 f[j_coord_offset+DIM*1+ZZ] -= tz;
854 /**************************
855 * CALCULATE INTERACTIONS *
856 **************************/
858 /* COULOMB ELECTROSTATICS */
860 felec = velec*rinvsq02;
864 /* Calculate temporary vectorial force */
869 /* Update vectorial force */
873 f[j_coord_offset+DIM*2+XX] -= tx;
874 f[j_coord_offset+DIM*2+YY] -= ty;
875 f[j_coord_offset+DIM*2+ZZ] -= tz;
877 /**************************
878 * CALCULATE INTERACTIONS *
879 **************************/
881 /* COULOMB ELECTROSTATICS */
883 felec = velec*rinvsq10;
887 /* Calculate temporary vectorial force */
892 /* Update vectorial force */
896 f[j_coord_offset+DIM*0+XX] -= tx;
897 f[j_coord_offset+DIM*0+YY] -= ty;
898 f[j_coord_offset+DIM*0+ZZ] -= tz;
900 /**************************
901 * CALCULATE INTERACTIONS *
902 **************************/
904 /* COULOMB ELECTROSTATICS */
906 felec = velec*rinvsq11;
910 /* Calculate temporary vectorial force */
915 /* Update vectorial force */
919 f[j_coord_offset+DIM*1+XX] -= tx;
920 f[j_coord_offset+DIM*1+YY] -= ty;
921 f[j_coord_offset+DIM*1+ZZ] -= tz;
923 /**************************
924 * CALCULATE INTERACTIONS *
925 **************************/
927 /* COULOMB ELECTROSTATICS */
929 felec = velec*rinvsq12;
933 /* Calculate temporary vectorial force */
938 /* Update vectorial force */
942 f[j_coord_offset+DIM*2+XX] -= tx;
943 f[j_coord_offset+DIM*2+YY] -= ty;
944 f[j_coord_offset+DIM*2+ZZ] -= tz;
946 /**************************
947 * CALCULATE INTERACTIONS *
948 **************************/
950 /* COULOMB ELECTROSTATICS */
952 felec = velec*rinvsq20;
956 /* Calculate temporary vectorial force */
961 /* Update vectorial force */
965 f[j_coord_offset+DIM*0+XX] -= tx;
966 f[j_coord_offset+DIM*0+YY] -= ty;
967 f[j_coord_offset+DIM*0+ZZ] -= tz;
969 /**************************
970 * CALCULATE INTERACTIONS *
971 **************************/
973 /* COULOMB ELECTROSTATICS */
975 felec = velec*rinvsq21;
979 /* Calculate temporary vectorial force */
984 /* Update vectorial force */
988 f[j_coord_offset+DIM*1+XX] -= tx;
989 f[j_coord_offset+DIM*1+YY] -= ty;
990 f[j_coord_offset+DIM*1+ZZ] -= tz;
992 /**************************
993 * CALCULATE INTERACTIONS *
994 **************************/
996 /* COULOMB ELECTROSTATICS */
998 felec = velec*rinvsq22;
1002 /* Calculate temporary vectorial force */
1007 /* Update vectorial force */
1011 f[j_coord_offset+DIM*2+XX] -= tx;
1012 f[j_coord_offset+DIM*2+YY] -= ty;
1013 f[j_coord_offset+DIM*2+ZZ] -= tz;
1015 /* Inner loop uses 260 flops */
1017 /* End of innermost loop */
1020 f[i_coord_offset+DIM*0+XX] += fix0;
1021 f[i_coord_offset+DIM*0+YY] += fiy0;
1022 f[i_coord_offset+DIM*0+ZZ] += fiz0;
1026 f[i_coord_offset+DIM*1+XX] += fix1;
1027 f[i_coord_offset+DIM*1+YY] += fiy1;
1028 f[i_coord_offset+DIM*1+ZZ] += fiz1;
1032 f[i_coord_offset+DIM*2+XX] += fix2;
1033 f[i_coord_offset+DIM*2+YY] += fiy2;
1034 f[i_coord_offset+DIM*2+ZZ] += fiz2;
1038 fshift[i_shift_offset+XX] += tx;
1039 fshift[i_shift_offset+YY] += ty;
1040 fshift[i_shift_offset+ZZ] += tz;
1042 /* Increment number of inner iterations */
1043 inneriter += j_index_end - j_index_start;
1045 /* Outer loop uses 30 flops */
1048 /* Increment number of outer iterations */
1051 /* Update outer/inner flops */
1053 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_F,outeriter*30 + inneriter*260);