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.
44 #include "../nb_kernel.h"
45 #include "gromacs/legacyheaders/types/simple.h"
46 #include "gromacs/math/vec.h"
47 #include "gromacs/legacyheaders/nrnb.h"
50 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_c
51 * Electrostatics interaction: Coulomb
52 * VdW interaction: None
53 * Geometry: Water3-Water3
54 * Calculate force/pot: PotentialAndForce
57 nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_c
58 (t_nblist * gmx_restrict nlist,
59 rvec * gmx_restrict xx,
60 rvec * gmx_restrict ff,
61 t_forcerec * gmx_restrict fr,
62 t_mdatoms * gmx_restrict mdatoms,
63 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
64 t_nrnb * gmx_restrict nrnb)
66 int i_shift_offset,i_coord_offset,j_coord_offset;
67 int j_index_start,j_index_end;
68 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
69 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
70 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
71 real *shiftvec,*fshift,*x,*f;
73 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
75 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
77 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
79 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
81 real jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
83 real jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
84 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
85 real dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01,cexp1_01,cexp2_01;
86 real dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02,cexp1_02,cexp2_02;
87 real dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
88 real dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
89 real dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
90 real dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
91 real dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
92 real dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
93 real velec,felec,velecsum,facel,crf,krf,krf2;
101 jindex = nlist->jindex;
103 shiftidx = nlist->shift;
105 shiftvec = fr->shift_vec[0];
106 fshift = fr->fshift[0];
108 charge = mdatoms->chargeA;
110 /* Setup water-specific parameters */
111 inr = nlist->iinr[0];
112 iq0 = facel*charge[inr+0];
113 iq1 = facel*charge[inr+1];
114 iq2 = facel*charge[inr+2];
132 /* Start outer loop over neighborlists */
133 for(iidx=0; iidx<nri; iidx++)
135 /* Load shift vector for this list */
136 i_shift_offset = DIM*shiftidx[iidx];
137 shX = shiftvec[i_shift_offset+XX];
138 shY = shiftvec[i_shift_offset+YY];
139 shZ = shiftvec[i_shift_offset+ZZ];
141 /* Load limits for loop over neighbors */
142 j_index_start = jindex[iidx];
143 j_index_end = jindex[iidx+1];
145 /* Get outer coordinate index */
147 i_coord_offset = DIM*inr;
149 /* Load i particle coords and add shift vector */
150 ix0 = shX + x[i_coord_offset+DIM*0+XX];
151 iy0 = shY + x[i_coord_offset+DIM*0+YY];
152 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
153 ix1 = shX + x[i_coord_offset+DIM*1+XX];
154 iy1 = shY + x[i_coord_offset+DIM*1+YY];
155 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
156 ix2 = shX + x[i_coord_offset+DIM*2+XX];
157 iy2 = shY + x[i_coord_offset+DIM*2+YY];
158 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
170 /* Reset potential sums */
173 /* Start inner kernel loop */
174 for(jidx=j_index_start; jidx<j_index_end; jidx++)
176 /* Get j neighbor index, and coordinate index */
178 j_coord_offset = DIM*jnr;
180 /* load j atom coordinates */
181 jx0 = x[j_coord_offset+DIM*0+XX];
182 jy0 = x[j_coord_offset+DIM*0+YY];
183 jz0 = x[j_coord_offset+DIM*0+ZZ];
184 jx1 = x[j_coord_offset+DIM*1+XX];
185 jy1 = x[j_coord_offset+DIM*1+YY];
186 jz1 = x[j_coord_offset+DIM*1+ZZ];
187 jx2 = x[j_coord_offset+DIM*2+XX];
188 jy2 = x[j_coord_offset+DIM*2+YY];
189 jz2 = x[j_coord_offset+DIM*2+ZZ];
191 /* Calculate displacement vector */
220 /* Calculate squared distance and things based on it */
221 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
222 rsq01 = dx01*dx01+dy01*dy01+dz01*dz01;
223 rsq02 = dx02*dx02+dy02*dy02+dz02*dz02;
224 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
225 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
226 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
227 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
228 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
229 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
231 rinv00 = gmx_invsqrt(rsq00);
232 rinv01 = gmx_invsqrt(rsq01);
233 rinv02 = gmx_invsqrt(rsq02);
234 rinv10 = gmx_invsqrt(rsq10);
235 rinv11 = gmx_invsqrt(rsq11);
236 rinv12 = gmx_invsqrt(rsq12);
237 rinv20 = gmx_invsqrt(rsq20);
238 rinv21 = gmx_invsqrt(rsq21);
239 rinv22 = gmx_invsqrt(rsq22);
241 rinvsq00 = rinv00*rinv00;
242 rinvsq01 = rinv01*rinv01;
243 rinvsq02 = rinv02*rinv02;
244 rinvsq10 = rinv10*rinv10;
245 rinvsq11 = rinv11*rinv11;
246 rinvsq12 = rinv12*rinv12;
247 rinvsq20 = rinv20*rinv20;
248 rinvsq21 = rinv21*rinv21;
249 rinvsq22 = rinv22*rinv22;
251 /**************************
252 * CALCULATE INTERACTIONS *
253 **************************/
255 /* COULOMB ELECTROSTATICS */
257 felec = velec*rinvsq00;
259 /* Update potential sums from outer loop */
264 /* Calculate temporary vectorial force */
269 /* Update vectorial force */
273 f[j_coord_offset+DIM*0+XX] -= tx;
274 f[j_coord_offset+DIM*0+YY] -= ty;
275 f[j_coord_offset+DIM*0+ZZ] -= tz;
277 /**************************
278 * CALCULATE INTERACTIONS *
279 **************************/
281 /* COULOMB ELECTROSTATICS */
283 felec = velec*rinvsq01;
285 /* Update potential sums from outer loop */
290 /* Calculate temporary vectorial force */
295 /* Update vectorial force */
299 f[j_coord_offset+DIM*1+XX] -= tx;
300 f[j_coord_offset+DIM*1+YY] -= ty;
301 f[j_coord_offset+DIM*1+ZZ] -= tz;
303 /**************************
304 * CALCULATE INTERACTIONS *
305 **************************/
307 /* COULOMB ELECTROSTATICS */
309 felec = velec*rinvsq02;
311 /* Update potential sums from outer loop */
316 /* Calculate temporary vectorial force */
321 /* Update vectorial force */
325 f[j_coord_offset+DIM*2+XX] -= tx;
326 f[j_coord_offset+DIM*2+YY] -= ty;
327 f[j_coord_offset+DIM*2+ZZ] -= tz;
329 /**************************
330 * CALCULATE INTERACTIONS *
331 **************************/
333 /* COULOMB ELECTROSTATICS */
335 felec = velec*rinvsq10;
337 /* Update potential sums from outer loop */
342 /* Calculate temporary vectorial force */
347 /* Update vectorial force */
351 f[j_coord_offset+DIM*0+XX] -= tx;
352 f[j_coord_offset+DIM*0+YY] -= ty;
353 f[j_coord_offset+DIM*0+ZZ] -= tz;
355 /**************************
356 * CALCULATE INTERACTIONS *
357 **************************/
359 /* COULOMB ELECTROSTATICS */
361 felec = velec*rinvsq11;
363 /* Update potential sums from outer loop */
368 /* Calculate temporary vectorial force */
373 /* Update vectorial force */
377 f[j_coord_offset+DIM*1+XX] -= tx;
378 f[j_coord_offset+DIM*1+YY] -= ty;
379 f[j_coord_offset+DIM*1+ZZ] -= tz;
381 /**************************
382 * CALCULATE INTERACTIONS *
383 **************************/
385 /* COULOMB ELECTROSTATICS */
387 felec = velec*rinvsq12;
389 /* Update potential sums from outer loop */
394 /* Calculate temporary vectorial force */
399 /* Update vectorial force */
403 f[j_coord_offset+DIM*2+XX] -= tx;
404 f[j_coord_offset+DIM*2+YY] -= ty;
405 f[j_coord_offset+DIM*2+ZZ] -= tz;
407 /**************************
408 * CALCULATE INTERACTIONS *
409 **************************/
411 /* COULOMB ELECTROSTATICS */
413 felec = velec*rinvsq20;
415 /* Update potential sums from outer loop */
420 /* Calculate temporary vectorial force */
425 /* Update vectorial force */
429 f[j_coord_offset+DIM*0+XX] -= tx;
430 f[j_coord_offset+DIM*0+YY] -= ty;
431 f[j_coord_offset+DIM*0+ZZ] -= tz;
433 /**************************
434 * CALCULATE INTERACTIONS *
435 **************************/
437 /* COULOMB ELECTROSTATICS */
439 felec = velec*rinvsq21;
441 /* Update potential sums from outer loop */
446 /* Calculate temporary vectorial force */
451 /* Update vectorial force */
455 f[j_coord_offset+DIM*1+XX] -= tx;
456 f[j_coord_offset+DIM*1+YY] -= ty;
457 f[j_coord_offset+DIM*1+ZZ] -= tz;
459 /**************************
460 * CALCULATE INTERACTIONS *
461 **************************/
463 /* COULOMB ELECTROSTATICS */
465 felec = velec*rinvsq22;
467 /* Update potential sums from outer loop */
472 /* Calculate temporary vectorial force */
477 /* Update vectorial force */
481 f[j_coord_offset+DIM*2+XX] -= tx;
482 f[j_coord_offset+DIM*2+YY] -= ty;
483 f[j_coord_offset+DIM*2+ZZ] -= tz;
485 /* Inner loop uses 243 flops */
487 /* End of innermost loop */
490 f[i_coord_offset+DIM*0+XX] += fix0;
491 f[i_coord_offset+DIM*0+YY] += fiy0;
492 f[i_coord_offset+DIM*0+ZZ] += fiz0;
496 f[i_coord_offset+DIM*1+XX] += fix1;
497 f[i_coord_offset+DIM*1+YY] += fiy1;
498 f[i_coord_offset+DIM*1+ZZ] += fiz1;
502 f[i_coord_offset+DIM*2+XX] += fix2;
503 f[i_coord_offset+DIM*2+YY] += fiy2;
504 f[i_coord_offset+DIM*2+ZZ] += fiz2;
508 fshift[i_shift_offset+XX] += tx;
509 fshift[i_shift_offset+YY] += ty;
510 fshift[i_shift_offset+ZZ] += tz;
513 /* Update potential energies */
514 kernel_data->energygrp_elec[ggid] += velecsum;
516 /* Increment number of inner iterations */
517 inneriter += j_index_end - j_index_start;
519 /* Outer loop uses 31 flops */
522 /* Increment number of outer iterations */
525 /* Update outer/inner flops */
527 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_W3W3_VF,outeriter*31 + inneriter*243);
530 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_c
531 * Electrostatics interaction: Coulomb
532 * VdW interaction: None
533 * Geometry: Water3-Water3
534 * Calculate force/pot: Force
537 nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_c
538 (t_nblist * gmx_restrict nlist,
539 rvec * gmx_restrict xx,
540 rvec * gmx_restrict ff,
541 t_forcerec * gmx_restrict fr,
542 t_mdatoms * gmx_restrict mdatoms,
543 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
544 t_nrnb * gmx_restrict nrnb)
546 int i_shift_offset,i_coord_offset,j_coord_offset;
547 int j_index_start,j_index_end;
548 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
549 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
550 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
551 real *shiftvec,*fshift,*x,*f;
553 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
555 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
557 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
559 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
561 real jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
563 real jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
564 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
565 real dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01,cexp1_01,cexp2_01;
566 real dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02,cexp1_02,cexp2_02;
567 real dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
568 real dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
569 real dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
570 real dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
571 real dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
572 real dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
573 real velec,felec,velecsum,facel,crf,krf,krf2;
581 jindex = nlist->jindex;
583 shiftidx = nlist->shift;
585 shiftvec = fr->shift_vec[0];
586 fshift = fr->fshift[0];
588 charge = mdatoms->chargeA;
590 /* Setup water-specific parameters */
591 inr = nlist->iinr[0];
592 iq0 = facel*charge[inr+0];
593 iq1 = facel*charge[inr+1];
594 iq2 = facel*charge[inr+2];
612 /* Start outer loop over neighborlists */
613 for(iidx=0; iidx<nri; iidx++)
615 /* Load shift vector for this list */
616 i_shift_offset = DIM*shiftidx[iidx];
617 shX = shiftvec[i_shift_offset+XX];
618 shY = shiftvec[i_shift_offset+YY];
619 shZ = shiftvec[i_shift_offset+ZZ];
621 /* Load limits for loop over neighbors */
622 j_index_start = jindex[iidx];
623 j_index_end = jindex[iidx+1];
625 /* Get outer coordinate index */
627 i_coord_offset = DIM*inr;
629 /* Load i particle coords and add shift vector */
630 ix0 = shX + x[i_coord_offset+DIM*0+XX];
631 iy0 = shY + x[i_coord_offset+DIM*0+YY];
632 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
633 ix1 = shX + x[i_coord_offset+DIM*1+XX];
634 iy1 = shY + x[i_coord_offset+DIM*1+YY];
635 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
636 ix2 = shX + x[i_coord_offset+DIM*2+XX];
637 iy2 = shY + x[i_coord_offset+DIM*2+YY];
638 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
650 /* Start inner kernel loop */
651 for(jidx=j_index_start; jidx<j_index_end; jidx++)
653 /* Get j neighbor index, and coordinate index */
655 j_coord_offset = DIM*jnr;
657 /* load j atom coordinates */
658 jx0 = x[j_coord_offset+DIM*0+XX];
659 jy0 = x[j_coord_offset+DIM*0+YY];
660 jz0 = x[j_coord_offset+DIM*0+ZZ];
661 jx1 = x[j_coord_offset+DIM*1+XX];
662 jy1 = x[j_coord_offset+DIM*1+YY];
663 jz1 = x[j_coord_offset+DIM*1+ZZ];
664 jx2 = x[j_coord_offset+DIM*2+XX];
665 jy2 = x[j_coord_offset+DIM*2+YY];
666 jz2 = x[j_coord_offset+DIM*2+ZZ];
668 /* Calculate displacement vector */
697 /* Calculate squared distance and things based on it */
698 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
699 rsq01 = dx01*dx01+dy01*dy01+dz01*dz01;
700 rsq02 = dx02*dx02+dy02*dy02+dz02*dz02;
701 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
702 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
703 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
704 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
705 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
706 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
708 rinv00 = gmx_invsqrt(rsq00);
709 rinv01 = gmx_invsqrt(rsq01);
710 rinv02 = gmx_invsqrt(rsq02);
711 rinv10 = gmx_invsqrt(rsq10);
712 rinv11 = gmx_invsqrt(rsq11);
713 rinv12 = gmx_invsqrt(rsq12);
714 rinv20 = gmx_invsqrt(rsq20);
715 rinv21 = gmx_invsqrt(rsq21);
716 rinv22 = gmx_invsqrt(rsq22);
718 rinvsq00 = rinv00*rinv00;
719 rinvsq01 = rinv01*rinv01;
720 rinvsq02 = rinv02*rinv02;
721 rinvsq10 = rinv10*rinv10;
722 rinvsq11 = rinv11*rinv11;
723 rinvsq12 = rinv12*rinv12;
724 rinvsq20 = rinv20*rinv20;
725 rinvsq21 = rinv21*rinv21;
726 rinvsq22 = rinv22*rinv22;
728 /**************************
729 * CALCULATE INTERACTIONS *
730 **************************/
732 /* COULOMB ELECTROSTATICS */
734 felec = velec*rinvsq00;
738 /* Calculate temporary vectorial force */
743 /* Update vectorial force */
747 f[j_coord_offset+DIM*0+XX] -= tx;
748 f[j_coord_offset+DIM*0+YY] -= ty;
749 f[j_coord_offset+DIM*0+ZZ] -= tz;
751 /**************************
752 * CALCULATE INTERACTIONS *
753 **************************/
755 /* COULOMB ELECTROSTATICS */
757 felec = velec*rinvsq01;
761 /* Calculate temporary vectorial force */
766 /* Update vectorial force */
770 f[j_coord_offset+DIM*1+XX] -= tx;
771 f[j_coord_offset+DIM*1+YY] -= ty;
772 f[j_coord_offset+DIM*1+ZZ] -= tz;
774 /**************************
775 * CALCULATE INTERACTIONS *
776 **************************/
778 /* COULOMB ELECTROSTATICS */
780 felec = velec*rinvsq02;
784 /* Calculate temporary vectorial force */
789 /* Update vectorial force */
793 f[j_coord_offset+DIM*2+XX] -= tx;
794 f[j_coord_offset+DIM*2+YY] -= ty;
795 f[j_coord_offset+DIM*2+ZZ] -= tz;
797 /**************************
798 * CALCULATE INTERACTIONS *
799 **************************/
801 /* COULOMB ELECTROSTATICS */
803 felec = velec*rinvsq10;
807 /* Calculate temporary vectorial force */
812 /* Update vectorial force */
816 f[j_coord_offset+DIM*0+XX] -= tx;
817 f[j_coord_offset+DIM*0+YY] -= ty;
818 f[j_coord_offset+DIM*0+ZZ] -= tz;
820 /**************************
821 * CALCULATE INTERACTIONS *
822 **************************/
824 /* COULOMB ELECTROSTATICS */
826 felec = velec*rinvsq11;
830 /* Calculate temporary vectorial force */
835 /* Update vectorial force */
839 f[j_coord_offset+DIM*1+XX] -= tx;
840 f[j_coord_offset+DIM*1+YY] -= ty;
841 f[j_coord_offset+DIM*1+ZZ] -= tz;
843 /**************************
844 * CALCULATE INTERACTIONS *
845 **************************/
847 /* COULOMB ELECTROSTATICS */
849 felec = velec*rinvsq12;
853 /* Calculate temporary vectorial force */
858 /* Update vectorial force */
862 f[j_coord_offset+DIM*2+XX] -= tx;
863 f[j_coord_offset+DIM*2+YY] -= ty;
864 f[j_coord_offset+DIM*2+ZZ] -= tz;
866 /**************************
867 * CALCULATE INTERACTIONS *
868 **************************/
870 /* COULOMB ELECTROSTATICS */
872 felec = velec*rinvsq20;
876 /* Calculate temporary vectorial force */
881 /* Update vectorial force */
885 f[j_coord_offset+DIM*0+XX] -= tx;
886 f[j_coord_offset+DIM*0+YY] -= ty;
887 f[j_coord_offset+DIM*0+ZZ] -= tz;
889 /**************************
890 * CALCULATE INTERACTIONS *
891 **************************/
893 /* COULOMB ELECTROSTATICS */
895 felec = velec*rinvsq21;
899 /* Calculate temporary vectorial force */
904 /* Update vectorial force */
908 f[j_coord_offset+DIM*1+XX] -= tx;
909 f[j_coord_offset+DIM*1+YY] -= ty;
910 f[j_coord_offset+DIM*1+ZZ] -= tz;
912 /**************************
913 * CALCULATE INTERACTIONS *
914 **************************/
916 /* COULOMB ELECTROSTATICS */
918 felec = velec*rinvsq22;
922 /* Calculate temporary vectorial force */
927 /* Update vectorial force */
931 f[j_coord_offset+DIM*2+XX] -= tx;
932 f[j_coord_offset+DIM*2+YY] -= ty;
933 f[j_coord_offset+DIM*2+ZZ] -= tz;
935 /* Inner loop uses 234 flops */
937 /* End of innermost loop */
940 f[i_coord_offset+DIM*0+XX] += fix0;
941 f[i_coord_offset+DIM*0+YY] += fiy0;
942 f[i_coord_offset+DIM*0+ZZ] += fiz0;
946 f[i_coord_offset+DIM*1+XX] += fix1;
947 f[i_coord_offset+DIM*1+YY] += fiy1;
948 f[i_coord_offset+DIM*1+ZZ] += fiz1;
952 f[i_coord_offset+DIM*2+XX] += fix2;
953 f[i_coord_offset+DIM*2+YY] += fiy2;
954 f[i_coord_offset+DIM*2+ZZ] += fiz2;
958 fshift[i_shift_offset+XX] += tx;
959 fshift[i_shift_offset+YY] += ty;
960 fshift[i_shift_offset+ZZ] += tz;
962 /* Increment number of inner iterations */
963 inneriter += j_index_end - j_index_start;
965 /* Outer loop uses 30 flops */
968 /* Increment number of outer iterations */
971 /* Update outer/inner flops */
973 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_W3W3_F,outeriter*30 + inneriter*234);