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_GeomW4W4_VF_c
35 * Electrostatics interaction: Coulomb
36 * VdW interaction: None
37 * Geometry: Water4-Water4
38 * Calculate force/pot: PotentialAndForce
41 nb_kernel_ElecCoul_VdwNone_GeomW4W4_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 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
59 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
61 real ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
63 real jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
65 real jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
67 real jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3;
68 real dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
69 real dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
70 real dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13,cexp1_13,cexp2_13;
71 real dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
72 real dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
73 real dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23,cexp1_23,cexp2_23;
74 real dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31,cexp1_31,cexp2_31;
75 real dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32,cexp1_32,cexp2_32;
76 real dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33,cexp1_33,cexp2_33;
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 iq1 = facel*charge[inr+1];
97 iq2 = facel*charge[inr+2];
98 iq3 = facel*charge[inr+3];
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 ix1 = shX + x[i_coord_offset+DIM*1+XX];
135 iy1 = shY + x[i_coord_offset+DIM*1+YY];
136 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
137 ix2 = shX + x[i_coord_offset+DIM*2+XX];
138 iy2 = shY + x[i_coord_offset+DIM*2+YY];
139 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
140 ix3 = shX + x[i_coord_offset+DIM*3+XX];
141 iy3 = shY + x[i_coord_offset+DIM*3+YY];
142 iz3 = shZ + x[i_coord_offset+DIM*3+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 jx1 = x[j_coord_offset+DIM*1+XX];
166 jy1 = x[j_coord_offset+DIM*1+YY];
167 jz1 = x[j_coord_offset+DIM*1+ZZ];
168 jx2 = x[j_coord_offset+DIM*2+XX];
169 jy2 = x[j_coord_offset+DIM*2+YY];
170 jz2 = x[j_coord_offset+DIM*2+ZZ];
171 jx3 = x[j_coord_offset+DIM*3+XX];
172 jy3 = x[j_coord_offset+DIM*3+YY];
173 jz3 = x[j_coord_offset+DIM*3+ZZ];
175 /* Calculate displacement vector */
204 /* Calculate squared distance and things based on it */
205 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
206 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
207 rsq13 = dx13*dx13+dy13*dy13+dz13*dz13;
208 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
209 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
210 rsq23 = dx23*dx23+dy23*dy23+dz23*dz23;
211 rsq31 = dx31*dx31+dy31*dy31+dz31*dz31;
212 rsq32 = dx32*dx32+dy32*dy32+dz32*dz32;
213 rsq33 = dx33*dx33+dy33*dy33+dz33*dz33;
215 rinv11 = gmx_invsqrt(rsq11);
216 rinv12 = gmx_invsqrt(rsq12);
217 rinv13 = gmx_invsqrt(rsq13);
218 rinv21 = gmx_invsqrt(rsq21);
219 rinv22 = gmx_invsqrt(rsq22);
220 rinv23 = gmx_invsqrt(rsq23);
221 rinv31 = gmx_invsqrt(rsq31);
222 rinv32 = gmx_invsqrt(rsq32);
223 rinv33 = gmx_invsqrt(rsq33);
225 rinvsq11 = rinv11*rinv11;
226 rinvsq12 = rinv12*rinv12;
227 rinvsq13 = rinv13*rinv13;
228 rinvsq21 = rinv21*rinv21;
229 rinvsq22 = rinv22*rinv22;
230 rinvsq23 = rinv23*rinv23;
231 rinvsq31 = rinv31*rinv31;
232 rinvsq32 = rinv32*rinv32;
233 rinvsq33 = rinv33*rinv33;
235 /**************************
236 * CALCULATE INTERACTIONS *
237 **************************/
239 /* COULOMB ELECTROSTATICS */
241 felec = velec*rinvsq11;
243 /* Update potential sums from outer loop */
248 /* Calculate temporary vectorial force */
253 /* Update vectorial force */
257 f[j_coord_offset+DIM*1+XX] -= tx;
258 f[j_coord_offset+DIM*1+YY] -= ty;
259 f[j_coord_offset+DIM*1+ZZ] -= tz;
261 /**************************
262 * CALCULATE INTERACTIONS *
263 **************************/
265 /* COULOMB ELECTROSTATICS */
267 felec = velec*rinvsq12;
269 /* Update potential sums from outer loop */
274 /* Calculate temporary vectorial force */
279 /* Update vectorial force */
283 f[j_coord_offset+DIM*2+XX] -= tx;
284 f[j_coord_offset+DIM*2+YY] -= ty;
285 f[j_coord_offset+DIM*2+ZZ] -= tz;
287 /**************************
288 * CALCULATE INTERACTIONS *
289 **************************/
291 /* COULOMB ELECTROSTATICS */
293 felec = velec*rinvsq13;
295 /* Update potential sums from outer loop */
300 /* Calculate temporary vectorial force */
305 /* Update vectorial force */
309 f[j_coord_offset+DIM*3+XX] -= tx;
310 f[j_coord_offset+DIM*3+YY] -= ty;
311 f[j_coord_offset+DIM*3+ZZ] -= tz;
313 /**************************
314 * CALCULATE INTERACTIONS *
315 **************************/
317 /* COULOMB ELECTROSTATICS */
319 felec = velec*rinvsq21;
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*rinvsq22;
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*rinvsq23;
373 /* Update potential sums from outer loop */
378 /* Calculate temporary vectorial force */
383 /* Update vectorial force */
387 f[j_coord_offset+DIM*3+XX] -= tx;
388 f[j_coord_offset+DIM*3+YY] -= ty;
389 f[j_coord_offset+DIM*3+ZZ] -= tz;
391 /**************************
392 * CALCULATE INTERACTIONS *
393 **************************/
395 /* COULOMB ELECTROSTATICS */
397 felec = velec*rinvsq31;
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*rinvsq32;
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*rinvsq33;
451 /* Update potential sums from outer loop */
456 /* Calculate temporary vectorial force */
461 /* Update vectorial force */
465 f[j_coord_offset+DIM*3+XX] -= tx;
466 f[j_coord_offset+DIM*3+YY] -= ty;
467 f[j_coord_offset+DIM*3+ZZ] -= tz;
469 /* Inner loop uses 243 flops */
471 /* End of innermost loop */
474 f[i_coord_offset+DIM*1+XX] += fix1;
475 f[i_coord_offset+DIM*1+YY] += fiy1;
476 f[i_coord_offset+DIM*1+ZZ] += fiz1;
480 f[i_coord_offset+DIM*2+XX] += fix2;
481 f[i_coord_offset+DIM*2+YY] += fiy2;
482 f[i_coord_offset+DIM*2+ZZ] += fiz2;
486 f[i_coord_offset+DIM*3+XX] += fix3;
487 f[i_coord_offset+DIM*3+YY] += fiy3;
488 f[i_coord_offset+DIM*3+ZZ] += fiz3;
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_W4W4_VF,outeriter*31 + inneriter*243);
514 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_c
515 * Electrostatics interaction: Coulomb
516 * VdW interaction: None
517 * Geometry: Water4-Water4
518 * Calculate force/pot: Force
521 nb_kernel_ElecCoul_VdwNone_GeomW4W4_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 ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
539 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
541 real ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3;
543 real jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
545 real jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
547 real jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3;
548 real dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
549 real dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
550 real dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13,cexp1_13,cexp2_13;
551 real dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
552 real dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
553 real dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23,cexp1_23,cexp2_23;
554 real dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31,cexp1_31,cexp2_31;
555 real dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32,cexp1_32,cexp2_32;
556 real dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33,cexp1_33,cexp2_33;
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 iq1 = facel*charge[inr+1];
577 iq2 = facel*charge[inr+2];
578 iq3 = facel*charge[inr+3];
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 ix1 = shX + x[i_coord_offset+DIM*1+XX];
615 iy1 = shY + x[i_coord_offset+DIM*1+YY];
616 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
617 ix2 = shX + x[i_coord_offset+DIM*2+XX];
618 iy2 = shY + x[i_coord_offset+DIM*2+YY];
619 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
620 ix3 = shX + x[i_coord_offset+DIM*3+XX];
621 iy3 = shY + x[i_coord_offset+DIM*3+YY];
622 iz3 = shZ + x[i_coord_offset+DIM*3+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 jx1 = x[j_coord_offset+DIM*1+XX];
643 jy1 = x[j_coord_offset+DIM*1+YY];
644 jz1 = x[j_coord_offset+DIM*1+ZZ];
645 jx2 = x[j_coord_offset+DIM*2+XX];
646 jy2 = x[j_coord_offset+DIM*2+YY];
647 jz2 = x[j_coord_offset+DIM*2+ZZ];
648 jx3 = x[j_coord_offset+DIM*3+XX];
649 jy3 = x[j_coord_offset+DIM*3+YY];
650 jz3 = x[j_coord_offset+DIM*3+ZZ];
652 /* Calculate displacement vector */
681 /* Calculate squared distance and things based on it */
682 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
683 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
684 rsq13 = dx13*dx13+dy13*dy13+dz13*dz13;
685 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
686 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
687 rsq23 = dx23*dx23+dy23*dy23+dz23*dz23;
688 rsq31 = dx31*dx31+dy31*dy31+dz31*dz31;
689 rsq32 = dx32*dx32+dy32*dy32+dz32*dz32;
690 rsq33 = dx33*dx33+dy33*dy33+dz33*dz33;
692 rinv11 = gmx_invsqrt(rsq11);
693 rinv12 = gmx_invsqrt(rsq12);
694 rinv13 = gmx_invsqrt(rsq13);
695 rinv21 = gmx_invsqrt(rsq21);
696 rinv22 = gmx_invsqrt(rsq22);
697 rinv23 = gmx_invsqrt(rsq23);
698 rinv31 = gmx_invsqrt(rsq31);
699 rinv32 = gmx_invsqrt(rsq32);
700 rinv33 = gmx_invsqrt(rsq33);
702 rinvsq11 = rinv11*rinv11;
703 rinvsq12 = rinv12*rinv12;
704 rinvsq13 = rinv13*rinv13;
705 rinvsq21 = rinv21*rinv21;
706 rinvsq22 = rinv22*rinv22;
707 rinvsq23 = rinv23*rinv23;
708 rinvsq31 = rinv31*rinv31;
709 rinvsq32 = rinv32*rinv32;
710 rinvsq33 = rinv33*rinv33;
712 /**************************
713 * CALCULATE INTERACTIONS *
714 **************************/
716 /* COULOMB ELECTROSTATICS */
718 felec = velec*rinvsq11;
722 /* Calculate temporary vectorial force */
727 /* Update vectorial force */
731 f[j_coord_offset+DIM*1+XX] -= tx;
732 f[j_coord_offset+DIM*1+YY] -= ty;
733 f[j_coord_offset+DIM*1+ZZ] -= tz;
735 /**************************
736 * CALCULATE INTERACTIONS *
737 **************************/
739 /* COULOMB ELECTROSTATICS */
741 felec = velec*rinvsq12;
745 /* Calculate temporary vectorial force */
750 /* Update vectorial force */
754 f[j_coord_offset+DIM*2+XX] -= tx;
755 f[j_coord_offset+DIM*2+YY] -= ty;
756 f[j_coord_offset+DIM*2+ZZ] -= tz;
758 /**************************
759 * CALCULATE INTERACTIONS *
760 **************************/
762 /* COULOMB ELECTROSTATICS */
764 felec = velec*rinvsq13;
768 /* Calculate temporary vectorial force */
773 /* Update vectorial force */
777 f[j_coord_offset+DIM*3+XX] -= tx;
778 f[j_coord_offset+DIM*3+YY] -= ty;
779 f[j_coord_offset+DIM*3+ZZ] -= tz;
781 /**************************
782 * CALCULATE INTERACTIONS *
783 **************************/
785 /* COULOMB ELECTROSTATICS */
787 felec = velec*rinvsq21;
791 /* Calculate temporary vectorial force */
796 /* Update vectorial force */
800 f[j_coord_offset+DIM*1+XX] -= tx;
801 f[j_coord_offset+DIM*1+YY] -= ty;
802 f[j_coord_offset+DIM*1+ZZ] -= tz;
804 /**************************
805 * CALCULATE INTERACTIONS *
806 **************************/
808 /* COULOMB ELECTROSTATICS */
810 felec = velec*rinvsq22;
814 /* Calculate temporary vectorial force */
819 /* Update vectorial force */
823 f[j_coord_offset+DIM*2+XX] -= tx;
824 f[j_coord_offset+DIM*2+YY] -= ty;
825 f[j_coord_offset+DIM*2+ZZ] -= tz;
827 /**************************
828 * CALCULATE INTERACTIONS *
829 **************************/
831 /* COULOMB ELECTROSTATICS */
833 felec = velec*rinvsq23;
837 /* Calculate temporary vectorial force */
842 /* Update vectorial force */
846 f[j_coord_offset+DIM*3+XX] -= tx;
847 f[j_coord_offset+DIM*3+YY] -= ty;
848 f[j_coord_offset+DIM*3+ZZ] -= tz;
850 /**************************
851 * CALCULATE INTERACTIONS *
852 **************************/
854 /* COULOMB ELECTROSTATICS */
856 felec = velec*rinvsq31;
860 /* Calculate temporary vectorial force */
865 /* Update vectorial force */
869 f[j_coord_offset+DIM*1+XX] -= tx;
870 f[j_coord_offset+DIM*1+YY] -= ty;
871 f[j_coord_offset+DIM*1+ZZ] -= tz;
873 /**************************
874 * CALCULATE INTERACTIONS *
875 **************************/
877 /* COULOMB ELECTROSTATICS */
879 felec = velec*rinvsq32;
883 /* Calculate temporary vectorial force */
888 /* Update vectorial force */
892 f[j_coord_offset+DIM*2+XX] -= tx;
893 f[j_coord_offset+DIM*2+YY] -= ty;
894 f[j_coord_offset+DIM*2+ZZ] -= tz;
896 /**************************
897 * CALCULATE INTERACTIONS *
898 **************************/
900 /* COULOMB ELECTROSTATICS */
902 felec = velec*rinvsq33;
906 /* Calculate temporary vectorial force */
911 /* Update vectorial force */
915 f[j_coord_offset+DIM*3+XX] -= tx;
916 f[j_coord_offset+DIM*3+YY] -= ty;
917 f[j_coord_offset+DIM*3+ZZ] -= tz;
919 /* Inner loop uses 234 flops */
921 /* End of innermost loop */
924 f[i_coord_offset+DIM*1+XX] += fix1;
925 f[i_coord_offset+DIM*1+YY] += fiy1;
926 f[i_coord_offset+DIM*1+ZZ] += fiz1;
930 f[i_coord_offset+DIM*2+XX] += fix2;
931 f[i_coord_offset+DIM*2+YY] += fiy2;
932 f[i_coord_offset+DIM*2+ZZ] += fiz2;
936 f[i_coord_offset+DIM*3+XX] += fix3;
937 f[i_coord_offset+DIM*3+YY] += fiy3;
938 f[i_coord_offset+DIM*3+ZZ] += fiz3;
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_W4W4_F,outeriter*30 + inneriter*234);