2 * Note: this file was generated by the Gromacs c kernel generator.
4 * This source code is part of
8 * Copyright (c) 2001-2012, The GROMACS Development Team
10 * Gromacs is a library for molecular simulation and trajectory analysis,
11 * written by Erik Lindahl, David van der Spoel, Berk Hess, and others - for
12 * a full list of developers and information, check out http://www.gromacs.org
14 * This program is free software; you can redistribute it and/or modify it under
15 * the terms of the GNU Lesser General Public License as published by the Free
16 * Software Foundation; either version 2 of the License, or (at your option) any
19 * To help fund GROMACS development, we humbly ask that you cite
20 * the papers people have written on it - you can find them on the website.
28 #include "../nb_kernel.h"
29 #include "types/simple.h"
34 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwBham_GeomW3W3_VF_c
35 * Electrostatics interaction: Coulomb
36 * VdW interaction: Buckingham
37 * Geometry: Water3-Water3
38 * Calculate force/pot: PotentialAndForce
41 nb_kernel_ElecCoul_VdwBham_GeomW3W3_VF_c
42 (t_nblist * gmx_restrict nlist,
43 rvec * gmx_restrict xx,
44 rvec * gmx_restrict ff,
45 t_forcerec * gmx_restrict fr,
46 t_mdatoms * gmx_restrict mdatoms,
47 nb_kernel_data_t * gmx_restrict kernel_data,
48 t_nrnb * gmx_restrict nrnb)
50 int i_shift_offset,i_coord_offset,j_coord_offset;
51 int j_index_start,j_index_end;
52 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
53 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
54 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
55 real *shiftvec,*fshift,*x,*f;
57 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
59 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
61 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
63 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
65 real jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
67 real jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
68 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
69 real dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01,cexp1_01,cexp2_01;
70 real dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02,cexp1_02,cexp2_02;
71 real dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
72 real dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
73 real dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
74 real dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
75 real dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
76 real dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
77 real velec,felec,velecsum,facel,crf,krf,krf2;
80 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
89 jindex = nlist->jindex;
91 shiftidx = nlist->shift;
93 shiftvec = fr->shift_vec[0];
94 fshift = fr->fshift[0];
96 charge = mdatoms->chargeA;
99 vdwtype = mdatoms->typeA;
101 /* Setup water-specific parameters */
102 inr = nlist->iinr[0];
103 iq0 = facel*charge[inr+0];
104 iq1 = facel*charge[inr+1];
105 iq2 = facel*charge[inr+2];
106 vdwioffset0 = 3*nvdwtype*vdwtype[inr+0];
111 vdwjidx0 = 3*vdwtype[inr+0];
113 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
114 cexp1_00 = vdwparam[vdwioffset0+vdwjidx0+1];
115 cexp2_00 = vdwparam[vdwioffset0+vdwjidx0+2];
128 /* Start outer loop over neighborlists */
129 for(iidx=0; iidx<nri; iidx++)
131 /* Load shift vector for this list */
132 i_shift_offset = DIM*shiftidx[iidx];
133 shX = shiftvec[i_shift_offset+XX];
134 shY = shiftvec[i_shift_offset+YY];
135 shZ = shiftvec[i_shift_offset+ZZ];
137 /* Load limits for loop over neighbors */
138 j_index_start = jindex[iidx];
139 j_index_end = jindex[iidx+1];
141 /* Get outer coordinate index */
143 i_coord_offset = DIM*inr;
145 /* Load i particle coords and add shift vector */
146 ix0 = shX + x[i_coord_offset+DIM*0+XX];
147 iy0 = shY + x[i_coord_offset+DIM*0+YY];
148 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
149 ix1 = shX + x[i_coord_offset+DIM*1+XX];
150 iy1 = shY + x[i_coord_offset+DIM*1+YY];
151 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
152 ix2 = shX + x[i_coord_offset+DIM*2+XX];
153 iy2 = shY + x[i_coord_offset+DIM*2+YY];
154 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
166 /* Reset potential sums */
170 /* Start inner kernel loop */
171 for(jidx=j_index_start; jidx<j_index_end; jidx++)
173 /* Get j neighbor index, and coordinate index */
175 j_coord_offset = DIM*jnr;
177 /* load j atom coordinates */
178 jx0 = x[j_coord_offset+DIM*0+XX];
179 jy0 = x[j_coord_offset+DIM*0+YY];
180 jz0 = x[j_coord_offset+DIM*0+ZZ];
181 jx1 = x[j_coord_offset+DIM*1+XX];
182 jy1 = x[j_coord_offset+DIM*1+YY];
183 jz1 = x[j_coord_offset+DIM*1+ZZ];
184 jx2 = x[j_coord_offset+DIM*2+XX];
185 jy2 = x[j_coord_offset+DIM*2+YY];
186 jz2 = x[j_coord_offset+DIM*2+ZZ];
188 /* Calculate displacement vector */
217 /* Calculate squared distance and things based on it */
218 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
219 rsq01 = dx01*dx01+dy01*dy01+dz01*dz01;
220 rsq02 = dx02*dx02+dy02*dy02+dz02*dz02;
221 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
222 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
223 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
224 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
225 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
226 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
228 rinv00 = gmx_invsqrt(rsq00);
229 rinv01 = gmx_invsqrt(rsq01);
230 rinv02 = gmx_invsqrt(rsq02);
231 rinv10 = gmx_invsqrt(rsq10);
232 rinv11 = gmx_invsqrt(rsq11);
233 rinv12 = gmx_invsqrt(rsq12);
234 rinv20 = gmx_invsqrt(rsq20);
235 rinv21 = gmx_invsqrt(rsq21);
236 rinv22 = gmx_invsqrt(rsq22);
238 rinvsq00 = rinv00*rinv00;
239 rinvsq01 = rinv01*rinv01;
240 rinvsq02 = rinv02*rinv02;
241 rinvsq10 = rinv10*rinv10;
242 rinvsq11 = rinv11*rinv11;
243 rinvsq12 = rinv12*rinv12;
244 rinvsq20 = rinv20*rinv20;
245 rinvsq21 = rinv21*rinv21;
246 rinvsq22 = rinv22*rinv22;
248 /**************************
249 * CALCULATE INTERACTIONS *
250 **************************/
254 /* COULOMB ELECTROSTATICS */
256 felec = velec*rinvsq00;
258 /* BUCKINGHAM DISPERSION/REPULSION */
259 rinvsix = rinvsq00*rinvsq00*rinvsq00;
260 vvdw6 = c6_00*rinvsix;
262 vvdwexp = cexp1_00*exp(-br);
263 vvdw = vvdwexp - vvdw6*(1.0/6.0);
264 fvdw = (br*vvdwexp-vvdw6)*rinvsq00;
266 /* Update potential sums from outer loop */
272 /* Calculate temporary vectorial force */
277 /* Update vectorial force */
281 f[j_coord_offset+DIM*0+XX] -= tx;
282 f[j_coord_offset+DIM*0+YY] -= ty;
283 f[j_coord_offset+DIM*0+ZZ] -= tz;
285 /**************************
286 * CALCULATE INTERACTIONS *
287 **************************/
289 /* COULOMB ELECTROSTATICS */
291 felec = velec*rinvsq01;
293 /* Update potential sums from outer loop */
298 /* Calculate temporary vectorial force */
303 /* Update vectorial force */
307 f[j_coord_offset+DIM*1+XX] -= tx;
308 f[j_coord_offset+DIM*1+YY] -= ty;
309 f[j_coord_offset+DIM*1+ZZ] -= tz;
311 /**************************
312 * CALCULATE INTERACTIONS *
313 **************************/
315 /* COULOMB ELECTROSTATICS */
317 felec = velec*rinvsq02;
319 /* Update potential sums from outer loop */
324 /* Calculate temporary vectorial force */
329 /* Update vectorial force */
333 f[j_coord_offset+DIM*2+XX] -= tx;
334 f[j_coord_offset+DIM*2+YY] -= ty;
335 f[j_coord_offset+DIM*2+ZZ] -= tz;
337 /**************************
338 * CALCULATE INTERACTIONS *
339 **************************/
341 /* COULOMB ELECTROSTATICS */
343 felec = velec*rinvsq10;
345 /* Update potential sums from outer loop */
350 /* Calculate temporary vectorial force */
355 /* Update vectorial force */
359 f[j_coord_offset+DIM*0+XX] -= tx;
360 f[j_coord_offset+DIM*0+YY] -= ty;
361 f[j_coord_offset+DIM*0+ZZ] -= tz;
363 /**************************
364 * CALCULATE INTERACTIONS *
365 **************************/
367 /* COULOMB ELECTROSTATICS */
369 felec = velec*rinvsq11;
371 /* Update potential sums from outer loop */
376 /* Calculate temporary vectorial force */
381 /* Update vectorial force */
385 f[j_coord_offset+DIM*1+XX] -= tx;
386 f[j_coord_offset+DIM*1+YY] -= ty;
387 f[j_coord_offset+DIM*1+ZZ] -= tz;
389 /**************************
390 * CALCULATE INTERACTIONS *
391 **************************/
393 /* COULOMB ELECTROSTATICS */
395 felec = velec*rinvsq12;
397 /* Update potential sums from outer loop */
402 /* Calculate temporary vectorial force */
407 /* Update vectorial force */
411 f[j_coord_offset+DIM*2+XX] -= tx;
412 f[j_coord_offset+DIM*2+YY] -= ty;
413 f[j_coord_offset+DIM*2+ZZ] -= tz;
415 /**************************
416 * CALCULATE INTERACTIONS *
417 **************************/
419 /* COULOMB ELECTROSTATICS */
421 felec = velec*rinvsq20;
423 /* Update potential sums from outer loop */
428 /* Calculate temporary vectorial force */
433 /* Update vectorial force */
437 f[j_coord_offset+DIM*0+XX] -= tx;
438 f[j_coord_offset+DIM*0+YY] -= ty;
439 f[j_coord_offset+DIM*0+ZZ] -= tz;
441 /**************************
442 * CALCULATE INTERACTIONS *
443 **************************/
445 /* COULOMB ELECTROSTATICS */
447 felec = velec*rinvsq21;
449 /* Update potential sums from outer loop */
454 /* Calculate temporary vectorial force */
459 /* Update vectorial force */
463 f[j_coord_offset+DIM*1+XX] -= tx;
464 f[j_coord_offset+DIM*1+YY] -= ty;
465 f[j_coord_offset+DIM*1+ZZ] -= tz;
467 /**************************
468 * CALCULATE INTERACTIONS *
469 **************************/
471 /* COULOMB ELECTROSTATICS */
473 felec = velec*rinvsq22;
475 /* Update potential sums from outer loop */
480 /* Calculate temporary vectorial force */
485 /* Update vectorial force */
489 f[j_coord_offset+DIM*2+XX] -= tx;
490 f[j_coord_offset+DIM*2+YY] -= ty;
491 f[j_coord_offset+DIM*2+ZZ] -= tz;
493 /* Inner loop uses 282 flops */
495 /* End of innermost loop */
498 f[i_coord_offset+DIM*0+XX] += fix0;
499 f[i_coord_offset+DIM*0+YY] += fiy0;
500 f[i_coord_offset+DIM*0+ZZ] += fiz0;
504 f[i_coord_offset+DIM*1+XX] += fix1;
505 f[i_coord_offset+DIM*1+YY] += fiy1;
506 f[i_coord_offset+DIM*1+ZZ] += fiz1;
510 f[i_coord_offset+DIM*2+XX] += fix2;
511 f[i_coord_offset+DIM*2+YY] += fiy2;
512 f[i_coord_offset+DIM*2+ZZ] += fiz2;
516 fshift[i_shift_offset+XX] += tx;
517 fshift[i_shift_offset+YY] += ty;
518 fshift[i_shift_offset+ZZ] += tz;
521 /* Update potential energies */
522 kernel_data->energygrp_elec[ggid] += velecsum;
523 kernel_data->energygrp_vdw[ggid] += vvdwsum;
525 /* Increment number of inner iterations */
526 inneriter += j_index_end - j_index_start;
528 /* Outer loop uses 32 flops */
531 /* Increment number of outer iterations */
534 /* Update outer/inner flops */
536 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_VF,outeriter*32 + inneriter*282);
539 * Gromacs nonbonded kernel: nb_kernel_ElecCoul_VdwBham_GeomW3W3_F_c
540 * Electrostatics interaction: Coulomb
541 * VdW interaction: Buckingham
542 * Geometry: Water3-Water3
543 * Calculate force/pot: Force
546 nb_kernel_ElecCoul_VdwBham_GeomW3W3_F_c
547 (t_nblist * gmx_restrict nlist,
548 rvec * gmx_restrict xx,
549 rvec * gmx_restrict ff,
550 t_forcerec * gmx_restrict fr,
551 t_mdatoms * gmx_restrict mdatoms,
552 nb_kernel_data_t * gmx_restrict kernel_data,
553 t_nrnb * gmx_restrict nrnb)
555 int i_shift_offset,i_coord_offset,j_coord_offset;
556 int j_index_start,j_index_end;
557 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
558 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
559 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
560 real *shiftvec,*fshift,*x,*f;
562 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
564 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
566 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
568 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
570 real jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
572 real jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2;
573 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
574 real dx01,dy01,dz01,rsq01,rinv01,rinvsq01,r01,qq01,c6_01,c12_01,cexp1_01,cexp2_01;
575 real dx02,dy02,dz02,rsq02,rinv02,rinvsq02,r02,qq02,c6_02,c12_02,cexp1_02,cexp2_02;
576 real dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
577 real dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11;
578 real dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12;
579 real dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
580 real dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21;
581 real dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22;
582 real velec,felec,velecsum,facel,crf,krf,krf2;
585 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
594 jindex = nlist->jindex;
596 shiftidx = nlist->shift;
598 shiftvec = fr->shift_vec[0];
599 fshift = fr->fshift[0];
601 charge = mdatoms->chargeA;
602 nvdwtype = fr->ntype;
604 vdwtype = mdatoms->typeA;
606 /* Setup water-specific parameters */
607 inr = nlist->iinr[0];
608 iq0 = facel*charge[inr+0];
609 iq1 = facel*charge[inr+1];
610 iq2 = facel*charge[inr+2];
611 vdwioffset0 = 3*nvdwtype*vdwtype[inr+0];
616 vdwjidx0 = 3*vdwtype[inr+0];
618 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
619 cexp1_00 = vdwparam[vdwioffset0+vdwjidx0+1];
620 cexp2_00 = vdwparam[vdwioffset0+vdwjidx0+2];
633 /* Start outer loop over neighborlists */
634 for(iidx=0; iidx<nri; iidx++)
636 /* Load shift vector for this list */
637 i_shift_offset = DIM*shiftidx[iidx];
638 shX = shiftvec[i_shift_offset+XX];
639 shY = shiftvec[i_shift_offset+YY];
640 shZ = shiftvec[i_shift_offset+ZZ];
642 /* Load limits for loop over neighbors */
643 j_index_start = jindex[iidx];
644 j_index_end = jindex[iidx+1];
646 /* Get outer coordinate index */
648 i_coord_offset = DIM*inr;
650 /* Load i particle coords and add shift vector */
651 ix0 = shX + x[i_coord_offset+DIM*0+XX];
652 iy0 = shY + x[i_coord_offset+DIM*0+YY];
653 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
654 ix1 = shX + x[i_coord_offset+DIM*1+XX];
655 iy1 = shY + x[i_coord_offset+DIM*1+YY];
656 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
657 ix2 = shX + x[i_coord_offset+DIM*2+XX];
658 iy2 = shY + x[i_coord_offset+DIM*2+YY];
659 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
671 /* Start inner kernel loop */
672 for(jidx=j_index_start; jidx<j_index_end; jidx++)
674 /* Get j neighbor index, and coordinate index */
676 j_coord_offset = DIM*jnr;
678 /* load j atom coordinates */
679 jx0 = x[j_coord_offset+DIM*0+XX];
680 jy0 = x[j_coord_offset+DIM*0+YY];
681 jz0 = x[j_coord_offset+DIM*0+ZZ];
682 jx1 = x[j_coord_offset+DIM*1+XX];
683 jy1 = x[j_coord_offset+DIM*1+YY];
684 jz1 = x[j_coord_offset+DIM*1+ZZ];
685 jx2 = x[j_coord_offset+DIM*2+XX];
686 jy2 = x[j_coord_offset+DIM*2+YY];
687 jz2 = x[j_coord_offset+DIM*2+ZZ];
689 /* Calculate displacement vector */
718 /* Calculate squared distance and things based on it */
719 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
720 rsq01 = dx01*dx01+dy01*dy01+dz01*dz01;
721 rsq02 = dx02*dx02+dy02*dy02+dz02*dz02;
722 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
723 rsq11 = dx11*dx11+dy11*dy11+dz11*dz11;
724 rsq12 = dx12*dx12+dy12*dy12+dz12*dz12;
725 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
726 rsq21 = dx21*dx21+dy21*dy21+dz21*dz21;
727 rsq22 = dx22*dx22+dy22*dy22+dz22*dz22;
729 rinv00 = gmx_invsqrt(rsq00);
730 rinv01 = gmx_invsqrt(rsq01);
731 rinv02 = gmx_invsqrt(rsq02);
732 rinv10 = gmx_invsqrt(rsq10);
733 rinv11 = gmx_invsqrt(rsq11);
734 rinv12 = gmx_invsqrt(rsq12);
735 rinv20 = gmx_invsqrt(rsq20);
736 rinv21 = gmx_invsqrt(rsq21);
737 rinv22 = gmx_invsqrt(rsq22);
739 rinvsq00 = rinv00*rinv00;
740 rinvsq01 = rinv01*rinv01;
741 rinvsq02 = rinv02*rinv02;
742 rinvsq10 = rinv10*rinv10;
743 rinvsq11 = rinv11*rinv11;
744 rinvsq12 = rinv12*rinv12;
745 rinvsq20 = rinv20*rinv20;
746 rinvsq21 = rinv21*rinv21;
747 rinvsq22 = rinv22*rinv22;
749 /**************************
750 * CALCULATE INTERACTIONS *
751 **************************/
755 /* COULOMB ELECTROSTATICS */
757 felec = velec*rinvsq00;
759 /* BUCKINGHAM DISPERSION/REPULSION */
760 rinvsix = rinvsq00*rinvsq00*rinvsq00;
761 vvdw6 = c6_00*rinvsix;
763 vvdwexp = cexp1_00*exp(-br);
764 fvdw = (br*vvdwexp-vvdw6)*rinvsq00;
768 /* Calculate temporary vectorial force */
773 /* Update vectorial force */
777 f[j_coord_offset+DIM*0+XX] -= tx;
778 f[j_coord_offset+DIM*0+YY] -= ty;
779 f[j_coord_offset+DIM*0+ZZ] -= tz;
781 /**************************
782 * CALCULATE INTERACTIONS *
783 **************************/
785 /* COULOMB ELECTROSTATICS */
787 felec = velec*rinvsq01;
791 /* Calculate temporary vectorial force */
796 /* Update vectorial force */
800 f[j_coord_offset+DIM*1+XX] -= tx;
801 f[j_coord_offset+DIM*1+YY] -= ty;
802 f[j_coord_offset+DIM*1+ZZ] -= tz;
804 /**************************
805 * CALCULATE INTERACTIONS *
806 **************************/
808 /* COULOMB ELECTROSTATICS */
810 felec = velec*rinvsq02;
814 /* Calculate temporary vectorial force */
819 /* Update vectorial force */
823 f[j_coord_offset+DIM*2+XX] -= tx;
824 f[j_coord_offset+DIM*2+YY] -= ty;
825 f[j_coord_offset+DIM*2+ZZ] -= tz;
827 /**************************
828 * CALCULATE INTERACTIONS *
829 **************************/
831 /* COULOMB ELECTROSTATICS */
833 felec = velec*rinvsq10;
837 /* Calculate temporary vectorial force */
842 /* Update vectorial force */
846 f[j_coord_offset+DIM*0+XX] -= tx;
847 f[j_coord_offset+DIM*0+YY] -= ty;
848 f[j_coord_offset+DIM*0+ZZ] -= tz;
850 /**************************
851 * CALCULATE INTERACTIONS *
852 **************************/
854 /* COULOMB ELECTROSTATICS */
856 felec = velec*rinvsq11;
860 /* Calculate temporary vectorial force */
865 /* Update vectorial force */
869 f[j_coord_offset+DIM*1+XX] -= tx;
870 f[j_coord_offset+DIM*1+YY] -= ty;
871 f[j_coord_offset+DIM*1+ZZ] -= tz;
873 /**************************
874 * CALCULATE INTERACTIONS *
875 **************************/
877 /* COULOMB ELECTROSTATICS */
879 felec = velec*rinvsq12;
883 /* Calculate temporary vectorial force */
888 /* Update vectorial force */
892 f[j_coord_offset+DIM*2+XX] -= tx;
893 f[j_coord_offset+DIM*2+YY] -= ty;
894 f[j_coord_offset+DIM*2+ZZ] -= tz;
896 /**************************
897 * CALCULATE INTERACTIONS *
898 **************************/
900 /* COULOMB ELECTROSTATICS */
902 felec = velec*rinvsq20;
906 /* Calculate temporary vectorial force */
911 /* Update vectorial force */
915 f[j_coord_offset+DIM*0+XX] -= tx;
916 f[j_coord_offset+DIM*0+YY] -= ty;
917 f[j_coord_offset+DIM*0+ZZ] -= tz;
919 /**************************
920 * CALCULATE INTERACTIONS *
921 **************************/
923 /* COULOMB ELECTROSTATICS */
925 felec = velec*rinvsq21;
929 /* Calculate temporary vectorial force */
934 /* Update vectorial force */
938 f[j_coord_offset+DIM*1+XX] -= tx;
939 f[j_coord_offset+DIM*1+YY] -= ty;
940 f[j_coord_offset+DIM*1+ZZ] -= tz;
942 /**************************
943 * CALCULATE INTERACTIONS *
944 **************************/
946 /* COULOMB ELECTROSTATICS */
948 felec = velec*rinvsq22;
952 /* Calculate temporary vectorial force */
957 /* Update vectorial force */
961 f[j_coord_offset+DIM*2+XX] -= tx;
962 f[j_coord_offset+DIM*2+YY] -= ty;
963 f[j_coord_offset+DIM*2+ZZ] -= tz;
965 /* Inner loop uses 270 flops */
967 /* End of innermost loop */
970 f[i_coord_offset+DIM*0+XX] += fix0;
971 f[i_coord_offset+DIM*0+YY] += fiy0;
972 f[i_coord_offset+DIM*0+ZZ] += fiz0;
976 f[i_coord_offset+DIM*1+XX] += fix1;
977 f[i_coord_offset+DIM*1+YY] += fiy1;
978 f[i_coord_offset+DIM*1+ZZ] += fiz1;
982 f[i_coord_offset+DIM*2+XX] += fix2;
983 f[i_coord_offset+DIM*2+YY] += fiy2;
984 f[i_coord_offset+DIM*2+ZZ] += fiz2;
988 fshift[i_shift_offset+XX] += tx;
989 fshift[i_shift_offset+YY] += ty;
990 fshift[i_shift_offset+ZZ] += tz;
992 /* Increment number of inner iterations */
993 inneriter += j_index_end - j_index_start;
995 /* Outer loop uses 30 flops */
998 /* Increment number of outer iterations */
1001 /* Update outer/inner flops */
1003 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_F,outeriter*30 + inneriter*270);