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_VdwNone_GeomW3W3_VF_c
35 * Electrostatics interaction: Coulomb
36 * VdW interaction: None
37 * Geometry: Water3-Water3
38 * Calculate force/pot: PotentialAndForce
41 nb_kernel_ElecCoul_VdwNone_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;
85 jindex = nlist->jindex;
87 shiftidx = nlist->shift;
89 shiftvec = fr->shift_vec[0];
90 fshift = fr->fshift[0];
92 charge = mdatoms->chargeA;
94 /* Setup water-specific parameters */
96 iq0 = facel*charge[inr+0];
97 iq1 = facel*charge[inr+1];
98 iq2 = facel*charge[inr+2];
116 /* Start outer loop over neighborlists */
117 for(iidx=0; iidx<nri; iidx++)
119 /* Load shift vector for this list */
120 i_shift_offset = DIM*shiftidx[iidx];
121 shX = shiftvec[i_shift_offset+XX];
122 shY = shiftvec[i_shift_offset+YY];
123 shZ = shiftvec[i_shift_offset+ZZ];
125 /* Load limits for loop over neighbors */
126 j_index_start = jindex[iidx];
127 j_index_end = jindex[iidx+1];
129 /* Get outer coordinate index */
131 i_coord_offset = DIM*inr;
133 /* Load i particle coords and add shift vector */
134 ix0 = shX + x[i_coord_offset+DIM*0+XX];
135 iy0 = shY + x[i_coord_offset+DIM*0+YY];
136 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
137 ix1 = shX + x[i_coord_offset+DIM*1+XX];
138 iy1 = shY + x[i_coord_offset+DIM*1+YY];
139 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
140 ix2 = shX + x[i_coord_offset+DIM*2+XX];
141 iy2 = shY + x[i_coord_offset+DIM*2+YY];
142 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
154 /* Reset potential sums */
157 /* Start inner kernel loop */
158 for(jidx=j_index_start; jidx<j_index_end; jidx++)
160 /* Get j neighbor index, and coordinate index */
162 j_coord_offset = DIM*jnr;
164 /* load j atom coordinates */
165 jx0 = x[j_coord_offset+DIM*0+XX];
166 jy0 = x[j_coord_offset+DIM*0+YY];
167 jz0 = x[j_coord_offset+DIM*0+ZZ];
168 jx1 = x[j_coord_offset+DIM*1+XX];
169 jy1 = x[j_coord_offset+DIM*1+YY];
170 jz1 = x[j_coord_offset+DIM*1+ZZ];
171 jx2 = x[j_coord_offset+DIM*2+XX];
172 jy2 = x[j_coord_offset+DIM*2+YY];
173 jz2 = x[j_coord_offset+DIM*2+ZZ];
175 /* Calculate displacement vector */
204 /* Calculate squared distance and things based on it */
205 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
206 rsq01 = dx01*dx01+dy01*dy01+dz01*dz01;
207 rsq02 = dx02*dx02+dy02*dy02+dz02*dz02;
208 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
209 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
210 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
211 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
212 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
213 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
215 rinv00 = gmx_invsqrt(rsq00);
216 rinv01 = gmx_invsqrt(rsq01);
217 rinv02 = gmx_invsqrt(rsq02);
218 rinv10 = gmx_invsqrt(rsq10);
219 rinv11 = gmx_invsqrt(rsq11);
220 rinv12 = gmx_invsqrt(rsq12);
221 rinv20 = gmx_invsqrt(rsq20);
222 rinv21 = gmx_invsqrt(rsq21);
223 rinv22 = gmx_invsqrt(rsq22);
225 rinvsq00 = rinv00*rinv00;
226 rinvsq01 = rinv01*rinv01;
227 rinvsq02 = rinv02*rinv02;
228 rinvsq10 = rinv10*rinv10;
229 rinvsq11 = rinv11*rinv11;
230 rinvsq12 = rinv12*rinv12;
231 rinvsq20 = rinv20*rinv20;
232 rinvsq21 = rinv21*rinv21;
233 rinvsq22 = rinv22*rinv22;
235 /**************************
236 * CALCULATE INTERACTIONS *
237 **************************/
239 /* COULOMB ELECTROSTATICS */
241 felec = velec*rinvsq00;
243 /* Update potential sums from outer loop */
248 /* Calculate temporary vectorial force */
253 /* Update vectorial force */
257 f[j_coord_offset+DIM*0+XX] -= tx;
258 f[j_coord_offset+DIM*0+YY] -= ty;
259 f[j_coord_offset+DIM*0+ZZ] -= tz;
261 /**************************
262 * CALCULATE INTERACTIONS *
263 **************************/
265 /* COULOMB ELECTROSTATICS */
267 felec = velec*rinvsq01;
269 /* Update potential sums from outer loop */
274 /* Calculate temporary vectorial force */
279 /* Update vectorial force */
283 f[j_coord_offset+DIM*1+XX] -= tx;
284 f[j_coord_offset+DIM*1+YY] -= ty;
285 f[j_coord_offset+DIM*1+ZZ] -= tz;
287 /**************************
288 * CALCULATE INTERACTIONS *
289 **************************/
291 /* COULOMB ELECTROSTATICS */
293 felec = velec*rinvsq02;
295 /* Update potential sums from outer loop */
300 /* Calculate temporary vectorial force */
305 /* Update vectorial force */
309 f[j_coord_offset+DIM*2+XX] -= tx;
310 f[j_coord_offset+DIM*2+YY] -= ty;
311 f[j_coord_offset+DIM*2+ZZ] -= tz;
313 /**************************
314 * CALCULATE INTERACTIONS *
315 **************************/
317 /* COULOMB ELECTROSTATICS */
319 felec = velec*rinvsq10;
321 /* Update potential sums from outer loop */
326 /* Calculate temporary vectorial force */
331 /* Update vectorial force */
335 f[j_coord_offset+DIM*0+XX] -= tx;
336 f[j_coord_offset+DIM*0+YY] -= ty;
337 f[j_coord_offset+DIM*0+ZZ] -= tz;
339 /**************************
340 * CALCULATE INTERACTIONS *
341 **************************/
343 /* COULOMB ELECTROSTATICS */
345 felec = velec*rinvsq11;
347 /* Update potential sums from outer loop */
352 /* Calculate temporary vectorial force */
357 /* Update vectorial force */
361 f[j_coord_offset+DIM*1+XX] -= tx;
362 f[j_coord_offset+DIM*1+YY] -= ty;
363 f[j_coord_offset+DIM*1+ZZ] -= tz;
365 /**************************
366 * CALCULATE INTERACTIONS *
367 **************************/
369 /* COULOMB ELECTROSTATICS */
371 felec = velec*rinvsq12;
373 /* Update potential sums from outer loop */
378 /* Calculate temporary vectorial force */
383 /* Update vectorial force */
387 f[j_coord_offset+DIM*2+XX] -= tx;
388 f[j_coord_offset+DIM*2+YY] -= ty;
389 f[j_coord_offset+DIM*2+ZZ] -= tz;
391 /**************************
392 * CALCULATE INTERACTIONS *
393 **************************/
395 /* COULOMB ELECTROSTATICS */
397 felec = velec*rinvsq20;
399 /* Update potential sums from outer loop */
404 /* Calculate temporary vectorial force */
409 /* Update vectorial force */
413 f[j_coord_offset+DIM*0+XX] -= tx;
414 f[j_coord_offset+DIM*0+YY] -= ty;
415 f[j_coord_offset+DIM*0+ZZ] -= tz;
417 /**************************
418 * CALCULATE INTERACTIONS *
419 **************************/
421 /* COULOMB ELECTROSTATICS */
423 felec = velec*rinvsq21;
425 /* Update potential sums from outer loop */
430 /* Calculate temporary vectorial force */
435 /* Update vectorial force */
439 f[j_coord_offset+DIM*1+XX] -= tx;
440 f[j_coord_offset+DIM*1+YY] -= ty;
441 f[j_coord_offset+DIM*1+ZZ] -= tz;
443 /**************************
444 * CALCULATE INTERACTIONS *
445 **************************/
447 /* COULOMB ELECTROSTATICS */
449 felec = velec*rinvsq22;
451 /* Update potential sums from outer loop */
456 /* Calculate temporary vectorial force */
461 /* Update vectorial force */
465 f[j_coord_offset+DIM*2+XX] -= tx;
466 f[j_coord_offset+DIM*2+YY] -= ty;
467 f[j_coord_offset+DIM*2+ZZ] -= tz;
469 /* Inner loop uses 243 flops */
471 /* End of innermost loop */
474 f[i_coord_offset+DIM*0+XX] += fix0;
475 f[i_coord_offset+DIM*0+YY] += fiy0;
476 f[i_coord_offset+DIM*0+ZZ] += fiz0;
480 f[i_coord_offset+DIM*1+XX] += fix1;
481 f[i_coord_offset+DIM*1+YY] += fiy1;
482 f[i_coord_offset+DIM*1+ZZ] += fiz1;
486 f[i_coord_offset+DIM*2+XX] += fix2;
487 f[i_coord_offset+DIM*2+YY] += fiy2;
488 f[i_coord_offset+DIM*2+ZZ] += fiz2;
492 fshift[i_shift_offset+XX] += tx;
493 fshift[i_shift_offset+YY] += ty;
494 fshift[i_shift_offset+ZZ] += tz;
497 /* Update potential energies */
498 kernel_data->energygrp_elec[ggid] += velecsum;
500 /* Increment number of inner iterations */
501 inneriter += j_index_end - j_index_start;
503 /* Outer loop uses 31 flops */
506 /* Increment number of outer iterations */
509 /* Update outer/inner flops */
511 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_W3W3_VF,outeriter*31 + inneriter*243);
514 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_c
515 * Electrostatics interaction: Coulomb
516 * VdW interaction: None
517 * Geometry: Water3-Water3
518 * Calculate force/pot: Force
521 nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_c
522 (t_nblist * gmx_restrict nlist,
523 rvec * gmx_restrict xx,
524 rvec * gmx_restrict ff,
525 t_forcerec * gmx_restrict fr,
526 t_mdatoms * gmx_restrict mdatoms,
527 nb_kernel_data_t * gmx_restrict kernel_data,
528 t_nrnb * gmx_restrict nrnb)
530 int i_shift_offset,i_coord_offset,j_coord_offset;
531 int j_index_start,j_index_end;
532 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
533 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
534 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
535 real *shiftvec,*fshift,*x,*f;
537 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
539 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
541 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
543 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
545 real jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
547 real jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
548 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
549 real dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01,cexp1_01,cexp2_01;
550 real dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02,cexp1_02,cexp2_02;
551 real dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
552 real dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
553 real dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
554 real dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
555 real dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
556 real dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
557 real velec,felec,velecsum,facel,crf,krf,krf2;
565 jindex = nlist->jindex;
567 shiftidx = nlist->shift;
569 shiftvec = fr->shift_vec[0];
570 fshift = fr->fshift[0];
572 charge = mdatoms->chargeA;
574 /* Setup water-specific parameters */
575 inr = nlist->iinr[0];
576 iq0 = facel*charge[inr+0];
577 iq1 = facel*charge[inr+1];
578 iq2 = facel*charge[inr+2];
596 /* Start outer loop over neighborlists */
597 for(iidx=0; iidx<nri; iidx++)
599 /* Load shift vector for this list */
600 i_shift_offset = DIM*shiftidx[iidx];
601 shX = shiftvec[i_shift_offset+XX];
602 shY = shiftvec[i_shift_offset+YY];
603 shZ = shiftvec[i_shift_offset+ZZ];
605 /* Load limits for loop over neighbors */
606 j_index_start = jindex[iidx];
607 j_index_end = jindex[iidx+1];
609 /* Get outer coordinate index */
611 i_coord_offset = DIM*inr;
613 /* Load i particle coords and add shift vector */
614 ix0 = shX + x[i_coord_offset+DIM*0+XX];
615 iy0 = shY + x[i_coord_offset+DIM*0+YY];
616 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
617 ix1 = shX + x[i_coord_offset+DIM*1+XX];
618 iy1 = shY + x[i_coord_offset+DIM*1+YY];
619 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
620 ix2 = shX + x[i_coord_offset+DIM*2+XX];
621 iy2 = shY + x[i_coord_offset+DIM*2+YY];
622 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
634 /* Start inner kernel loop */
635 for(jidx=j_index_start; jidx<j_index_end; jidx++)
637 /* Get j neighbor index, and coordinate index */
639 j_coord_offset = DIM*jnr;
641 /* load j atom coordinates */
642 jx0 = x[j_coord_offset+DIM*0+XX];
643 jy0 = x[j_coord_offset+DIM*0+YY];
644 jz0 = x[j_coord_offset+DIM*0+ZZ];
645 jx1 = x[j_coord_offset+DIM*1+XX];
646 jy1 = x[j_coord_offset+DIM*1+YY];
647 jz1 = x[j_coord_offset+DIM*1+ZZ];
648 jx2 = x[j_coord_offset+DIM*2+XX];
649 jy2 = x[j_coord_offset+DIM*2+YY];
650 jz2 = x[j_coord_offset+DIM*2+ZZ];
652 /* Calculate displacement vector */
681 /* Calculate squared distance and things based on it */
682 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
683 rsq01 = dx01*dx01+dy01*dy01+dz01*dz01;
684 rsq02 = dx02*dx02+dy02*dy02+dz02*dz02;
685 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
686 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
687 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
688 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
689 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
690 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
692 rinv00 = gmx_invsqrt(rsq00);
693 rinv01 = gmx_invsqrt(rsq01);
694 rinv02 = gmx_invsqrt(rsq02);
695 rinv10 = gmx_invsqrt(rsq10);
696 rinv11 = gmx_invsqrt(rsq11);
697 rinv12 = gmx_invsqrt(rsq12);
698 rinv20 = gmx_invsqrt(rsq20);
699 rinv21 = gmx_invsqrt(rsq21);
700 rinv22 = gmx_invsqrt(rsq22);
702 rinvsq00 = rinv00*rinv00;
703 rinvsq01 = rinv01*rinv01;
704 rinvsq02 = rinv02*rinv02;
705 rinvsq10 = rinv10*rinv10;
706 rinvsq11 = rinv11*rinv11;
707 rinvsq12 = rinv12*rinv12;
708 rinvsq20 = rinv20*rinv20;
709 rinvsq21 = rinv21*rinv21;
710 rinvsq22 = rinv22*rinv22;
712 /**************************
713 * CALCULATE INTERACTIONS *
714 **************************/
716 /* COULOMB ELECTROSTATICS */
718 felec = velec*rinvsq00;
722 /* Calculate temporary vectorial force */
727 /* Update vectorial force */
731 f[j_coord_offset+DIM*0+XX] -= tx;
732 f[j_coord_offset+DIM*0+YY] -= ty;
733 f[j_coord_offset+DIM*0+ZZ] -= tz;
735 /**************************
736 * CALCULATE INTERACTIONS *
737 **************************/
739 /* COULOMB ELECTROSTATICS */
741 felec = velec*rinvsq01;
745 /* Calculate temporary vectorial force */
750 /* Update vectorial force */
754 f[j_coord_offset+DIM*1+XX] -= tx;
755 f[j_coord_offset+DIM*1+YY] -= ty;
756 f[j_coord_offset+DIM*1+ZZ] -= tz;
758 /**************************
759 * CALCULATE INTERACTIONS *
760 **************************/
762 /* COULOMB ELECTROSTATICS */
764 felec = velec*rinvsq02;
768 /* Calculate temporary vectorial force */
773 /* Update vectorial force */
777 f[j_coord_offset+DIM*2+XX] -= tx;
778 f[j_coord_offset+DIM*2+YY] -= ty;
779 f[j_coord_offset+DIM*2+ZZ] -= tz;
781 /**************************
782 * CALCULATE INTERACTIONS *
783 **************************/
785 /* COULOMB ELECTROSTATICS */
787 felec = velec*rinvsq10;
791 /* Calculate temporary vectorial force */
796 /* Update vectorial force */
800 f[j_coord_offset+DIM*0+XX] -= tx;
801 f[j_coord_offset+DIM*0+YY] -= ty;
802 f[j_coord_offset+DIM*0+ZZ] -= tz;
804 /**************************
805 * CALCULATE INTERACTIONS *
806 **************************/
808 /* COULOMB ELECTROSTATICS */
810 felec = velec*rinvsq11;
814 /* Calculate temporary vectorial force */
819 /* Update vectorial force */
823 f[j_coord_offset+DIM*1+XX] -= tx;
824 f[j_coord_offset+DIM*1+YY] -= ty;
825 f[j_coord_offset+DIM*1+ZZ] -= tz;
827 /**************************
828 * CALCULATE INTERACTIONS *
829 **************************/
831 /* COULOMB ELECTROSTATICS */
833 felec = velec*rinvsq12;
837 /* Calculate temporary vectorial force */
842 /* Update vectorial force */
846 f[j_coord_offset+DIM*2+XX] -= tx;
847 f[j_coord_offset+DIM*2+YY] -= ty;
848 f[j_coord_offset+DIM*2+ZZ] -= tz;
850 /**************************
851 * CALCULATE INTERACTIONS *
852 **************************/
854 /* COULOMB ELECTROSTATICS */
856 felec = velec*rinvsq20;
860 /* Calculate temporary vectorial force */
865 /* Update vectorial force */
869 f[j_coord_offset+DIM*0+XX] -= tx;
870 f[j_coord_offset+DIM*0+YY] -= ty;
871 f[j_coord_offset+DIM*0+ZZ] -= tz;
873 /**************************
874 * CALCULATE INTERACTIONS *
875 **************************/
877 /* COULOMB ELECTROSTATICS */
879 felec = velec*rinvsq21;
883 /* Calculate temporary vectorial force */
888 /* Update vectorial force */
892 f[j_coord_offset+DIM*1+XX] -= tx;
893 f[j_coord_offset+DIM*1+YY] -= ty;
894 f[j_coord_offset+DIM*1+ZZ] -= tz;
896 /**************************
897 * CALCULATE INTERACTIONS *
898 **************************/
900 /* COULOMB ELECTROSTATICS */
902 felec = velec*rinvsq22;
906 /* Calculate temporary vectorial force */
911 /* Update vectorial force */
915 f[j_coord_offset+DIM*2+XX] -= tx;
916 f[j_coord_offset+DIM*2+YY] -= ty;
917 f[j_coord_offset+DIM*2+ZZ] -= tz;
919 /* Inner loop uses 234 flops */
921 /* End of innermost loop */
924 f[i_coord_offset+DIM*0+XX] += fix0;
925 f[i_coord_offset+DIM*0+YY] += fiy0;
926 f[i_coord_offset+DIM*0+ZZ] += fiz0;
930 f[i_coord_offset+DIM*1+XX] += fix1;
931 f[i_coord_offset+DIM*1+YY] += fiy1;
932 f[i_coord_offset+DIM*1+ZZ] += fiz1;
936 f[i_coord_offset+DIM*2+XX] += fix2;
937 f[i_coord_offset+DIM*2+YY] += fiy2;
938 f[i_coord_offset+DIM*2+ZZ] += fiz2;
942 fshift[i_shift_offset+XX] += tx;
943 fshift[i_shift_offset+YY] += ty;
944 fshift[i_shift_offset+ZZ] += tz;
946 /* Increment number of inner iterations */
947 inneriter += j_index_end - j_index_start;
949 /* Outer loop uses 30 flops */
952 /* Increment number of outer iterations */
955 /* Update outer/inner flops */
957 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_W3W3_F,outeriter*30 + inneriter*234);