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 "types/simple.h"
46 #include "gromacs/math/vec.h"
50 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwBham_GeomW3W3_VF_c
51 * Electrostatics interaction: Coulomb
52 * VdW interaction: Buckingham
53 * Geometry: Water3-Water3
54 * Calculate force/pot: PotentialAndForce
57 nb_kernel_ElecCoul_VdwBham_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 = 3*nvdwtype*vdwtype[inr+0];
127 vdwjidx0 = 3*vdwtype[inr+0];
129 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
130 cexp1_00 = vdwparam[vdwioffset0+vdwjidx0+1];
131 cexp2_00 = vdwparam[vdwioffset0+vdwjidx0+2];
144 /* Start outer loop over neighborlists */
145 for(iidx=0; iidx<nri; iidx++)
147 /* Load shift vector for this list */
148 i_shift_offset = DIM*shiftidx[iidx];
149 shX = shiftvec[i_shift_offset+XX];
150 shY = shiftvec[i_shift_offset+YY];
151 shZ = shiftvec[i_shift_offset+ZZ];
153 /* Load limits for loop over neighbors */
154 j_index_start = jindex[iidx];
155 j_index_end = jindex[iidx+1];
157 /* Get outer coordinate index */
159 i_coord_offset = DIM*inr;
161 /* Load i particle coords and add shift vector */
162 ix0 = shX + x[i_coord_offset+DIM*0+XX];
163 iy0 = shY + x[i_coord_offset+DIM*0+YY];
164 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
165 ix1 = shX + x[i_coord_offset+DIM*1+XX];
166 iy1 = shY + x[i_coord_offset+DIM*1+YY];
167 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
168 ix2 = shX + x[i_coord_offset+DIM*2+XX];
169 iy2 = shY + x[i_coord_offset+DIM*2+YY];
170 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
182 /* Reset potential sums */
186 /* Start inner kernel loop */
187 for(jidx=j_index_start; jidx<j_index_end; jidx++)
189 /* Get j neighbor index, and coordinate index */
191 j_coord_offset = DIM*jnr;
193 /* load j atom coordinates */
194 jx0 = x[j_coord_offset+DIM*0+XX];
195 jy0 = x[j_coord_offset+DIM*0+YY];
196 jz0 = x[j_coord_offset+DIM*0+ZZ];
197 jx1 = x[j_coord_offset+DIM*1+XX];
198 jy1 = x[j_coord_offset+DIM*1+YY];
199 jz1 = x[j_coord_offset+DIM*1+ZZ];
200 jx2 = x[j_coord_offset+DIM*2+XX];
201 jy2 = x[j_coord_offset+DIM*2+YY];
202 jz2 = x[j_coord_offset+DIM*2+ZZ];
204 /* Calculate displacement vector */
233 /* Calculate squared distance and things based on it */
234 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
235 rsq01 = dx01*dx01+dy01*dy01+dz01*dz01;
236 rsq02 = dx02*dx02+dy02*dy02+dz02*dz02;
237 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
238 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
239 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
240 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
241 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
242 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
244 rinv00 = gmx_invsqrt(rsq00);
245 rinv01 = gmx_invsqrt(rsq01);
246 rinv02 = gmx_invsqrt(rsq02);
247 rinv10 = gmx_invsqrt(rsq10);
248 rinv11 = gmx_invsqrt(rsq11);
249 rinv12 = gmx_invsqrt(rsq12);
250 rinv20 = gmx_invsqrt(rsq20);
251 rinv21 = gmx_invsqrt(rsq21);
252 rinv22 = gmx_invsqrt(rsq22);
254 rinvsq00 = rinv00*rinv00;
255 rinvsq01 = rinv01*rinv01;
256 rinvsq02 = rinv02*rinv02;
257 rinvsq10 = rinv10*rinv10;
258 rinvsq11 = rinv11*rinv11;
259 rinvsq12 = rinv12*rinv12;
260 rinvsq20 = rinv20*rinv20;
261 rinvsq21 = rinv21*rinv21;
262 rinvsq22 = rinv22*rinv22;
264 /**************************
265 * CALCULATE INTERACTIONS *
266 **************************/
270 /* COULOMB ELECTROSTATICS */
272 felec = velec*rinvsq00;
274 /* BUCKINGHAM DISPERSION/REPULSION */
275 rinvsix = rinvsq00*rinvsq00*rinvsq00;
276 vvdw6 = c6_00*rinvsix;
278 vvdwexp = cexp1_00*exp(-br);
279 vvdw = vvdwexp - vvdw6*(1.0/6.0);
280 fvdw = (br*vvdwexp-vvdw6)*rinvsq00;
282 /* Update potential sums from outer loop */
288 /* Calculate temporary vectorial force */
293 /* Update vectorial force */
297 f[j_coord_offset+DIM*0+XX] -= tx;
298 f[j_coord_offset+DIM*0+YY] -= ty;
299 f[j_coord_offset+DIM*0+ZZ] -= tz;
301 /**************************
302 * CALCULATE INTERACTIONS *
303 **************************/
305 /* COULOMB ELECTROSTATICS */
307 felec = velec*rinvsq01;
309 /* Update potential sums from outer loop */
314 /* Calculate temporary vectorial force */
319 /* Update vectorial force */
323 f[j_coord_offset+DIM*1+XX] -= tx;
324 f[j_coord_offset+DIM*1+YY] -= ty;
325 f[j_coord_offset+DIM*1+ZZ] -= tz;
327 /**************************
328 * CALCULATE INTERACTIONS *
329 **************************/
331 /* COULOMB ELECTROSTATICS */
333 felec = velec*rinvsq02;
335 /* Update potential sums from outer loop */
340 /* Calculate temporary vectorial force */
345 /* Update vectorial force */
349 f[j_coord_offset+DIM*2+XX] -= tx;
350 f[j_coord_offset+DIM*2+YY] -= ty;
351 f[j_coord_offset+DIM*2+ZZ] -= tz;
353 /**************************
354 * CALCULATE INTERACTIONS *
355 **************************/
357 /* COULOMB ELECTROSTATICS */
359 felec = velec*rinvsq10;
361 /* Update potential sums from outer loop */
366 /* Calculate temporary vectorial force */
371 /* Update vectorial force */
375 f[j_coord_offset+DIM*0+XX] -= tx;
376 f[j_coord_offset+DIM*0+YY] -= ty;
377 f[j_coord_offset+DIM*0+ZZ] -= tz;
379 /**************************
380 * CALCULATE INTERACTIONS *
381 **************************/
383 /* COULOMB ELECTROSTATICS */
385 felec = velec*rinvsq11;
387 /* Update potential sums from outer loop */
392 /* Calculate temporary vectorial force */
397 /* Update vectorial force */
401 f[j_coord_offset+DIM*1+XX] -= tx;
402 f[j_coord_offset+DIM*1+YY] -= ty;
403 f[j_coord_offset+DIM*1+ZZ] -= tz;
405 /**************************
406 * CALCULATE INTERACTIONS *
407 **************************/
409 /* COULOMB ELECTROSTATICS */
411 felec = velec*rinvsq12;
413 /* Update potential sums from outer loop */
418 /* Calculate temporary vectorial force */
423 /* Update vectorial force */
427 f[j_coord_offset+DIM*2+XX] -= tx;
428 f[j_coord_offset+DIM*2+YY] -= ty;
429 f[j_coord_offset+DIM*2+ZZ] -= tz;
431 /**************************
432 * CALCULATE INTERACTIONS *
433 **************************/
435 /* COULOMB ELECTROSTATICS */
437 felec = velec*rinvsq20;
439 /* Update potential sums from outer loop */
444 /* Calculate temporary vectorial force */
449 /* Update vectorial force */
453 f[j_coord_offset+DIM*0+XX] -= tx;
454 f[j_coord_offset+DIM*0+YY] -= ty;
455 f[j_coord_offset+DIM*0+ZZ] -= tz;
457 /**************************
458 * CALCULATE INTERACTIONS *
459 **************************/
461 /* COULOMB ELECTROSTATICS */
463 felec = velec*rinvsq21;
465 /* Update potential sums from outer loop */
470 /* Calculate temporary vectorial force */
475 /* Update vectorial force */
479 f[j_coord_offset+DIM*1+XX] -= tx;
480 f[j_coord_offset+DIM*1+YY] -= ty;
481 f[j_coord_offset+DIM*1+ZZ] -= tz;
483 /**************************
484 * CALCULATE INTERACTIONS *
485 **************************/
487 /* COULOMB ELECTROSTATICS */
489 felec = velec*rinvsq22;
491 /* Update potential sums from outer loop */
496 /* Calculate temporary vectorial force */
501 /* Update vectorial force */
505 f[j_coord_offset+DIM*2+XX] -= tx;
506 f[j_coord_offset+DIM*2+YY] -= ty;
507 f[j_coord_offset+DIM*2+ZZ] -= tz;
509 /* Inner loop uses 282 flops */
511 /* End of innermost loop */
514 f[i_coord_offset+DIM*0+XX] += fix0;
515 f[i_coord_offset+DIM*0+YY] += fiy0;
516 f[i_coord_offset+DIM*0+ZZ] += fiz0;
520 f[i_coord_offset+DIM*1+XX] += fix1;
521 f[i_coord_offset+DIM*1+YY] += fiy1;
522 f[i_coord_offset+DIM*1+ZZ] += fiz1;
526 f[i_coord_offset+DIM*2+XX] += fix2;
527 f[i_coord_offset+DIM*2+YY] += fiy2;
528 f[i_coord_offset+DIM*2+ZZ] += fiz2;
532 fshift[i_shift_offset+XX] += tx;
533 fshift[i_shift_offset+YY] += ty;
534 fshift[i_shift_offset+ZZ] += tz;
537 /* Update potential energies */
538 kernel_data->energygrp_elec[ggid] += velecsum;
539 kernel_data->energygrp_vdw[ggid] += vvdwsum;
541 /* Increment number of inner iterations */
542 inneriter += j_index_end - j_index_start;
544 /* Outer loop uses 32 flops */
547 /* Increment number of outer iterations */
550 /* Update outer/inner flops */
552 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_VF,outeriter*32 + inneriter*282);
555 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwBham_GeomW3W3_F_c
556 * Electrostatics interaction: Coulomb
557 * VdW interaction: Buckingham
558 * Geometry: Water3-Water3
559 * Calculate force/pot: Force
562 nb_kernel_ElecCoul_VdwBham_GeomW3W3_F_c
563 (t_nblist * gmx_restrict nlist,
564 rvec * gmx_restrict xx,
565 rvec * gmx_restrict ff,
566 t_forcerec * gmx_restrict fr,
567 t_mdatoms * gmx_restrict mdatoms,
568 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
569 t_nrnb * gmx_restrict nrnb)
571 int i_shift_offset,i_coord_offset,j_coord_offset;
572 int j_index_start,j_index_end;
573 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
574 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
575 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
576 real *shiftvec,*fshift,*x,*f;
578 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
580 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
582 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
584 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
586 real jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
588 real jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
589 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
590 real dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01,cexp1_01,cexp2_01;
591 real dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02,cexp1_02,cexp2_02;
592 real dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
593 real dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
594 real dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
595 real dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
596 real dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
597 real dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
598 real velec,felec,velecsum,facel,crf,krf,krf2;
601 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
610 jindex = nlist->jindex;
612 shiftidx = nlist->shift;
614 shiftvec = fr->shift_vec[0];
615 fshift = fr->fshift[0];
617 charge = mdatoms->chargeA;
618 nvdwtype = fr->ntype;
620 vdwtype = mdatoms->typeA;
622 /* Setup water-specific parameters */
623 inr = nlist->iinr[0];
624 iq0 = facel*charge[inr+0];
625 iq1 = facel*charge[inr+1];
626 iq2 = facel*charge[inr+2];
627 vdwioffset0 = 3*nvdwtype*vdwtype[inr+0];
632 vdwjidx0 = 3*vdwtype[inr+0];
634 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
635 cexp1_00 = vdwparam[vdwioffset0+vdwjidx0+1];
636 cexp2_00 = vdwparam[vdwioffset0+vdwjidx0+2];
649 /* Start outer loop over neighborlists */
650 for(iidx=0; iidx<nri; iidx++)
652 /* Load shift vector for this list */
653 i_shift_offset = DIM*shiftidx[iidx];
654 shX = shiftvec[i_shift_offset+XX];
655 shY = shiftvec[i_shift_offset+YY];
656 shZ = shiftvec[i_shift_offset+ZZ];
658 /* Load limits for loop over neighbors */
659 j_index_start = jindex[iidx];
660 j_index_end = jindex[iidx+1];
662 /* Get outer coordinate index */
664 i_coord_offset = DIM*inr;
666 /* Load i particle coords and add shift vector */
667 ix0 = shX + x[i_coord_offset+DIM*0+XX];
668 iy0 = shY + x[i_coord_offset+DIM*0+YY];
669 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
670 ix1 = shX + x[i_coord_offset+DIM*1+XX];
671 iy1 = shY + x[i_coord_offset+DIM*1+YY];
672 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
673 ix2 = shX + x[i_coord_offset+DIM*2+XX];
674 iy2 = shY + x[i_coord_offset+DIM*2+YY];
675 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
687 /* Start inner kernel loop */
688 for(jidx=j_index_start; jidx<j_index_end; jidx++)
690 /* Get j neighbor index, and coordinate index */
692 j_coord_offset = DIM*jnr;
694 /* load j atom coordinates */
695 jx0 = x[j_coord_offset+DIM*0+XX];
696 jy0 = x[j_coord_offset+DIM*0+YY];
697 jz0 = x[j_coord_offset+DIM*0+ZZ];
698 jx1 = x[j_coord_offset+DIM*1+XX];
699 jy1 = x[j_coord_offset+DIM*1+YY];
700 jz1 = x[j_coord_offset+DIM*1+ZZ];
701 jx2 = x[j_coord_offset+DIM*2+XX];
702 jy2 = x[j_coord_offset+DIM*2+YY];
703 jz2 = x[j_coord_offset+DIM*2+ZZ];
705 /* Calculate displacement vector */
734 /* Calculate squared distance and things based on it */
735 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
736 rsq01 = dx01*dx01+dy01*dy01+dz01*dz01;
737 rsq02 = dx02*dx02+dy02*dy02+dz02*dz02;
738 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
739 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
740 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
741 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
742 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
743 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
745 rinv00 = gmx_invsqrt(rsq00);
746 rinv01 = gmx_invsqrt(rsq01);
747 rinv02 = gmx_invsqrt(rsq02);
748 rinv10 = gmx_invsqrt(rsq10);
749 rinv11 = gmx_invsqrt(rsq11);
750 rinv12 = gmx_invsqrt(rsq12);
751 rinv20 = gmx_invsqrt(rsq20);
752 rinv21 = gmx_invsqrt(rsq21);
753 rinv22 = gmx_invsqrt(rsq22);
755 rinvsq00 = rinv00*rinv00;
756 rinvsq01 = rinv01*rinv01;
757 rinvsq02 = rinv02*rinv02;
758 rinvsq10 = rinv10*rinv10;
759 rinvsq11 = rinv11*rinv11;
760 rinvsq12 = rinv12*rinv12;
761 rinvsq20 = rinv20*rinv20;
762 rinvsq21 = rinv21*rinv21;
763 rinvsq22 = rinv22*rinv22;
765 /**************************
766 * CALCULATE INTERACTIONS *
767 **************************/
771 /* COULOMB ELECTROSTATICS */
773 felec = velec*rinvsq00;
775 /* BUCKINGHAM DISPERSION/REPULSION */
776 rinvsix = rinvsq00*rinvsq00*rinvsq00;
777 vvdw6 = c6_00*rinvsix;
779 vvdwexp = cexp1_00*exp(-br);
780 fvdw = (br*vvdwexp-vvdw6)*rinvsq00;
784 /* Calculate temporary vectorial force */
789 /* Update vectorial force */
793 f[j_coord_offset+DIM*0+XX] -= tx;
794 f[j_coord_offset+DIM*0+YY] -= ty;
795 f[j_coord_offset+DIM*0+ZZ] -= tz;
797 /**************************
798 * CALCULATE INTERACTIONS *
799 **************************/
801 /* COULOMB ELECTROSTATICS */
803 felec = velec*rinvsq01;
807 /* Calculate temporary vectorial force */
812 /* Update vectorial force */
816 f[j_coord_offset+DIM*1+XX] -= tx;
817 f[j_coord_offset+DIM*1+YY] -= ty;
818 f[j_coord_offset+DIM*1+ZZ] -= tz;
820 /**************************
821 * CALCULATE INTERACTIONS *
822 **************************/
824 /* COULOMB ELECTROSTATICS */
826 felec = velec*rinvsq02;
830 /* Calculate temporary vectorial force */
835 /* Update vectorial force */
839 f[j_coord_offset+DIM*2+XX] -= tx;
840 f[j_coord_offset+DIM*2+YY] -= ty;
841 f[j_coord_offset+DIM*2+ZZ] -= tz;
843 /**************************
844 * CALCULATE INTERACTIONS *
845 **************************/
847 /* COULOMB ELECTROSTATICS */
849 felec = velec*rinvsq10;
853 /* Calculate temporary vectorial force */
858 /* Update vectorial force */
862 f[j_coord_offset+DIM*0+XX] -= tx;
863 f[j_coord_offset+DIM*0+YY] -= ty;
864 f[j_coord_offset+DIM*0+ZZ] -= tz;
866 /**************************
867 * CALCULATE INTERACTIONS *
868 **************************/
870 /* COULOMB ELECTROSTATICS */
872 felec = velec*rinvsq11;
876 /* Calculate temporary vectorial force */
881 /* Update vectorial force */
885 f[j_coord_offset+DIM*1+XX] -= tx;
886 f[j_coord_offset+DIM*1+YY] -= ty;
887 f[j_coord_offset+DIM*1+ZZ] -= tz;
889 /**************************
890 * CALCULATE INTERACTIONS *
891 **************************/
893 /* COULOMB ELECTROSTATICS */
895 felec = velec*rinvsq12;
899 /* Calculate temporary vectorial force */
904 /* Update vectorial force */
908 f[j_coord_offset+DIM*2+XX] -= tx;
909 f[j_coord_offset+DIM*2+YY] -= ty;
910 f[j_coord_offset+DIM*2+ZZ] -= tz;
912 /**************************
913 * CALCULATE INTERACTIONS *
914 **************************/
916 /* COULOMB ELECTROSTATICS */
918 felec = velec*rinvsq20;
922 /* Calculate temporary vectorial force */
927 /* Update vectorial force */
931 f[j_coord_offset+DIM*0+XX] -= tx;
932 f[j_coord_offset+DIM*0+YY] -= ty;
933 f[j_coord_offset+DIM*0+ZZ] -= tz;
935 /**************************
936 * CALCULATE INTERACTIONS *
937 **************************/
939 /* COULOMB ELECTROSTATICS */
941 felec = velec*rinvsq21;
945 /* Calculate temporary vectorial force */
950 /* Update vectorial force */
954 f[j_coord_offset+DIM*1+XX] -= tx;
955 f[j_coord_offset+DIM*1+YY] -= ty;
956 f[j_coord_offset+DIM*1+ZZ] -= tz;
958 /**************************
959 * CALCULATE INTERACTIONS *
960 **************************/
962 /* COULOMB ELECTROSTATICS */
964 felec = velec*rinvsq22;
968 /* Calculate temporary vectorial force */
973 /* Update vectorial force */
977 f[j_coord_offset+DIM*2+XX] -= tx;
978 f[j_coord_offset+DIM*2+YY] -= ty;
979 f[j_coord_offset+DIM*2+ZZ] -= tz;
981 /* Inner loop uses 270 flops */
983 /* End of innermost loop */
986 f[i_coord_offset+DIM*0+XX] += fix0;
987 f[i_coord_offset+DIM*0+YY] += fiy0;
988 f[i_coord_offset+DIM*0+ZZ] += fiz0;
992 f[i_coord_offset+DIM*1+XX] += fix1;
993 f[i_coord_offset+DIM*1+YY] += fiy1;
994 f[i_coord_offset+DIM*1+ZZ] += fiz1;
998 f[i_coord_offset+DIM*2+XX] += fix2;
999 f[i_coord_offset+DIM*2+YY] += fiy2;
1000 f[i_coord_offset+DIM*2+ZZ] += fiz2;
1004 fshift[i_shift_offset+XX] += tx;
1005 fshift[i_shift_offset+YY] += ty;
1006 fshift[i_shift_offset+ZZ] += tz;
1008 /* Increment number of inner iterations */
1009 inneriter += j_index_end - j_index_start;
1011 /* Outer loop uses 30 flops */
1014 /* Increment number of outer iterations */
1017 /* Update outer/inner flops */
1019 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_F,outeriter*30 + inneriter*270);