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 "gromacs/legacyheaders/types/simple.h"
44 #include "gromacs/math/vec.h"
45 #include "gromacs/legacyheaders/nrnb.h"
48 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_c
49 * Electrostatics interaction: Coulomb
50 * VdW interaction: LennardJones
51 * Geometry: Water3-Water3
52 * Calculate force/pot: PotentialAndForce
55 nb_kernel_ElecCoul_VdwLJ_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;
94 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
103 jindex = nlist->jindex;
105 shiftidx = nlist->shift;
107 shiftvec = fr->shift_vec[0];
108 fshift = fr->fshift[0];
110 charge = mdatoms->chargeA;
111 nvdwtype = fr->ntype;
113 vdwtype = mdatoms->typeA;
115 /* Setup water-specific parameters */
116 inr = nlist->iinr[0];
117 iq0 = facel*charge[inr+0];
118 iq1 = facel*charge[inr+1];
119 iq2 = facel*charge[inr+2];
120 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
125 vdwjidx0 = 2*vdwtype[inr+0];
127 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
128 c12_00 = vdwparam[vdwioffset0+vdwjidx0+1];
141 /* Start outer loop over neighborlists */
142 for(iidx=0; iidx<nri; iidx++)
144 /* Load shift vector for this list */
145 i_shift_offset = DIM*shiftidx[iidx];
146 shX = shiftvec[i_shift_offset+XX];
147 shY = shiftvec[i_shift_offset+YY];
148 shZ = shiftvec[i_shift_offset+ZZ];
150 /* Load limits for loop over neighbors */
151 j_index_start = jindex[iidx];
152 j_index_end = jindex[iidx+1];
154 /* Get outer coordinate index */
156 i_coord_offset = DIM*inr;
158 /* Load i particle coords and add shift vector */
159 ix0 = shX + x[i_coord_offset+DIM*0+XX];
160 iy0 = shY + x[i_coord_offset+DIM*0+YY];
161 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
162 ix1 = shX + x[i_coord_offset+DIM*1+XX];
163 iy1 = shY + x[i_coord_offset+DIM*1+YY];
164 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
165 ix2 = shX + x[i_coord_offset+DIM*2+XX];
166 iy2 = shY + x[i_coord_offset+DIM*2+YY];
167 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
179 /* Reset potential sums */
183 /* Start inner kernel loop */
184 for(jidx=j_index_start; jidx<j_index_end; jidx++)
186 /* Get j neighbor index, and coordinate index */
188 j_coord_offset = DIM*jnr;
190 /* load j atom coordinates */
191 jx0 = x[j_coord_offset+DIM*0+XX];
192 jy0 = x[j_coord_offset+DIM*0+YY];
193 jz0 = x[j_coord_offset+DIM*0+ZZ];
194 jx1 = x[j_coord_offset+DIM*1+XX];
195 jy1 = x[j_coord_offset+DIM*1+YY];
196 jz1 = x[j_coord_offset+DIM*1+ZZ];
197 jx2 = x[j_coord_offset+DIM*2+XX];
198 jy2 = x[j_coord_offset+DIM*2+YY];
199 jz2 = x[j_coord_offset+DIM*2+ZZ];
201 /* Calculate displacement vector */
230 /* Calculate squared distance and things based on it */
231 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
232 rsq01 = dx01*dx01+dy01*dy01+dz01*dz01;
233 rsq02 = dx02*dx02+dy02*dy02+dz02*dz02;
234 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
235 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
236 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
237 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
238 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
239 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
241 rinv00 = gmx_invsqrt(rsq00);
242 rinv01 = gmx_invsqrt(rsq01);
243 rinv02 = gmx_invsqrt(rsq02);
244 rinv10 = gmx_invsqrt(rsq10);
245 rinv11 = gmx_invsqrt(rsq11);
246 rinv12 = gmx_invsqrt(rsq12);
247 rinv20 = gmx_invsqrt(rsq20);
248 rinv21 = gmx_invsqrt(rsq21);
249 rinv22 = gmx_invsqrt(rsq22);
251 rinvsq00 = rinv00*rinv00;
252 rinvsq01 = rinv01*rinv01;
253 rinvsq02 = rinv02*rinv02;
254 rinvsq10 = rinv10*rinv10;
255 rinvsq11 = rinv11*rinv11;
256 rinvsq12 = rinv12*rinv12;
257 rinvsq20 = rinv20*rinv20;
258 rinvsq21 = rinv21*rinv21;
259 rinvsq22 = rinv22*rinv22;
261 /**************************
262 * CALCULATE INTERACTIONS *
263 **************************/
265 /* COULOMB ELECTROSTATICS */
267 felec = velec*rinvsq00;
269 /* LENNARD-JONES DISPERSION/REPULSION */
271 rinvsix = rinvsq00*rinvsq00*rinvsq00;
272 vvdw6 = c6_00*rinvsix;
273 vvdw12 = c12_00*rinvsix*rinvsix;
274 vvdw = vvdw12*(1.0/12.0) - vvdw6*(1.0/6.0);
275 fvdw = (vvdw12-vvdw6)*rinvsq00;
277 /* Update potential sums from outer loop */
283 /* Calculate temporary vectorial force */
288 /* Update vectorial force */
292 f[j_coord_offset+DIM*0+XX] -= tx;
293 f[j_coord_offset+DIM*0+YY] -= ty;
294 f[j_coord_offset+DIM*0+ZZ] -= tz;
296 /**************************
297 * CALCULATE INTERACTIONS *
298 **************************/
300 /* COULOMB ELECTROSTATICS */
302 felec = velec*rinvsq01;
304 /* Update potential sums from outer loop */
309 /* Calculate temporary vectorial force */
314 /* Update vectorial force */
318 f[j_coord_offset+DIM*1+XX] -= tx;
319 f[j_coord_offset+DIM*1+YY] -= ty;
320 f[j_coord_offset+DIM*1+ZZ] -= tz;
322 /**************************
323 * CALCULATE INTERACTIONS *
324 **************************/
326 /* COULOMB ELECTROSTATICS */
328 felec = velec*rinvsq02;
330 /* Update potential sums from outer loop */
335 /* Calculate temporary vectorial force */
340 /* Update vectorial force */
344 f[j_coord_offset+DIM*2+XX] -= tx;
345 f[j_coord_offset+DIM*2+YY] -= ty;
346 f[j_coord_offset+DIM*2+ZZ] -= tz;
348 /**************************
349 * CALCULATE INTERACTIONS *
350 **************************/
352 /* COULOMB ELECTROSTATICS */
354 felec = velec*rinvsq10;
356 /* Update potential sums from outer loop */
361 /* Calculate temporary vectorial force */
366 /* Update vectorial force */
370 f[j_coord_offset+DIM*0+XX] -= tx;
371 f[j_coord_offset+DIM*0+YY] -= ty;
372 f[j_coord_offset+DIM*0+ZZ] -= tz;
374 /**************************
375 * CALCULATE INTERACTIONS *
376 **************************/
378 /* COULOMB ELECTROSTATICS */
380 felec = velec*rinvsq11;
382 /* Update potential sums from outer loop */
387 /* Calculate temporary vectorial force */
392 /* Update vectorial force */
396 f[j_coord_offset+DIM*1+XX] -= tx;
397 f[j_coord_offset+DIM*1+YY] -= ty;
398 f[j_coord_offset+DIM*1+ZZ] -= tz;
400 /**************************
401 * CALCULATE INTERACTIONS *
402 **************************/
404 /* COULOMB ELECTROSTATICS */
406 felec = velec*rinvsq12;
408 /* Update potential sums from outer loop */
413 /* Calculate temporary vectorial force */
418 /* Update vectorial force */
422 f[j_coord_offset+DIM*2+XX] -= tx;
423 f[j_coord_offset+DIM*2+YY] -= ty;
424 f[j_coord_offset+DIM*2+ZZ] -= tz;
426 /**************************
427 * CALCULATE INTERACTIONS *
428 **************************/
430 /* COULOMB ELECTROSTATICS */
432 felec = velec*rinvsq20;
434 /* Update potential sums from outer loop */
439 /* Calculate temporary vectorial force */
444 /* Update vectorial force */
448 f[j_coord_offset+DIM*0+XX] -= tx;
449 f[j_coord_offset+DIM*0+YY] -= ty;
450 f[j_coord_offset+DIM*0+ZZ] -= tz;
452 /**************************
453 * CALCULATE INTERACTIONS *
454 **************************/
456 /* COULOMB ELECTROSTATICS */
458 felec = velec*rinvsq21;
460 /* Update potential sums from outer loop */
465 /* Calculate temporary vectorial force */
470 /* Update vectorial force */
474 f[j_coord_offset+DIM*1+XX] -= tx;
475 f[j_coord_offset+DIM*1+YY] -= ty;
476 f[j_coord_offset+DIM*1+ZZ] -= tz;
478 /**************************
479 * CALCULATE INTERACTIONS *
480 **************************/
482 /* COULOMB ELECTROSTATICS */
484 felec = velec*rinvsq22;
486 /* Update potential sums from outer loop */
491 /* Calculate temporary vectorial force */
496 /* Update vectorial force */
500 f[j_coord_offset+DIM*2+XX] -= tx;
501 f[j_coord_offset+DIM*2+YY] -= ty;
502 f[j_coord_offset+DIM*2+ZZ] -= tz;
504 /* Inner loop uses 255 flops */
506 /* End of innermost loop */
509 f[i_coord_offset+DIM*0+XX] += fix0;
510 f[i_coord_offset+DIM*0+YY] += fiy0;
511 f[i_coord_offset+DIM*0+ZZ] += fiz0;
515 f[i_coord_offset+DIM*1+XX] += fix1;
516 f[i_coord_offset+DIM*1+YY] += fiy1;
517 f[i_coord_offset+DIM*1+ZZ] += fiz1;
521 f[i_coord_offset+DIM*2+XX] += fix2;
522 f[i_coord_offset+DIM*2+YY] += fiy2;
523 f[i_coord_offset+DIM*2+ZZ] += fiz2;
527 fshift[i_shift_offset+XX] += tx;
528 fshift[i_shift_offset+YY] += ty;
529 fshift[i_shift_offset+ZZ] += tz;
532 /* Update potential energies */
533 kernel_data->energygrp_elec[ggid] += velecsum;
534 kernel_data->energygrp_vdw[ggid] += vvdwsum;
536 /* Increment number of inner iterations */
537 inneriter += j_index_end - j_index_start;
539 /* Outer loop uses 32 flops */
542 /* Increment number of outer iterations */
545 /* Update outer/inner flops */
547 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_VF,outeriter*32 + inneriter*255);
550 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_c
551 * Electrostatics interaction: Coulomb
552 * VdW interaction: LennardJones
553 * Geometry: Water3-Water3
554 * Calculate force/pot: Force
557 nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_c
558 (t_nblist * gmx_restrict nlist,
559 rvec * gmx_restrict xx,
560 rvec * gmx_restrict ff,
561 t_forcerec * gmx_restrict fr,
562 t_mdatoms * gmx_restrict mdatoms,
563 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
564 t_nrnb * gmx_restrict nrnb)
566 int i_shift_offset,i_coord_offset,j_coord_offset;
567 int j_index_start,j_index_end;
568 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
569 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
570 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
571 real *shiftvec,*fshift,*x,*f;
573 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
575 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
577 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
579 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
581 real jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
583 real jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
584 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
585 real dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01,cexp1_01,cexp2_01;
586 real dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02,cexp1_02,cexp2_02;
587 real dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
588 real dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
589 real dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
590 real dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
591 real dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
592 real dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
593 real velec,felec,velecsum,facel,crf,krf,krf2;
596 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
605 jindex = nlist->jindex;
607 shiftidx = nlist->shift;
609 shiftvec = fr->shift_vec[0];
610 fshift = fr->fshift[0];
612 charge = mdatoms->chargeA;
613 nvdwtype = fr->ntype;
615 vdwtype = mdatoms->typeA;
617 /* Setup water-specific parameters */
618 inr = nlist->iinr[0];
619 iq0 = facel*charge[inr+0];
620 iq1 = facel*charge[inr+1];
621 iq2 = facel*charge[inr+2];
622 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
627 vdwjidx0 = 2*vdwtype[inr+0];
629 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
630 c12_00 = vdwparam[vdwioffset0+vdwjidx0+1];
643 /* Start outer loop over neighborlists */
644 for(iidx=0; iidx<nri; iidx++)
646 /* Load shift vector for this list */
647 i_shift_offset = DIM*shiftidx[iidx];
648 shX = shiftvec[i_shift_offset+XX];
649 shY = shiftvec[i_shift_offset+YY];
650 shZ = shiftvec[i_shift_offset+ZZ];
652 /* Load limits for loop over neighbors */
653 j_index_start = jindex[iidx];
654 j_index_end = jindex[iidx+1];
656 /* Get outer coordinate index */
658 i_coord_offset = DIM*inr;
660 /* Load i particle coords and add shift vector */
661 ix0 = shX + x[i_coord_offset+DIM*0+XX];
662 iy0 = shY + x[i_coord_offset+DIM*0+YY];
663 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
664 ix1 = shX + x[i_coord_offset+DIM*1+XX];
665 iy1 = shY + x[i_coord_offset+DIM*1+YY];
666 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
667 ix2 = shX + x[i_coord_offset+DIM*2+XX];
668 iy2 = shY + x[i_coord_offset+DIM*2+YY];
669 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
681 /* Start inner kernel loop */
682 for(jidx=j_index_start; jidx<j_index_end; jidx++)
684 /* Get j neighbor index, and coordinate index */
686 j_coord_offset = DIM*jnr;
688 /* load j atom coordinates */
689 jx0 = x[j_coord_offset+DIM*0+XX];
690 jy0 = x[j_coord_offset+DIM*0+YY];
691 jz0 = x[j_coord_offset+DIM*0+ZZ];
692 jx1 = x[j_coord_offset+DIM*1+XX];
693 jy1 = x[j_coord_offset+DIM*1+YY];
694 jz1 = x[j_coord_offset+DIM*1+ZZ];
695 jx2 = x[j_coord_offset+DIM*2+XX];
696 jy2 = x[j_coord_offset+DIM*2+YY];
697 jz2 = x[j_coord_offset+DIM*2+ZZ];
699 /* Calculate displacement vector */
728 /* Calculate squared distance and things based on it */
729 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
730 rsq01 = dx01*dx01+dy01*dy01+dz01*dz01;
731 rsq02 = dx02*dx02+dy02*dy02+dz02*dz02;
732 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
733 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
734 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
735 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
736 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
737 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
739 rinv00 = gmx_invsqrt(rsq00);
740 rinv01 = gmx_invsqrt(rsq01);
741 rinv02 = gmx_invsqrt(rsq02);
742 rinv10 = gmx_invsqrt(rsq10);
743 rinv11 = gmx_invsqrt(rsq11);
744 rinv12 = gmx_invsqrt(rsq12);
745 rinv20 = gmx_invsqrt(rsq20);
746 rinv21 = gmx_invsqrt(rsq21);
747 rinv22 = gmx_invsqrt(rsq22);
749 rinvsq00 = rinv00*rinv00;
750 rinvsq01 = rinv01*rinv01;
751 rinvsq02 = rinv02*rinv02;
752 rinvsq10 = rinv10*rinv10;
753 rinvsq11 = rinv11*rinv11;
754 rinvsq12 = rinv12*rinv12;
755 rinvsq20 = rinv20*rinv20;
756 rinvsq21 = rinv21*rinv21;
757 rinvsq22 = rinv22*rinv22;
759 /**************************
760 * CALCULATE INTERACTIONS *
761 **************************/
763 /* COULOMB ELECTROSTATICS */
765 felec = velec*rinvsq00;
767 /* LENNARD-JONES DISPERSION/REPULSION */
769 rinvsix = rinvsq00*rinvsq00*rinvsq00;
770 fvdw = (c12_00*rinvsix-c6_00)*rinvsix*rinvsq00;
774 /* Calculate temporary vectorial force */
779 /* Update vectorial force */
783 f[j_coord_offset+DIM*0+XX] -= tx;
784 f[j_coord_offset+DIM*0+YY] -= ty;
785 f[j_coord_offset+DIM*0+ZZ] -= tz;
787 /**************************
788 * CALCULATE INTERACTIONS *
789 **************************/
791 /* COULOMB ELECTROSTATICS */
793 felec = velec*rinvsq01;
797 /* Calculate temporary vectorial force */
802 /* Update vectorial force */
806 f[j_coord_offset+DIM*1+XX] -= tx;
807 f[j_coord_offset+DIM*1+YY] -= ty;
808 f[j_coord_offset+DIM*1+ZZ] -= tz;
810 /**************************
811 * CALCULATE INTERACTIONS *
812 **************************/
814 /* COULOMB ELECTROSTATICS */
816 felec = velec*rinvsq02;
820 /* Calculate temporary vectorial force */
825 /* Update vectorial force */
829 f[j_coord_offset+DIM*2+XX] -= tx;
830 f[j_coord_offset+DIM*2+YY] -= ty;
831 f[j_coord_offset+DIM*2+ZZ] -= tz;
833 /**************************
834 * CALCULATE INTERACTIONS *
835 **************************/
837 /* COULOMB ELECTROSTATICS */
839 felec = velec*rinvsq10;
843 /* Calculate temporary vectorial force */
848 /* Update vectorial force */
852 f[j_coord_offset+DIM*0+XX] -= tx;
853 f[j_coord_offset+DIM*0+YY] -= ty;
854 f[j_coord_offset+DIM*0+ZZ] -= tz;
856 /**************************
857 * CALCULATE INTERACTIONS *
858 **************************/
860 /* COULOMB ELECTROSTATICS */
862 felec = velec*rinvsq11;
866 /* Calculate temporary vectorial force */
871 /* Update vectorial force */
875 f[j_coord_offset+DIM*1+XX] -= tx;
876 f[j_coord_offset+DIM*1+YY] -= ty;
877 f[j_coord_offset+DIM*1+ZZ] -= tz;
879 /**************************
880 * CALCULATE INTERACTIONS *
881 **************************/
883 /* COULOMB ELECTROSTATICS */
885 felec = velec*rinvsq12;
889 /* Calculate temporary vectorial force */
894 /* Update vectorial force */
898 f[j_coord_offset+DIM*2+XX] -= tx;
899 f[j_coord_offset+DIM*2+YY] -= ty;
900 f[j_coord_offset+DIM*2+ZZ] -= tz;
902 /**************************
903 * CALCULATE INTERACTIONS *
904 **************************/
906 /* COULOMB ELECTROSTATICS */
908 felec = velec*rinvsq20;
912 /* Calculate temporary vectorial force */
917 /* Update vectorial force */
921 f[j_coord_offset+DIM*0+XX] -= tx;
922 f[j_coord_offset+DIM*0+YY] -= ty;
923 f[j_coord_offset+DIM*0+ZZ] -= tz;
925 /**************************
926 * CALCULATE INTERACTIONS *
927 **************************/
929 /* COULOMB ELECTROSTATICS */
931 felec = velec*rinvsq21;
935 /* Calculate temporary vectorial force */
940 /* Update vectorial force */
944 f[j_coord_offset+DIM*1+XX] -= tx;
945 f[j_coord_offset+DIM*1+YY] -= ty;
946 f[j_coord_offset+DIM*1+ZZ] -= tz;
948 /**************************
949 * CALCULATE INTERACTIONS *
950 **************************/
952 /* COULOMB ELECTROSTATICS */
954 felec = velec*rinvsq22;
958 /* Calculate temporary vectorial force */
963 /* Update vectorial force */
967 f[j_coord_offset+DIM*2+XX] -= tx;
968 f[j_coord_offset+DIM*2+YY] -= ty;
969 f[j_coord_offset+DIM*2+ZZ] -= tz;
971 /* Inner loop uses 241 flops */
973 /* End of innermost loop */
976 f[i_coord_offset+DIM*0+XX] += fix0;
977 f[i_coord_offset+DIM*0+YY] += fiy0;
978 f[i_coord_offset+DIM*0+ZZ] += fiz0;
982 f[i_coord_offset+DIM*1+XX] += fix1;
983 f[i_coord_offset+DIM*1+YY] += fiy1;
984 f[i_coord_offset+DIM*1+ZZ] += fiz1;
988 f[i_coord_offset+DIM*2+XX] += fix2;
989 f[i_coord_offset+DIM*2+YY] += fiy2;
990 f[i_coord_offset+DIM*2+ZZ] += fiz2;
994 fshift[i_shift_offset+XX] += tx;
995 fshift[i_shift_offset+YY] += ty;
996 fshift[i_shift_offset+ZZ] += tz;
998 /* Increment number of inner iterations */
999 inneriter += j_index_end - j_index_start;
1001 /* Outer loop uses 30 flops */
1004 /* Increment number of outer iterations */
1007 /* Update outer/inner flops */
1009 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_F,outeriter*30 + inneriter*241);