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.
42 #include "../nb_kernel.h"
43 #include "types/simple.h"
44 #include "gromacs/math/vec.h"
48 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_c
49 * Electrostatics interaction: Coulomb
50 * VdW interaction: None
51 * Geometry: Water3-Water3
52 * Calculate force/pot: PotentialAndForce
55 nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_c
56 (t_nblist * gmx_restrict nlist,
57 rvec * gmx_restrict xx,
58 rvec * gmx_restrict ff,
59 t_forcerec * gmx_restrict fr,
60 t_mdatoms * gmx_restrict mdatoms,
61 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
62 t_nrnb * gmx_restrict nrnb)
64 int i_shift_offset,i_coord_offset,j_coord_offset;
65 int j_index_start,j_index_end;
66 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
67 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
68 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
69 real *shiftvec,*fshift,*x,*f;
71 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
73 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
75 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
77 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
79 real jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
81 real jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
82 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
83 real dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01,cexp1_01,cexp2_01;
84 real dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02,cexp1_02,cexp2_02;
85 real dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
86 real dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
87 real dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
88 real dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
89 real dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
90 real dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
91 real velec,felec,velecsum,facel,crf,krf,krf2;
99 jindex = nlist->jindex;
101 shiftidx = nlist->shift;
103 shiftvec = fr->shift_vec[0];
104 fshift = fr->fshift[0];
106 charge = mdatoms->chargeA;
108 /* Setup water-specific parameters */
109 inr = nlist->iinr[0];
110 iq0 = facel*charge[inr+0];
111 iq1 = facel*charge[inr+1];
112 iq2 = facel*charge[inr+2];
130 /* Start outer loop over neighborlists */
131 for(iidx=0; iidx<nri; iidx++)
133 /* Load shift vector for this list */
134 i_shift_offset = DIM*shiftidx[iidx];
135 shX = shiftvec[i_shift_offset+XX];
136 shY = shiftvec[i_shift_offset+YY];
137 shZ = shiftvec[i_shift_offset+ZZ];
139 /* Load limits for loop over neighbors */
140 j_index_start = jindex[iidx];
141 j_index_end = jindex[iidx+1];
143 /* Get outer coordinate index */
145 i_coord_offset = DIM*inr;
147 /* Load i particle coords and add shift vector */
148 ix0 = shX + x[i_coord_offset+DIM*0+XX];
149 iy0 = shY + x[i_coord_offset+DIM*0+YY];
150 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
151 ix1 = shX + x[i_coord_offset+DIM*1+XX];
152 iy1 = shY + x[i_coord_offset+DIM*1+YY];
153 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
154 ix2 = shX + x[i_coord_offset+DIM*2+XX];
155 iy2 = shY + x[i_coord_offset+DIM*2+YY];
156 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
168 /* Reset potential sums */
171 /* Start inner kernel loop */
172 for(jidx=j_index_start; jidx<j_index_end; jidx++)
174 /* Get j neighbor index, and coordinate index */
176 j_coord_offset = DIM*jnr;
178 /* load j atom coordinates */
179 jx0 = x[j_coord_offset+DIM*0+XX];
180 jy0 = x[j_coord_offset+DIM*0+YY];
181 jz0 = x[j_coord_offset+DIM*0+ZZ];
182 jx1 = x[j_coord_offset+DIM*1+XX];
183 jy1 = x[j_coord_offset+DIM*1+YY];
184 jz1 = x[j_coord_offset+DIM*1+ZZ];
185 jx2 = x[j_coord_offset+DIM*2+XX];
186 jy2 = x[j_coord_offset+DIM*2+YY];
187 jz2 = x[j_coord_offset+DIM*2+ZZ];
189 /* Calculate displacement vector */
218 /* Calculate squared distance and things based on it */
219 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
220 rsq01 = dx01*dx01+dy01*dy01+dz01*dz01;
221 rsq02 = dx02*dx02+dy02*dy02+dz02*dz02;
222 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
223 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
224 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
225 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
226 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
227 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
229 rinv00 = gmx_invsqrt(rsq00);
230 rinv01 = gmx_invsqrt(rsq01);
231 rinv02 = gmx_invsqrt(rsq02);
232 rinv10 = gmx_invsqrt(rsq10);
233 rinv11 = gmx_invsqrt(rsq11);
234 rinv12 = gmx_invsqrt(rsq12);
235 rinv20 = gmx_invsqrt(rsq20);
236 rinv21 = gmx_invsqrt(rsq21);
237 rinv22 = gmx_invsqrt(rsq22);
239 rinvsq00 = rinv00*rinv00;
240 rinvsq01 = rinv01*rinv01;
241 rinvsq02 = rinv02*rinv02;
242 rinvsq10 = rinv10*rinv10;
243 rinvsq11 = rinv11*rinv11;
244 rinvsq12 = rinv12*rinv12;
245 rinvsq20 = rinv20*rinv20;
246 rinvsq21 = rinv21*rinv21;
247 rinvsq22 = rinv22*rinv22;
249 /**************************
250 * CALCULATE INTERACTIONS *
251 **************************/
253 /* COULOMB ELECTROSTATICS */
255 felec = velec*rinvsq00;
257 /* Update potential sums from outer loop */
262 /* Calculate temporary vectorial force */
267 /* Update vectorial force */
271 f[j_coord_offset+DIM*0+XX] -= tx;
272 f[j_coord_offset+DIM*0+YY] -= ty;
273 f[j_coord_offset+DIM*0+ZZ] -= tz;
275 /**************************
276 * CALCULATE INTERACTIONS *
277 **************************/
279 /* COULOMB ELECTROSTATICS */
281 felec = velec*rinvsq01;
283 /* Update potential sums from outer loop */
288 /* Calculate temporary vectorial force */
293 /* Update vectorial force */
297 f[j_coord_offset+DIM*1+XX] -= tx;
298 f[j_coord_offset+DIM*1+YY] -= ty;
299 f[j_coord_offset+DIM*1+ZZ] -= tz;
301 /**************************
302 * CALCULATE INTERACTIONS *
303 **************************/
305 /* COULOMB ELECTROSTATICS */
307 felec = velec*rinvsq02;
309 /* Update potential sums from outer loop */
314 /* Calculate temporary vectorial force */
319 /* Update vectorial force */
323 f[j_coord_offset+DIM*2+XX] -= tx;
324 f[j_coord_offset+DIM*2+YY] -= ty;
325 f[j_coord_offset+DIM*2+ZZ] -= tz;
327 /**************************
328 * CALCULATE INTERACTIONS *
329 **************************/
331 /* COULOMB ELECTROSTATICS */
333 felec = velec*rinvsq10;
335 /* Update potential sums from outer loop */
340 /* Calculate temporary vectorial force */
345 /* Update vectorial force */
349 f[j_coord_offset+DIM*0+XX] -= tx;
350 f[j_coord_offset+DIM*0+YY] -= ty;
351 f[j_coord_offset+DIM*0+ZZ] -= tz;
353 /**************************
354 * CALCULATE INTERACTIONS *
355 **************************/
357 /* COULOMB ELECTROSTATICS */
359 felec = velec*rinvsq11;
361 /* Update potential sums from outer loop */
366 /* Calculate temporary vectorial force */
371 /* Update vectorial force */
375 f[j_coord_offset+DIM*1+XX] -= tx;
376 f[j_coord_offset+DIM*1+YY] -= ty;
377 f[j_coord_offset+DIM*1+ZZ] -= tz;
379 /**************************
380 * CALCULATE INTERACTIONS *
381 **************************/
383 /* COULOMB ELECTROSTATICS */
385 felec = velec*rinvsq12;
387 /* Update potential sums from outer loop */
392 /* Calculate temporary vectorial force */
397 /* Update vectorial force */
401 f[j_coord_offset+DIM*2+XX] -= tx;
402 f[j_coord_offset+DIM*2+YY] -= ty;
403 f[j_coord_offset+DIM*2+ZZ] -= tz;
405 /**************************
406 * CALCULATE INTERACTIONS *
407 **************************/
409 /* COULOMB ELECTROSTATICS */
411 felec = velec*rinvsq20;
413 /* Update potential sums from outer loop */
418 /* Calculate temporary vectorial force */
423 /* Update vectorial force */
427 f[j_coord_offset+DIM*0+XX] -= tx;
428 f[j_coord_offset+DIM*0+YY] -= ty;
429 f[j_coord_offset+DIM*0+ZZ] -= tz;
431 /**************************
432 * CALCULATE INTERACTIONS *
433 **************************/
435 /* COULOMB ELECTROSTATICS */
437 felec = velec*rinvsq21;
439 /* Update potential sums from outer loop */
444 /* Calculate temporary vectorial force */
449 /* Update vectorial force */
453 f[j_coord_offset+DIM*1+XX] -= tx;
454 f[j_coord_offset+DIM*1+YY] -= ty;
455 f[j_coord_offset+DIM*1+ZZ] -= tz;
457 /**************************
458 * CALCULATE INTERACTIONS *
459 **************************/
461 /* COULOMB ELECTROSTATICS */
463 felec = velec*rinvsq22;
465 /* Update potential sums from outer loop */
470 /* Calculate temporary vectorial force */
475 /* Update vectorial force */
479 f[j_coord_offset+DIM*2+XX] -= tx;
480 f[j_coord_offset+DIM*2+YY] -= ty;
481 f[j_coord_offset+DIM*2+ZZ] -= tz;
483 /* Inner loop uses 243 flops */
485 /* End of innermost loop */
488 f[i_coord_offset+DIM*0+XX] += fix0;
489 f[i_coord_offset+DIM*0+YY] += fiy0;
490 f[i_coord_offset+DIM*0+ZZ] += fiz0;
494 f[i_coord_offset+DIM*1+XX] += fix1;
495 f[i_coord_offset+DIM*1+YY] += fiy1;
496 f[i_coord_offset+DIM*1+ZZ] += fiz1;
500 f[i_coord_offset+DIM*2+XX] += fix2;
501 f[i_coord_offset+DIM*2+YY] += fiy2;
502 f[i_coord_offset+DIM*2+ZZ] += fiz2;
506 fshift[i_shift_offset+XX] += tx;
507 fshift[i_shift_offset+YY] += ty;
508 fshift[i_shift_offset+ZZ] += tz;
511 /* Update potential energies */
512 kernel_data->energygrp_elec[ggid] += velecsum;
514 /* Increment number of inner iterations */
515 inneriter += j_index_end - j_index_start;
517 /* Outer loop uses 31 flops */
520 /* Increment number of outer iterations */
523 /* Update outer/inner flops */
525 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_W3W3_VF,outeriter*31 + inneriter*243);
528 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_c
529 * Electrostatics interaction: Coulomb
530 * VdW interaction: None
531 * Geometry: Water3-Water3
532 * Calculate force/pot: Force
535 nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_c
536 (t_nblist * gmx_restrict nlist,
537 rvec * gmx_restrict xx,
538 rvec * gmx_restrict ff,
539 t_forcerec * gmx_restrict fr,
540 t_mdatoms * gmx_restrict mdatoms,
541 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
542 t_nrnb * gmx_restrict nrnb)
544 int i_shift_offset,i_coord_offset,j_coord_offset;
545 int j_index_start,j_index_end;
546 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
547 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
548 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
549 real *shiftvec,*fshift,*x,*f;
551 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
553 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
555 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
557 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
559 real jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
561 real jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
562 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
563 real dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01,cexp1_01,cexp2_01;
564 real dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02,cexp1_02,cexp2_02;
565 real dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
566 real dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
567 real dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
568 real dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
569 real dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
570 real dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
571 real velec,felec,velecsum,facel,crf,krf,krf2;
579 jindex = nlist->jindex;
581 shiftidx = nlist->shift;
583 shiftvec = fr->shift_vec[0];
584 fshift = fr->fshift[0];
586 charge = mdatoms->chargeA;
588 /* Setup water-specific parameters */
589 inr = nlist->iinr[0];
590 iq0 = facel*charge[inr+0];
591 iq1 = facel*charge[inr+1];
592 iq2 = facel*charge[inr+2];
610 /* Start outer loop over neighborlists */
611 for(iidx=0; iidx<nri; iidx++)
613 /* Load shift vector for this list */
614 i_shift_offset = DIM*shiftidx[iidx];
615 shX = shiftvec[i_shift_offset+XX];
616 shY = shiftvec[i_shift_offset+YY];
617 shZ = shiftvec[i_shift_offset+ZZ];
619 /* Load limits for loop over neighbors */
620 j_index_start = jindex[iidx];
621 j_index_end = jindex[iidx+1];
623 /* Get outer coordinate index */
625 i_coord_offset = DIM*inr;
627 /* Load i particle coords and add shift vector */
628 ix0 = shX + x[i_coord_offset+DIM*0+XX];
629 iy0 = shY + x[i_coord_offset+DIM*0+YY];
630 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
631 ix1 = shX + x[i_coord_offset+DIM*1+XX];
632 iy1 = shY + x[i_coord_offset+DIM*1+YY];
633 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
634 ix2 = shX + x[i_coord_offset+DIM*2+XX];
635 iy2 = shY + x[i_coord_offset+DIM*2+YY];
636 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
648 /* Start inner kernel loop */
649 for(jidx=j_index_start; jidx<j_index_end; jidx++)
651 /* Get j neighbor index, and coordinate index */
653 j_coord_offset = DIM*jnr;
655 /* load j atom coordinates */
656 jx0 = x[j_coord_offset+DIM*0+XX];
657 jy0 = x[j_coord_offset+DIM*0+YY];
658 jz0 = x[j_coord_offset+DIM*0+ZZ];
659 jx1 = x[j_coord_offset+DIM*1+XX];
660 jy1 = x[j_coord_offset+DIM*1+YY];
661 jz1 = x[j_coord_offset+DIM*1+ZZ];
662 jx2 = x[j_coord_offset+DIM*2+XX];
663 jy2 = x[j_coord_offset+DIM*2+YY];
664 jz2 = x[j_coord_offset+DIM*2+ZZ];
666 /* Calculate displacement vector */
695 /* Calculate squared distance and things based on it */
696 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
697 rsq01 = dx01*dx01+dy01*dy01+dz01*dz01;
698 rsq02 = dx02*dx02+dy02*dy02+dz02*dz02;
699 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
700 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
701 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
702 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
703 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
704 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
706 rinv00 = gmx_invsqrt(rsq00);
707 rinv01 = gmx_invsqrt(rsq01);
708 rinv02 = gmx_invsqrt(rsq02);
709 rinv10 = gmx_invsqrt(rsq10);
710 rinv11 = gmx_invsqrt(rsq11);
711 rinv12 = gmx_invsqrt(rsq12);
712 rinv20 = gmx_invsqrt(rsq20);
713 rinv21 = gmx_invsqrt(rsq21);
714 rinv22 = gmx_invsqrt(rsq22);
716 rinvsq00 = rinv00*rinv00;
717 rinvsq01 = rinv01*rinv01;
718 rinvsq02 = rinv02*rinv02;
719 rinvsq10 = rinv10*rinv10;
720 rinvsq11 = rinv11*rinv11;
721 rinvsq12 = rinv12*rinv12;
722 rinvsq20 = rinv20*rinv20;
723 rinvsq21 = rinv21*rinv21;
724 rinvsq22 = rinv22*rinv22;
726 /**************************
727 * CALCULATE INTERACTIONS *
728 **************************/
730 /* COULOMB ELECTROSTATICS */
732 felec = velec*rinvsq00;
736 /* Calculate temporary vectorial force */
741 /* Update vectorial force */
745 f[j_coord_offset+DIM*0+XX] -= tx;
746 f[j_coord_offset+DIM*0+YY] -= ty;
747 f[j_coord_offset+DIM*0+ZZ] -= tz;
749 /**************************
750 * CALCULATE INTERACTIONS *
751 **************************/
753 /* COULOMB ELECTROSTATICS */
755 felec = velec*rinvsq01;
759 /* Calculate temporary vectorial force */
764 /* Update vectorial force */
768 f[j_coord_offset+DIM*1+XX] -= tx;
769 f[j_coord_offset+DIM*1+YY] -= ty;
770 f[j_coord_offset+DIM*1+ZZ] -= tz;
772 /**************************
773 * CALCULATE INTERACTIONS *
774 **************************/
776 /* COULOMB ELECTROSTATICS */
778 felec = velec*rinvsq02;
782 /* Calculate temporary vectorial force */
787 /* Update vectorial force */
791 f[j_coord_offset+DIM*2+XX] -= tx;
792 f[j_coord_offset+DIM*2+YY] -= ty;
793 f[j_coord_offset+DIM*2+ZZ] -= tz;
795 /**************************
796 * CALCULATE INTERACTIONS *
797 **************************/
799 /* COULOMB ELECTROSTATICS */
801 felec = velec*rinvsq10;
805 /* Calculate temporary vectorial force */
810 /* Update vectorial force */
814 f[j_coord_offset+DIM*0+XX] -= tx;
815 f[j_coord_offset+DIM*0+YY] -= ty;
816 f[j_coord_offset+DIM*0+ZZ] -= tz;
818 /**************************
819 * CALCULATE INTERACTIONS *
820 **************************/
822 /* COULOMB ELECTROSTATICS */
824 felec = velec*rinvsq11;
828 /* Calculate temporary vectorial force */
833 /* Update vectorial force */
837 f[j_coord_offset+DIM*1+XX] -= tx;
838 f[j_coord_offset+DIM*1+YY] -= ty;
839 f[j_coord_offset+DIM*1+ZZ] -= tz;
841 /**************************
842 * CALCULATE INTERACTIONS *
843 **************************/
845 /* COULOMB ELECTROSTATICS */
847 felec = velec*rinvsq12;
851 /* Calculate temporary vectorial force */
856 /* Update vectorial force */
860 f[j_coord_offset+DIM*2+XX] -= tx;
861 f[j_coord_offset+DIM*2+YY] -= ty;
862 f[j_coord_offset+DIM*2+ZZ] -= tz;
864 /**************************
865 * CALCULATE INTERACTIONS *
866 **************************/
868 /* COULOMB ELECTROSTATICS */
870 felec = velec*rinvsq20;
874 /* Calculate temporary vectorial force */
879 /* Update vectorial force */
883 f[j_coord_offset+DIM*0+XX] -= tx;
884 f[j_coord_offset+DIM*0+YY] -= ty;
885 f[j_coord_offset+DIM*0+ZZ] -= tz;
887 /**************************
888 * CALCULATE INTERACTIONS *
889 **************************/
891 /* COULOMB ELECTROSTATICS */
893 felec = velec*rinvsq21;
897 /* Calculate temporary vectorial force */
902 /* Update vectorial force */
906 f[j_coord_offset+DIM*1+XX] -= tx;
907 f[j_coord_offset+DIM*1+YY] -= ty;
908 f[j_coord_offset+DIM*1+ZZ] -= tz;
910 /**************************
911 * CALCULATE INTERACTIONS *
912 **************************/
914 /* COULOMB ELECTROSTATICS */
916 felec = velec*rinvsq22;
920 /* Calculate temporary vectorial force */
925 /* Update vectorial force */
929 f[j_coord_offset+DIM*2+XX] -= tx;
930 f[j_coord_offset+DIM*2+YY] -= ty;
931 f[j_coord_offset+DIM*2+ZZ] -= tz;
933 /* Inner loop uses 234 flops */
935 /* End of innermost loop */
938 f[i_coord_offset+DIM*0+XX] += fix0;
939 f[i_coord_offset+DIM*0+YY] += fiy0;
940 f[i_coord_offset+DIM*0+ZZ] += fiz0;
944 f[i_coord_offset+DIM*1+XX] += fix1;
945 f[i_coord_offset+DIM*1+YY] += fiy1;
946 f[i_coord_offset+DIM*1+ZZ] += fiz1;
950 f[i_coord_offset+DIM*2+XX] += fix2;
951 f[i_coord_offset+DIM*2+YY] += fiy2;
952 f[i_coord_offset+DIM*2+ZZ] += fiz2;
956 fshift[i_shift_offset+XX] += tx;
957 fshift[i_shift_offset+YY] += ty;
958 fshift[i_shift_offset+ZZ] += tz;
960 /* Increment number of inner iterations */
961 inneriter += j_index_end - j_index_start;
963 /* Outer loop uses 30 flops */
966 /* Increment number of outer iterations */
969 /* Update outer/inner flops */
971 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_W3W3_F,outeriter*30 + inneriter*234);