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_VdwLJ_GeomW3W3_VF_c
35 * Electrostatics interaction: Coulomb
36 * VdW interaction: LennardJones
37 * Geometry: Water3-Water3
38 * Calculate force/pot: PotentialAndForce
41 nb_kernel_ElecCoul_VdwLJ_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;
89 jindex = nlist->jindex;
91 shiftidx = nlist->shift;
93 shiftvec = fr->shift_vec[0];
94 fshift = fr->fshift[0];
96 charge = mdatoms->chargeA;
99 vdwtype = mdatoms->typeA;
101 /* Setup water-specific parameters */
102 inr = nlist->iinr[0];
103 iq0 = facel*charge[inr+0];
104 iq1 = facel*charge[inr+1];
105 iq2 = facel*charge[inr+2];
106 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
111 vdwjidx0 = 2*vdwtype[inr+0];
113 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
114 c12_00 = vdwparam[vdwioffset0+vdwjidx0+1];
127 /* Start outer loop over neighborlists */
128 for(iidx=0; iidx<nri; iidx++)
130 /* Load shift vector for this list */
131 i_shift_offset = DIM*shiftidx[iidx];
132 shX = shiftvec[i_shift_offset+XX];
133 shY = shiftvec[i_shift_offset+YY];
134 shZ = shiftvec[i_shift_offset+ZZ];
136 /* Load limits for loop over neighbors */
137 j_index_start = jindex[iidx];
138 j_index_end = jindex[iidx+1];
140 /* Get outer coordinate index */
142 i_coord_offset = DIM*inr;
144 /* Load i particle coords and add shift vector */
145 ix0 = shX + x[i_coord_offset+DIM*0+XX];
146 iy0 = shY + x[i_coord_offset+DIM*0+YY];
147 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
148 ix1 = shX + x[i_coord_offset+DIM*1+XX];
149 iy1 = shY + x[i_coord_offset+DIM*1+YY];
150 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
151 ix2 = shX + x[i_coord_offset+DIM*2+XX];
152 iy2 = shY + x[i_coord_offset+DIM*2+YY];
153 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
165 /* Reset potential sums */
169 /* Start inner kernel loop */
170 for(jidx=j_index_start; jidx<j_index_end; jidx++)
172 /* Get j neighbor index, and coordinate index */
174 j_coord_offset = DIM*jnr;
176 /* load j atom coordinates */
177 jx0 = x[j_coord_offset+DIM*0+XX];
178 jy0 = x[j_coord_offset+DIM*0+YY];
179 jz0 = x[j_coord_offset+DIM*0+ZZ];
180 jx1 = x[j_coord_offset+DIM*1+XX];
181 jy1 = x[j_coord_offset+DIM*1+YY];
182 jz1 = x[j_coord_offset+DIM*1+ZZ];
183 jx2 = x[j_coord_offset+DIM*2+XX];
184 jy2 = x[j_coord_offset+DIM*2+YY];
185 jz2 = x[j_coord_offset+DIM*2+ZZ];
187 /* Calculate displacement vector */
216 /* Calculate squared distance and things based on it */
217 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
218 rsq01 = dx01*dx01+dy01*dy01+dz01*dz01;
219 rsq02 = dx02*dx02+dy02*dy02+dz02*dz02;
220 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
221 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
222 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
223 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
224 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
225 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
227 rinv00 = gmx_invsqrt(rsq00);
228 rinv01 = gmx_invsqrt(rsq01);
229 rinv02 = gmx_invsqrt(rsq02);
230 rinv10 = gmx_invsqrt(rsq10);
231 rinv11 = gmx_invsqrt(rsq11);
232 rinv12 = gmx_invsqrt(rsq12);
233 rinv20 = gmx_invsqrt(rsq20);
234 rinv21 = gmx_invsqrt(rsq21);
235 rinv22 = gmx_invsqrt(rsq22);
237 rinvsq00 = rinv00*rinv00;
238 rinvsq01 = rinv01*rinv01;
239 rinvsq02 = rinv02*rinv02;
240 rinvsq10 = rinv10*rinv10;
241 rinvsq11 = rinv11*rinv11;
242 rinvsq12 = rinv12*rinv12;
243 rinvsq20 = rinv20*rinv20;
244 rinvsq21 = rinv21*rinv21;
245 rinvsq22 = rinv22*rinv22;
247 /**************************
248 * CALCULATE INTERACTIONS *
249 **************************/
251 /* COULOMB ELECTROSTATICS */
253 felec = velec*rinvsq00;
255 /* LENNARD-JONES DISPERSION/REPULSION */
257 rinvsix = rinvsq00*rinvsq00*rinvsq00;
258 vvdw6 = c6_00*rinvsix;
259 vvdw12 = c12_00*rinvsix*rinvsix;
260 vvdw = vvdw12*(1.0/12.0) - vvdw6*(1.0/6.0);
261 fvdw = (vvdw12-vvdw6)*rinvsq00;
263 /* Update potential sums from outer loop */
269 /* Calculate temporary vectorial force */
274 /* Update vectorial force */
278 f[j_coord_offset+DIM*0+XX] -= tx;
279 f[j_coord_offset+DIM*0+YY] -= ty;
280 f[j_coord_offset+DIM*0+ZZ] -= tz;
282 /**************************
283 * CALCULATE INTERACTIONS *
284 **************************/
286 /* COULOMB ELECTROSTATICS */
288 felec = velec*rinvsq01;
290 /* Update potential sums from outer loop */
295 /* Calculate temporary vectorial force */
300 /* Update vectorial force */
304 f[j_coord_offset+DIM*1+XX] -= tx;
305 f[j_coord_offset+DIM*1+YY] -= ty;
306 f[j_coord_offset+DIM*1+ZZ] -= tz;
308 /**************************
309 * CALCULATE INTERACTIONS *
310 **************************/
312 /* COULOMB ELECTROSTATICS */
314 felec = velec*rinvsq02;
316 /* Update potential sums from outer loop */
321 /* Calculate temporary vectorial force */
326 /* Update vectorial force */
330 f[j_coord_offset+DIM*2+XX] -= tx;
331 f[j_coord_offset+DIM*2+YY] -= ty;
332 f[j_coord_offset+DIM*2+ZZ] -= tz;
334 /**************************
335 * CALCULATE INTERACTIONS *
336 **************************/
338 /* COULOMB ELECTROSTATICS */
340 felec = velec*rinvsq10;
342 /* Update potential sums from outer loop */
347 /* Calculate temporary vectorial force */
352 /* Update vectorial force */
356 f[j_coord_offset+DIM*0+XX] -= tx;
357 f[j_coord_offset+DIM*0+YY] -= ty;
358 f[j_coord_offset+DIM*0+ZZ] -= tz;
360 /**************************
361 * CALCULATE INTERACTIONS *
362 **************************/
364 /* COULOMB ELECTROSTATICS */
366 felec = velec*rinvsq11;
368 /* Update potential sums from outer loop */
373 /* Calculate temporary vectorial force */
378 /* Update vectorial force */
382 f[j_coord_offset+DIM*1+XX] -= tx;
383 f[j_coord_offset+DIM*1+YY] -= ty;
384 f[j_coord_offset+DIM*1+ZZ] -= tz;
386 /**************************
387 * CALCULATE INTERACTIONS *
388 **************************/
390 /* COULOMB ELECTROSTATICS */
392 felec = velec*rinvsq12;
394 /* Update potential sums from outer loop */
399 /* Calculate temporary vectorial force */
404 /* Update vectorial force */
408 f[j_coord_offset+DIM*2+XX] -= tx;
409 f[j_coord_offset+DIM*2+YY] -= ty;
410 f[j_coord_offset+DIM*2+ZZ] -= tz;
412 /**************************
413 * CALCULATE INTERACTIONS *
414 **************************/
416 /* COULOMB ELECTROSTATICS */
418 felec = velec*rinvsq20;
420 /* Update potential sums from outer loop */
425 /* Calculate temporary vectorial force */
430 /* Update vectorial force */
434 f[j_coord_offset+DIM*0+XX] -= tx;
435 f[j_coord_offset+DIM*0+YY] -= ty;
436 f[j_coord_offset+DIM*0+ZZ] -= tz;
438 /**************************
439 * CALCULATE INTERACTIONS *
440 **************************/
442 /* COULOMB ELECTROSTATICS */
444 felec = velec*rinvsq21;
446 /* Update potential sums from outer loop */
451 /* Calculate temporary vectorial force */
456 /* Update vectorial force */
460 f[j_coord_offset+DIM*1+XX] -= tx;
461 f[j_coord_offset+DIM*1+YY] -= ty;
462 f[j_coord_offset+DIM*1+ZZ] -= tz;
464 /**************************
465 * CALCULATE INTERACTIONS *
466 **************************/
468 /* COULOMB ELECTROSTATICS */
470 felec = velec*rinvsq22;
472 /* Update potential sums from outer loop */
477 /* Calculate temporary vectorial force */
482 /* Update vectorial force */
486 f[j_coord_offset+DIM*2+XX] -= tx;
487 f[j_coord_offset+DIM*2+YY] -= ty;
488 f[j_coord_offset+DIM*2+ZZ] -= tz;
490 /* Inner loop uses 255 flops */
492 /* End of innermost loop */
495 f[i_coord_offset+DIM*0+XX] += fix0;
496 f[i_coord_offset+DIM*0+YY] += fiy0;
497 f[i_coord_offset+DIM*0+ZZ] += fiz0;
501 f[i_coord_offset+DIM*1+XX] += fix1;
502 f[i_coord_offset+DIM*1+YY] += fiy1;
503 f[i_coord_offset+DIM*1+ZZ] += fiz1;
507 f[i_coord_offset+DIM*2+XX] += fix2;
508 f[i_coord_offset+DIM*2+YY] += fiy2;
509 f[i_coord_offset+DIM*2+ZZ] += fiz2;
513 fshift[i_shift_offset+XX] += tx;
514 fshift[i_shift_offset+YY] += ty;
515 fshift[i_shift_offset+ZZ] += tz;
518 /* Update potential energies */
519 kernel_data->energygrp_elec[ggid] += velecsum;
520 kernel_data->energygrp_vdw[ggid] += vvdwsum;
522 /* Increment number of inner iterations */
523 inneriter += j_index_end - j_index_start;
525 /* Outer loop uses 32 flops */
528 /* Increment number of outer iterations */
531 /* Update outer/inner flops */
533 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_VF,outeriter*32 + inneriter*255);
536 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_c
537 * Electrostatics interaction: Coulomb
538 * VdW interaction: LennardJones
539 * Geometry: Water3-Water3
540 * Calculate force/pot: Force
543 nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_c
544 (t_nblist * gmx_restrict nlist,
545 rvec * gmx_restrict xx,
546 rvec * gmx_restrict ff,
547 t_forcerec * gmx_restrict fr,
548 t_mdatoms * gmx_restrict mdatoms,
549 nb_kernel_data_t * gmx_restrict kernel_data,
550 t_nrnb * gmx_restrict nrnb)
552 int i_shift_offset,i_coord_offset,j_coord_offset;
553 int j_index_start,j_index_end;
554 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
555 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
556 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
557 real *shiftvec,*fshift,*x,*f;
559 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
561 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
563 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
565 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
567 real jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
569 real jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
570 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
571 real dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01,cexp1_01,cexp2_01;
572 real dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02,cexp1_02,cexp2_02;
573 real dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
574 real dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
575 real dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
576 real dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
577 real dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
578 real dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
579 real velec,felec,velecsum,facel,crf,krf,krf2;
582 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
591 jindex = nlist->jindex;
593 shiftidx = nlist->shift;
595 shiftvec = fr->shift_vec[0];
596 fshift = fr->fshift[0];
598 charge = mdatoms->chargeA;
599 nvdwtype = fr->ntype;
601 vdwtype = mdatoms->typeA;
603 /* Setup water-specific parameters */
604 inr = nlist->iinr[0];
605 iq0 = facel*charge[inr+0];
606 iq1 = facel*charge[inr+1];
607 iq2 = facel*charge[inr+2];
608 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
613 vdwjidx0 = 2*vdwtype[inr+0];
615 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
616 c12_00 = vdwparam[vdwioffset0+vdwjidx0+1];
629 /* Start outer loop over neighborlists */
630 for(iidx=0; iidx<nri; iidx++)
632 /* Load shift vector for this list */
633 i_shift_offset = DIM*shiftidx[iidx];
634 shX = shiftvec[i_shift_offset+XX];
635 shY = shiftvec[i_shift_offset+YY];
636 shZ = shiftvec[i_shift_offset+ZZ];
638 /* Load limits for loop over neighbors */
639 j_index_start = jindex[iidx];
640 j_index_end = jindex[iidx+1];
642 /* Get outer coordinate index */
644 i_coord_offset = DIM*inr;
646 /* Load i particle coords and add shift vector */
647 ix0 = shX + x[i_coord_offset+DIM*0+XX];
648 iy0 = shY + x[i_coord_offset+DIM*0+YY];
649 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
650 ix1 = shX + x[i_coord_offset+DIM*1+XX];
651 iy1 = shY + x[i_coord_offset+DIM*1+YY];
652 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
653 ix2 = shX + x[i_coord_offset+DIM*2+XX];
654 iy2 = shY + x[i_coord_offset+DIM*2+YY];
655 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
667 /* Start inner kernel loop */
668 for(jidx=j_index_start; jidx<j_index_end; jidx++)
670 /* Get j neighbor index, and coordinate index */
672 j_coord_offset = DIM*jnr;
674 /* load j atom coordinates */
675 jx0 = x[j_coord_offset+DIM*0+XX];
676 jy0 = x[j_coord_offset+DIM*0+YY];
677 jz0 = x[j_coord_offset+DIM*0+ZZ];
678 jx1 = x[j_coord_offset+DIM*1+XX];
679 jy1 = x[j_coord_offset+DIM*1+YY];
680 jz1 = x[j_coord_offset+DIM*1+ZZ];
681 jx2 = x[j_coord_offset+DIM*2+XX];
682 jy2 = x[j_coord_offset+DIM*2+YY];
683 jz2 = x[j_coord_offset+DIM*2+ZZ];
685 /* Calculate displacement vector */
714 /* Calculate squared distance and things based on it */
715 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
716 rsq01 = dx01*dx01+dy01*dy01+dz01*dz01;
717 rsq02 = dx02*dx02+dy02*dy02+dz02*dz02;
718 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
719 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
720 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
721 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
722 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
723 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
725 rinv00 = gmx_invsqrt(rsq00);
726 rinv01 = gmx_invsqrt(rsq01);
727 rinv02 = gmx_invsqrt(rsq02);
728 rinv10 = gmx_invsqrt(rsq10);
729 rinv11 = gmx_invsqrt(rsq11);
730 rinv12 = gmx_invsqrt(rsq12);
731 rinv20 = gmx_invsqrt(rsq20);
732 rinv21 = gmx_invsqrt(rsq21);
733 rinv22 = gmx_invsqrt(rsq22);
735 rinvsq00 = rinv00*rinv00;
736 rinvsq01 = rinv01*rinv01;
737 rinvsq02 = rinv02*rinv02;
738 rinvsq10 = rinv10*rinv10;
739 rinvsq11 = rinv11*rinv11;
740 rinvsq12 = rinv12*rinv12;
741 rinvsq20 = rinv20*rinv20;
742 rinvsq21 = rinv21*rinv21;
743 rinvsq22 = rinv22*rinv22;
745 /**************************
746 * CALCULATE INTERACTIONS *
747 **************************/
749 /* COULOMB ELECTROSTATICS */
751 felec = velec*rinvsq00;
753 /* LENNARD-JONES DISPERSION/REPULSION */
755 rinvsix = rinvsq00*rinvsq00*rinvsq00;
756 fvdw = (c12_00*rinvsix-c6_00)*rinvsix*rinvsq00;
760 /* Calculate temporary vectorial force */
765 /* Update vectorial force */
769 f[j_coord_offset+DIM*0+XX] -= tx;
770 f[j_coord_offset+DIM*0+YY] -= ty;
771 f[j_coord_offset+DIM*0+ZZ] -= tz;
773 /**************************
774 * CALCULATE INTERACTIONS *
775 **************************/
777 /* COULOMB ELECTROSTATICS */
779 felec = velec*rinvsq01;
783 /* Calculate temporary vectorial force */
788 /* Update vectorial force */
792 f[j_coord_offset+DIM*1+XX] -= tx;
793 f[j_coord_offset+DIM*1+YY] -= ty;
794 f[j_coord_offset+DIM*1+ZZ] -= tz;
796 /**************************
797 * CALCULATE INTERACTIONS *
798 **************************/
800 /* COULOMB ELECTROSTATICS */
802 felec = velec*rinvsq02;
806 /* Calculate temporary vectorial force */
811 /* Update vectorial force */
815 f[j_coord_offset+DIM*2+XX] -= tx;
816 f[j_coord_offset+DIM*2+YY] -= ty;
817 f[j_coord_offset+DIM*2+ZZ] -= tz;
819 /**************************
820 * CALCULATE INTERACTIONS *
821 **************************/
823 /* COULOMB ELECTROSTATICS */
825 felec = velec*rinvsq10;
829 /* Calculate temporary vectorial force */
834 /* Update vectorial force */
838 f[j_coord_offset+DIM*0+XX] -= tx;
839 f[j_coord_offset+DIM*0+YY] -= ty;
840 f[j_coord_offset+DIM*0+ZZ] -= tz;
842 /**************************
843 * CALCULATE INTERACTIONS *
844 **************************/
846 /* COULOMB ELECTROSTATICS */
848 felec = velec*rinvsq11;
852 /* Calculate temporary vectorial force */
857 /* Update vectorial force */
861 f[j_coord_offset+DIM*1+XX] -= tx;
862 f[j_coord_offset+DIM*1+YY] -= ty;
863 f[j_coord_offset+DIM*1+ZZ] -= tz;
865 /**************************
866 * CALCULATE INTERACTIONS *
867 **************************/
869 /* COULOMB ELECTROSTATICS */
871 felec = velec*rinvsq12;
875 /* Calculate temporary vectorial force */
880 /* Update vectorial force */
884 f[j_coord_offset+DIM*2+XX] -= tx;
885 f[j_coord_offset+DIM*2+YY] -= ty;
886 f[j_coord_offset+DIM*2+ZZ] -= tz;
888 /**************************
889 * CALCULATE INTERACTIONS *
890 **************************/
892 /* COULOMB ELECTROSTATICS */
894 felec = velec*rinvsq20;
898 /* Calculate temporary vectorial force */
903 /* Update vectorial force */
907 f[j_coord_offset+DIM*0+XX] -= tx;
908 f[j_coord_offset+DIM*0+YY] -= ty;
909 f[j_coord_offset+DIM*0+ZZ] -= tz;
911 /**************************
912 * CALCULATE INTERACTIONS *
913 **************************/
915 /* COULOMB ELECTROSTATICS */
917 felec = velec*rinvsq21;
921 /* Calculate temporary vectorial force */
926 /* Update vectorial force */
930 f[j_coord_offset+DIM*1+XX] -= tx;
931 f[j_coord_offset+DIM*1+YY] -= ty;
932 f[j_coord_offset+DIM*1+ZZ] -= tz;
934 /**************************
935 * CALCULATE INTERACTIONS *
936 **************************/
938 /* COULOMB ELECTROSTATICS */
940 felec = velec*rinvsq22;
944 /* Calculate temporary vectorial force */
949 /* Update vectorial force */
953 f[j_coord_offset+DIM*2+XX] -= tx;
954 f[j_coord_offset+DIM*2+YY] -= ty;
955 f[j_coord_offset+DIM*2+ZZ] -= tz;
957 /* Inner loop uses 241 flops */
959 /* End of innermost loop */
962 f[i_coord_offset+DIM*0+XX] += fix0;
963 f[i_coord_offset+DIM*0+YY] += fiy0;
964 f[i_coord_offset+DIM*0+ZZ] += fiz0;
968 f[i_coord_offset+DIM*1+XX] += fix1;
969 f[i_coord_offset+DIM*1+YY] += fiy1;
970 f[i_coord_offset+DIM*1+ZZ] += fiz1;
974 f[i_coord_offset+DIM*2+XX] += fix2;
975 f[i_coord_offset+DIM*2+YY] += fiy2;
976 f[i_coord_offset+DIM*2+ZZ] += fiz2;
980 fshift[i_shift_offset+XX] += tx;
981 fshift[i_shift_offset+YY] += ty;
982 fshift[i_shift_offset+ZZ] += tz;
984 /* Increment number of inner iterations */
985 inneriter += j_index_end - j_index_start;
987 /* Outer loop uses 30 flops */
990 /* Increment number of outer iterations */
993 /* Update outer/inner flops */
995 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_F,outeriter*30 + inneriter*241);