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_VdwLJ_GeomW3W3_VF_c
51 * Electrostatics interaction: Coulomb
52 * VdW interaction: LennardJones
53 * Geometry: Water3-Water3
54 * Calculate force/pot: PotentialAndForce
57 nb_kernel_ElecCoul_VdwLJ_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;
96 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
105 jindex = nlist->jindex;
107 shiftidx = nlist->shift;
109 shiftvec = fr->shift_vec[0];
110 fshift = fr->fshift[0];
112 charge = mdatoms->chargeA;
113 nvdwtype = fr->ntype;
115 vdwtype = mdatoms->typeA;
117 /* Setup water-specific parameters */
118 inr = nlist->iinr[0];
119 iq0 = facel*charge[inr+0];
120 iq1 = facel*charge[inr+1];
121 iq2 = facel*charge[inr+2];
122 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
127 vdwjidx0 = 2*vdwtype[inr+0];
129 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
130 c12_00 = vdwparam[vdwioffset0+vdwjidx0+1];
143 /* Start outer loop over neighborlists */
144 for(iidx=0; iidx<nri; iidx++)
146 /* Load shift vector for this list */
147 i_shift_offset = DIM*shiftidx[iidx];
148 shX = shiftvec[i_shift_offset+XX];
149 shY = shiftvec[i_shift_offset+YY];
150 shZ = shiftvec[i_shift_offset+ZZ];
152 /* Load limits for loop over neighbors */
153 j_index_start = jindex[iidx];
154 j_index_end = jindex[iidx+1];
156 /* Get outer coordinate index */
158 i_coord_offset = DIM*inr;
160 /* Load i particle coords and add shift vector */
161 ix0 = shX + x[i_coord_offset+DIM*0+XX];
162 iy0 = shY + x[i_coord_offset+DIM*0+YY];
163 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
164 ix1 = shX + x[i_coord_offset+DIM*1+XX];
165 iy1 = shY + x[i_coord_offset+DIM*1+YY];
166 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
167 ix2 = shX + x[i_coord_offset+DIM*2+XX];
168 iy2 = shY + x[i_coord_offset+DIM*2+YY];
169 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
181 /* Reset potential sums */
185 /* Start inner kernel loop */
186 for(jidx=j_index_start; jidx<j_index_end; jidx++)
188 /* Get j neighbor index, and coordinate index */
190 j_coord_offset = DIM*jnr;
192 /* load j atom coordinates */
193 jx0 = x[j_coord_offset+DIM*0+XX];
194 jy0 = x[j_coord_offset+DIM*0+YY];
195 jz0 = x[j_coord_offset+DIM*0+ZZ];
196 jx1 = x[j_coord_offset+DIM*1+XX];
197 jy1 = x[j_coord_offset+DIM*1+YY];
198 jz1 = x[j_coord_offset+DIM*1+ZZ];
199 jx2 = x[j_coord_offset+DIM*2+XX];
200 jy2 = x[j_coord_offset+DIM*2+YY];
201 jz2 = x[j_coord_offset+DIM*2+ZZ];
203 /* Calculate displacement vector */
232 /* Calculate squared distance and things based on it */
233 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
234 rsq01 = dx01*dx01+dy01*dy01+dz01*dz01;
235 rsq02 = dx02*dx02+dy02*dy02+dz02*dz02;
236 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
237 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
238 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
239 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
240 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
241 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
243 rinv00 = gmx_invsqrt(rsq00);
244 rinv01 = gmx_invsqrt(rsq01);
245 rinv02 = gmx_invsqrt(rsq02);
246 rinv10 = gmx_invsqrt(rsq10);
247 rinv11 = gmx_invsqrt(rsq11);
248 rinv12 = gmx_invsqrt(rsq12);
249 rinv20 = gmx_invsqrt(rsq20);
250 rinv21 = gmx_invsqrt(rsq21);
251 rinv22 = gmx_invsqrt(rsq22);
253 rinvsq00 = rinv00*rinv00;
254 rinvsq01 = rinv01*rinv01;
255 rinvsq02 = rinv02*rinv02;
256 rinvsq10 = rinv10*rinv10;
257 rinvsq11 = rinv11*rinv11;
258 rinvsq12 = rinv12*rinv12;
259 rinvsq20 = rinv20*rinv20;
260 rinvsq21 = rinv21*rinv21;
261 rinvsq22 = rinv22*rinv22;
263 /**************************
264 * CALCULATE INTERACTIONS *
265 **************************/
267 /* COULOMB ELECTROSTATICS */
269 felec = velec*rinvsq00;
271 /* LENNARD-JONES DISPERSION/REPULSION */
273 rinvsix = rinvsq00*rinvsq00*rinvsq00;
274 vvdw6 = c6_00*rinvsix;
275 vvdw12 = c12_00*rinvsix*rinvsix;
276 vvdw = vvdw12*(1.0/12.0) - vvdw6*(1.0/6.0);
277 fvdw = (vvdw12-vvdw6)*rinvsq00;
279 /* Update potential sums from outer loop */
285 /* Calculate temporary vectorial force */
290 /* Update vectorial force */
294 f[j_coord_offset+DIM*0+XX] -= tx;
295 f[j_coord_offset+DIM*0+YY] -= ty;
296 f[j_coord_offset+DIM*0+ZZ] -= tz;
298 /**************************
299 * CALCULATE INTERACTIONS *
300 **************************/
302 /* COULOMB ELECTROSTATICS */
304 felec = velec*rinvsq01;
306 /* Update potential sums from outer loop */
311 /* Calculate temporary vectorial force */
316 /* Update vectorial force */
320 f[j_coord_offset+DIM*1+XX] -= tx;
321 f[j_coord_offset+DIM*1+YY] -= ty;
322 f[j_coord_offset+DIM*1+ZZ] -= tz;
324 /**************************
325 * CALCULATE INTERACTIONS *
326 **************************/
328 /* COULOMB ELECTROSTATICS */
330 felec = velec*rinvsq02;
332 /* Update potential sums from outer loop */
337 /* Calculate temporary vectorial force */
342 /* Update vectorial force */
346 f[j_coord_offset+DIM*2+XX] -= tx;
347 f[j_coord_offset+DIM*2+YY] -= ty;
348 f[j_coord_offset+DIM*2+ZZ] -= tz;
350 /**************************
351 * CALCULATE INTERACTIONS *
352 **************************/
354 /* COULOMB ELECTROSTATICS */
356 felec = velec*rinvsq10;
358 /* Update potential sums from outer loop */
363 /* Calculate temporary vectorial force */
368 /* Update vectorial force */
372 f[j_coord_offset+DIM*0+XX] -= tx;
373 f[j_coord_offset+DIM*0+YY] -= ty;
374 f[j_coord_offset+DIM*0+ZZ] -= tz;
376 /**************************
377 * CALCULATE INTERACTIONS *
378 **************************/
380 /* COULOMB ELECTROSTATICS */
382 felec = velec*rinvsq11;
384 /* Update potential sums from outer loop */
389 /* Calculate temporary vectorial force */
394 /* Update vectorial force */
398 f[j_coord_offset+DIM*1+XX] -= tx;
399 f[j_coord_offset+DIM*1+YY] -= ty;
400 f[j_coord_offset+DIM*1+ZZ] -= tz;
402 /**************************
403 * CALCULATE INTERACTIONS *
404 **************************/
406 /* COULOMB ELECTROSTATICS */
408 felec = velec*rinvsq12;
410 /* Update potential sums from outer loop */
415 /* Calculate temporary vectorial force */
420 /* Update vectorial force */
424 f[j_coord_offset+DIM*2+XX] -= tx;
425 f[j_coord_offset+DIM*2+YY] -= ty;
426 f[j_coord_offset+DIM*2+ZZ] -= tz;
428 /**************************
429 * CALCULATE INTERACTIONS *
430 **************************/
432 /* COULOMB ELECTROSTATICS */
434 felec = velec*rinvsq20;
436 /* Update potential sums from outer loop */
441 /* Calculate temporary vectorial force */
446 /* Update vectorial force */
450 f[j_coord_offset+DIM*0+XX] -= tx;
451 f[j_coord_offset+DIM*0+YY] -= ty;
452 f[j_coord_offset+DIM*0+ZZ] -= tz;
454 /**************************
455 * CALCULATE INTERACTIONS *
456 **************************/
458 /* COULOMB ELECTROSTATICS */
460 felec = velec*rinvsq21;
462 /* Update potential sums from outer loop */
467 /* Calculate temporary vectorial force */
472 /* Update vectorial force */
476 f[j_coord_offset+DIM*1+XX] -= tx;
477 f[j_coord_offset+DIM*1+YY] -= ty;
478 f[j_coord_offset+DIM*1+ZZ] -= tz;
480 /**************************
481 * CALCULATE INTERACTIONS *
482 **************************/
484 /* COULOMB ELECTROSTATICS */
486 felec = velec*rinvsq22;
488 /* Update potential sums from outer loop */
493 /* Calculate temporary vectorial force */
498 /* Update vectorial force */
502 f[j_coord_offset+DIM*2+XX] -= tx;
503 f[j_coord_offset+DIM*2+YY] -= ty;
504 f[j_coord_offset+DIM*2+ZZ] -= tz;
506 /* Inner loop uses 255 flops */
508 /* End of innermost loop */
511 f[i_coord_offset+DIM*0+XX] += fix0;
512 f[i_coord_offset+DIM*0+YY] += fiy0;
513 f[i_coord_offset+DIM*0+ZZ] += fiz0;
517 f[i_coord_offset+DIM*1+XX] += fix1;
518 f[i_coord_offset+DIM*1+YY] += fiy1;
519 f[i_coord_offset+DIM*1+ZZ] += fiz1;
523 f[i_coord_offset+DIM*2+XX] += fix2;
524 f[i_coord_offset+DIM*2+YY] += fiy2;
525 f[i_coord_offset+DIM*2+ZZ] += fiz2;
529 fshift[i_shift_offset+XX] += tx;
530 fshift[i_shift_offset+YY] += ty;
531 fshift[i_shift_offset+ZZ] += tz;
534 /* Update potential energies */
535 kernel_data->energygrp_elec[ggid] += velecsum;
536 kernel_data->energygrp_vdw[ggid] += vvdwsum;
538 /* Increment number of inner iterations */
539 inneriter += j_index_end - j_index_start;
541 /* Outer loop uses 32 flops */
544 /* Increment number of outer iterations */
547 /* Update outer/inner flops */
549 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_VF,outeriter*32 + inneriter*255);
552 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_c
553 * Electrostatics interaction: Coulomb
554 * VdW interaction: LennardJones
555 * Geometry: Water3-Water3
556 * Calculate force/pot: Force
559 nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_c
560 (t_nblist * gmx_restrict nlist,
561 rvec * gmx_restrict xx,
562 rvec * gmx_restrict ff,
563 t_forcerec * gmx_restrict fr,
564 t_mdatoms * gmx_restrict mdatoms,
565 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
566 t_nrnb * gmx_restrict nrnb)
568 int i_shift_offset,i_coord_offset,j_coord_offset;
569 int j_index_start,j_index_end;
570 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
571 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
572 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
573 real *shiftvec,*fshift,*x,*f;
575 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
577 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
579 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
581 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
583 real jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
585 real jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
586 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
587 real dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01,cexp1_01,cexp2_01;
588 real dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02,cexp1_02,cexp2_02;
589 real dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
590 real dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
591 real dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
592 real dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
593 real dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
594 real dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
595 real velec,felec,velecsum,facel,crf,krf,krf2;
598 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
607 jindex = nlist->jindex;
609 shiftidx = nlist->shift;
611 shiftvec = fr->shift_vec[0];
612 fshift = fr->fshift[0];
614 charge = mdatoms->chargeA;
615 nvdwtype = fr->ntype;
617 vdwtype = mdatoms->typeA;
619 /* Setup water-specific parameters */
620 inr = nlist->iinr[0];
621 iq0 = facel*charge[inr+0];
622 iq1 = facel*charge[inr+1];
623 iq2 = facel*charge[inr+2];
624 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
629 vdwjidx0 = 2*vdwtype[inr+0];
631 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
632 c12_00 = vdwparam[vdwioffset0+vdwjidx0+1];
645 /* Start outer loop over neighborlists */
646 for(iidx=0; iidx<nri; iidx++)
648 /* Load shift vector for this list */
649 i_shift_offset = DIM*shiftidx[iidx];
650 shX = shiftvec[i_shift_offset+XX];
651 shY = shiftvec[i_shift_offset+YY];
652 shZ = shiftvec[i_shift_offset+ZZ];
654 /* Load limits for loop over neighbors */
655 j_index_start = jindex[iidx];
656 j_index_end = jindex[iidx+1];
658 /* Get outer coordinate index */
660 i_coord_offset = DIM*inr;
662 /* Load i particle coords and add shift vector */
663 ix0 = shX + x[i_coord_offset+DIM*0+XX];
664 iy0 = shY + x[i_coord_offset+DIM*0+YY];
665 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
666 ix1 = shX + x[i_coord_offset+DIM*1+XX];
667 iy1 = shY + x[i_coord_offset+DIM*1+YY];
668 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
669 ix2 = shX + x[i_coord_offset+DIM*2+XX];
670 iy2 = shY + x[i_coord_offset+DIM*2+YY];
671 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
683 /* Start inner kernel loop */
684 for(jidx=j_index_start; jidx<j_index_end; jidx++)
686 /* Get j neighbor index, and coordinate index */
688 j_coord_offset = DIM*jnr;
690 /* load j atom coordinates */
691 jx0 = x[j_coord_offset+DIM*0+XX];
692 jy0 = x[j_coord_offset+DIM*0+YY];
693 jz0 = x[j_coord_offset+DIM*0+ZZ];
694 jx1 = x[j_coord_offset+DIM*1+XX];
695 jy1 = x[j_coord_offset+DIM*1+YY];
696 jz1 = x[j_coord_offset+DIM*1+ZZ];
697 jx2 = x[j_coord_offset+DIM*2+XX];
698 jy2 = x[j_coord_offset+DIM*2+YY];
699 jz2 = x[j_coord_offset+DIM*2+ZZ];
701 /* Calculate displacement vector */
730 /* Calculate squared distance and things based on it */
731 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
732 rsq01 = dx01*dx01+dy01*dy01+dz01*dz01;
733 rsq02 = dx02*dx02+dy02*dy02+dz02*dz02;
734 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
735 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
736 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
737 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
738 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
739 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
741 rinv00 = gmx_invsqrt(rsq00);
742 rinv01 = gmx_invsqrt(rsq01);
743 rinv02 = gmx_invsqrt(rsq02);
744 rinv10 = gmx_invsqrt(rsq10);
745 rinv11 = gmx_invsqrt(rsq11);
746 rinv12 = gmx_invsqrt(rsq12);
747 rinv20 = gmx_invsqrt(rsq20);
748 rinv21 = gmx_invsqrt(rsq21);
749 rinv22 = gmx_invsqrt(rsq22);
751 rinvsq00 = rinv00*rinv00;
752 rinvsq01 = rinv01*rinv01;
753 rinvsq02 = rinv02*rinv02;
754 rinvsq10 = rinv10*rinv10;
755 rinvsq11 = rinv11*rinv11;
756 rinvsq12 = rinv12*rinv12;
757 rinvsq20 = rinv20*rinv20;
758 rinvsq21 = rinv21*rinv21;
759 rinvsq22 = rinv22*rinv22;
761 /**************************
762 * CALCULATE INTERACTIONS *
763 **************************/
765 /* COULOMB ELECTROSTATICS */
767 felec = velec*rinvsq00;
769 /* LENNARD-JONES DISPERSION/REPULSION */
771 rinvsix = rinvsq00*rinvsq00*rinvsq00;
772 fvdw = (c12_00*rinvsix-c6_00)*rinvsix*rinvsq00;
776 /* Calculate temporary vectorial force */
781 /* Update vectorial force */
785 f[j_coord_offset+DIM*0+XX] -= tx;
786 f[j_coord_offset+DIM*0+YY] -= ty;
787 f[j_coord_offset+DIM*0+ZZ] -= tz;
789 /**************************
790 * CALCULATE INTERACTIONS *
791 **************************/
793 /* COULOMB ELECTROSTATICS */
795 felec = velec*rinvsq01;
799 /* Calculate temporary vectorial force */
804 /* Update vectorial force */
808 f[j_coord_offset+DIM*1+XX] -= tx;
809 f[j_coord_offset+DIM*1+YY] -= ty;
810 f[j_coord_offset+DIM*1+ZZ] -= tz;
812 /**************************
813 * CALCULATE INTERACTIONS *
814 **************************/
816 /* COULOMB ELECTROSTATICS */
818 felec = velec*rinvsq02;
822 /* Calculate temporary vectorial force */
827 /* Update vectorial force */
831 f[j_coord_offset+DIM*2+XX] -= tx;
832 f[j_coord_offset+DIM*2+YY] -= ty;
833 f[j_coord_offset+DIM*2+ZZ] -= tz;
835 /**************************
836 * CALCULATE INTERACTIONS *
837 **************************/
839 /* COULOMB ELECTROSTATICS */
841 felec = velec*rinvsq10;
845 /* Calculate temporary vectorial force */
850 /* Update vectorial force */
854 f[j_coord_offset+DIM*0+XX] -= tx;
855 f[j_coord_offset+DIM*0+YY] -= ty;
856 f[j_coord_offset+DIM*0+ZZ] -= tz;
858 /**************************
859 * CALCULATE INTERACTIONS *
860 **************************/
862 /* COULOMB ELECTROSTATICS */
864 felec = velec*rinvsq11;
868 /* Calculate temporary vectorial force */
873 /* Update vectorial force */
877 f[j_coord_offset+DIM*1+XX] -= tx;
878 f[j_coord_offset+DIM*1+YY] -= ty;
879 f[j_coord_offset+DIM*1+ZZ] -= tz;
881 /**************************
882 * CALCULATE INTERACTIONS *
883 **************************/
885 /* COULOMB ELECTROSTATICS */
887 felec = velec*rinvsq12;
891 /* Calculate temporary vectorial force */
896 /* Update vectorial force */
900 f[j_coord_offset+DIM*2+XX] -= tx;
901 f[j_coord_offset+DIM*2+YY] -= ty;
902 f[j_coord_offset+DIM*2+ZZ] -= tz;
904 /**************************
905 * CALCULATE INTERACTIONS *
906 **************************/
908 /* COULOMB ELECTROSTATICS */
910 felec = velec*rinvsq20;
914 /* Calculate temporary vectorial force */
919 /* Update vectorial force */
923 f[j_coord_offset+DIM*0+XX] -= tx;
924 f[j_coord_offset+DIM*0+YY] -= ty;
925 f[j_coord_offset+DIM*0+ZZ] -= tz;
927 /**************************
928 * CALCULATE INTERACTIONS *
929 **************************/
931 /* COULOMB ELECTROSTATICS */
933 felec = velec*rinvsq21;
937 /* Calculate temporary vectorial force */
942 /* Update vectorial force */
946 f[j_coord_offset+DIM*1+XX] -= tx;
947 f[j_coord_offset+DIM*1+YY] -= ty;
948 f[j_coord_offset+DIM*1+ZZ] -= tz;
950 /**************************
951 * CALCULATE INTERACTIONS *
952 **************************/
954 /* COULOMB ELECTROSTATICS */
956 felec = velec*rinvsq22;
960 /* Calculate temporary vectorial force */
965 /* Update vectorial force */
969 f[j_coord_offset+DIM*2+XX] -= tx;
970 f[j_coord_offset+DIM*2+YY] -= ty;
971 f[j_coord_offset+DIM*2+ZZ] -= tz;
973 /* Inner loop uses 241 flops */
975 /* End of innermost loop */
978 f[i_coord_offset+DIM*0+XX] += fix0;
979 f[i_coord_offset+DIM*0+YY] += fiy0;
980 f[i_coord_offset+DIM*0+ZZ] += fiz0;
984 f[i_coord_offset+DIM*1+XX] += fix1;
985 f[i_coord_offset+DIM*1+YY] += fiy1;
986 f[i_coord_offset+DIM*1+ZZ] += fiz1;
990 f[i_coord_offset+DIM*2+XX] += fix2;
991 f[i_coord_offset+DIM*2+YY] += fiy2;
992 f[i_coord_offset+DIM*2+ZZ] += fiz2;
996 fshift[i_shift_offset+XX] += tx;
997 fshift[i_shift_offset+YY] += ty;
998 fshift[i_shift_offset+ZZ] += tz;
1000 /* Increment number of inner iterations */
1001 inneriter += j_index_end - j_index_start;
1003 /* Outer loop uses 30 flops */
1006 /* Increment number of outer iterations */
1009 /* Update outer/inner flops */
1011 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_F,outeriter*30 + inneriter*241);