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_ElecEwSw_VdwLJSw_GeomW3P1_VF_c
49 * Electrostatics interaction: Ewald
50 * VdW interaction: LennardJones
51 * Geometry: Water3-Particle
52 * Calculate force/pot: PotentialAndForce
55 nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_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;
78 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
79 real dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
80 real dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
81 real velec,felec,velecsum,facel,crf,krf,krf2;
84 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
88 real ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace;
90 real rswitch,swV3,swV4,swV5,swF2,swF3,swF4,d,d2,sw,dsw;
97 jindex = nlist->jindex;
99 shiftidx = nlist->shift;
101 shiftvec = fr->shift_vec[0];
102 fshift = fr->fshift[0];
104 charge = mdatoms->chargeA;
105 nvdwtype = fr->ntype;
107 vdwtype = mdatoms->typeA;
109 sh_ewald = fr->ic->sh_ewald;
110 ewtab = fr->ic->tabq_coul_FDV0;
111 ewtabscale = fr->ic->tabq_scale;
112 ewtabhalfspace = 0.5/ewtabscale;
114 /* Setup water-specific parameters */
115 inr = nlist->iinr[0];
116 iq0 = facel*charge[inr+0];
117 iq1 = facel*charge[inr+1];
118 iq2 = facel*charge[inr+2];
119 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
121 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
122 rcutoff = fr->rcoulomb;
123 rcutoff2 = rcutoff*rcutoff;
125 rswitch = fr->rcoulomb_switch;
126 /* Setup switch parameters */
128 swV3 = -10.0/(d*d*d);
129 swV4 = 15.0/(d*d*d*d);
130 swV5 = -6.0/(d*d*d*d*d);
131 swF2 = -30.0/(d*d*d);
132 swF3 = 60.0/(d*d*d*d);
133 swF4 = -30.0/(d*d*d*d*d);
138 /* Start outer loop over neighborlists */
139 for(iidx=0; iidx<nri; iidx++)
141 /* Load shift vector for this list */
142 i_shift_offset = DIM*shiftidx[iidx];
143 shX = shiftvec[i_shift_offset+XX];
144 shY = shiftvec[i_shift_offset+YY];
145 shZ = shiftvec[i_shift_offset+ZZ];
147 /* Load limits for loop over neighbors */
148 j_index_start = jindex[iidx];
149 j_index_end = jindex[iidx+1];
151 /* Get outer coordinate index */
153 i_coord_offset = DIM*inr;
155 /* Load i particle coords and add shift vector */
156 ix0 = shX + x[i_coord_offset+DIM*0+XX];
157 iy0 = shY + x[i_coord_offset+DIM*0+YY];
158 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
159 ix1 = shX + x[i_coord_offset+DIM*1+XX];
160 iy1 = shY + x[i_coord_offset+DIM*1+YY];
161 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
162 ix2 = shX + x[i_coord_offset+DIM*2+XX];
163 iy2 = shY + x[i_coord_offset+DIM*2+YY];
164 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
176 /* Reset potential sums */
180 /* Start inner kernel loop */
181 for(jidx=j_index_start; jidx<j_index_end; jidx++)
183 /* Get j neighbor index, and coordinate index */
185 j_coord_offset = DIM*jnr;
187 /* load j atom coordinates */
188 jx0 = x[j_coord_offset+DIM*0+XX];
189 jy0 = x[j_coord_offset+DIM*0+YY];
190 jz0 = x[j_coord_offset+DIM*0+ZZ];
192 /* Calculate displacement vector */
203 /* Calculate squared distance and things based on it */
204 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
205 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
206 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
208 rinv00 = gmx_invsqrt(rsq00);
209 rinv10 = gmx_invsqrt(rsq10);
210 rinv20 = gmx_invsqrt(rsq20);
212 rinvsq00 = rinv00*rinv00;
213 rinvsq10 = rinv10*rinv10;
214 rinvsq20 = rinv20*rinv20;
216 /* Load parameters for j particles */
218 vdwjidx0 = 2*vdwtype[jnr+0];
220 /**************************
221 * CALCULATE INTERACTIONS *
222 **************************/
230 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
231 c12_00 = vdwparam[vdwioffset0+vdwjidx0+1];
233 /* EWALD ELECTROSTATICS */
235 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
236 ewrt = r00*ewtabscale;
240 felec = ewtab[ewitab]+eweps*ewtab[ewitab+1];
241 velec = qq00*(rinv00-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
242 felec = qq00*rinv00*(rinvsq00-felec);
244 /* LENNARD-JONES DISPERSION/REPULSION */
246 rinvsix = rinvsq00*rinvsq00*rinvsq00;
247 vvdw6 = c6_00*rinvsix;
248 vvdw12 = c12_00*rinvsix*rinvsix;
249 vvdw = vvdw12*(1.0/12.0) - vvdw6*(1.0/6.0);
250 fvdw = (vvdw12-vvdw6)*rinvsq00;
253 d = (d>0.0) ? d : 0.0;
255 sw = 1.0+d2*d*(swV3+d*(swV4+d*swV5));
257 dsw = d2*(swF2+d*(swF3+d*swF4));
259 /* Evaluate switch function */
260 /* fscal'=f'/r=-(v*sw)'/r=-(v'*sw+v*dsw)/r=-v'*sw/r-v*dsw/r=fscal*sw-v*dsw/r */
261 felec = felec*sw - rinv00*velec*dsw;
262 fvdw = fvdw*sw - rinv00*vvdw*dsw;
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;
287 /**************************
288 * CALCULATE INTERACTIONS *
289 **************************/
298 /* EWALD ELECTROSTATICS */
300 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
301 ewrt = r10*ewtabscale;
305 felec = ewtab[ewitab]+eweps*ewtab[ewitab+1];
306 velec = qq10*(rinv10-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
307 felec = qq10*rinv10*(rinvsq10-felec);
310 d = (d>0.0) ? d : 0.0;
312 sw = 1.0+d2*d*(swV3+d*(swV4+d*swV5));
314 dsw = d2*(swF2+d*(swF3+d*swF4));
316 /* Evaluate switch function */
317 /* fscal'=f'/r=-(v*sw)'/r=-(v'*sw+v*dsw)/r=-v'*sw/r-v*dsw/r=fscal*sw-v*dsw/r */
318 felec = felec*sw - rinv10*velec*dsw;
321 /* Update potential sums from outer loop */
326 /* Calculate temporary vectorial force */
331 /* Update vectorial force */
335 f[j_coord_offset+DIM*0+XX] -= tx;
336 f[j_coord_offset+DIM*0+YY] -= ty;
337 f[j_coord_offset+DIM*0+ZZ] -= tz;
341 /**************************
342 * CALCULATE INTERACTIONS *
343 **************************/
352 /* EWALD ELECTROSTATICS */
354 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
355 ewrt = r20*ewtabscale;
359 felec = ewtab[ewitab]+eweps*ewtab[ewitab+1];
360 velec = qq20*(rinv20-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
361 felec = qq20*rinv20*(rinvsq20-felec);
364 d = (d>0.0) ? d : 0.0;
366 sw = 1.0+d2*d*(swV3+d*(swV4+d*swV5));
368 dsw = d2*(swF2+d*(swF3+d*swF4));
370 /* Evaluate switch function */
371 /* fscal'=f'/r=-(v*sw)'/r=-(v'*sw+v*dsw)/r=-v'*sw/r-v*dsw/r=fscal*sw-v*dsw/r */
372 felec = felec*sw - rinv20*velec*dsw;
375 /* Update potential sums from outer loop */
380 /* Calculate temporary vectorial force */
385 /* Update vectorial force */
389 f[j_coord_offset+DIM*0+XX] -= tx;
390 f[j_coord_offset+DIM*0+YY] -= ty;
391 f[j_coord_offset+DIM*0+ZZ] -= tz;
395 /* Inner loop uses 193 flops */
397 /* End of innermost loop */
400 f[i_coord_offset+DIM*0+XX] += fix0;
401 f[i_coord_offset+DIM*0+YY] += fiy0;
402 f[i_coord_offset+DIM*0+ZZ] += fiz0;
406 f[i_coord_offset+DIM*1+XX] += fix1;
407 f[i_coord_offset+DIM*1+YY] += fiy1;
408 f[i_coord_offset+DIM*1+ZZ] += fiz1;
412 f[i_coord_offset+DIM*2+XX] += fix2;
413 f[i_coord_offset+DIM*2+YY] += fiy2;
414 f[i_coord_offset+DIM*2+ZZ] += fiz2;
418 fshift[i_shift_offset+XX] += tx;
419 fshift[i_shift_offset+YY] += ty;
420 fshift[i_shift_offset+ZZ] += tz;
423 /* Update potential energies */
424 kernel_data->energygrp_elec[ggid] += velecsum;
425 kernel_data->energygrp_vdw[ggid] += vvdwsum;
427 /* Increment number of inner iterations */
428 inneriter += j_index_end - j_index_start;
430 /* Outer loop uses 32 flops */
433 /* Increment number of outer iterations */
436 /* Update outer/inner flops */
438 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3_VF,outeriter*32 + inneriter*193);
441 * Gromacs nonbonded kernel: nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_F_c
442 * Electrostatics interaction: Ewald
443 * VdW interaction: LennardJones
444 * Geometry: Water3-Particle
445 * Calculate force/pot: Force
448 nb_kernel_ElecEwSw_VdwLJSw_GeomW3P1_F_c
449 (t_nblist * gmx_restrict nlist,
450 rvec * gmx_restrict xx,
451 rvec * gmx_restrict ff,
452 t_forcerec * gmx_restrict fr,
453 t_mdatoms * gmx_restrict mdatoms,
454 nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
455 t_nrnb * gmx_restrict nrnb)
457 int i_shift_offset,i_coord_offset,j_coord_offset;
458 int j_index_start,j_index_end;
459 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
460 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
461 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
462 real *shiftvec,*fshift,*x,*f;
464 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
466 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
468 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
470 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
471 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
472 real dx10,dy10,dz10,rsq10,rinv10,rinvsq10,r10,qq10,c6_10,c12_10,cexp1_10,cexp2_10;
473 real dx20,dy20,dz20,rsq20,rinv20,rinvsq20,r20,qq20,c6_20,c12_20,cexp1_20,cexp2_20;
474 real velec,felec,velecsum,facel,crf,krf,krf2;
477 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
481 real ewtabscale,eweps,sh_ewald,ewrt,ewtabhalfspace;
483 real rswitch,swV3,swV4,swV5,swF2,swF3,swF4,d,d2,sw,dsw;
490 jindex = nlist->jindex;
492 shiftidx = nlist->shift;
494 shiftvec = fr->shift_vec[0];
495 fshift = fr->fshift[0];
497 charge = mdatoms->chargeA;
498 nvdwtype = fr->ntype;
500 vdwtype = mdatoms->typeA;
502 sh_ewald = fr->ic->sh_ewald;
503 ewtab = fr->ic->tabq_coul_FDV0;
504 ewtabscale = fr->ic->tabq_scale;
505 ewtabhalfspace = 0.5/ewtabscale;
507 /* Setup water-specific parameters */
508 inr = nlist->iinr[0];
509 iq0 = facel*charge[inr+0];
510 iq1 = facel*charge[inr+1];
511 iq2 = facel*charge[inr+2];
512 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
514 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
515 rcutoff = fr->rcoulomb;
516 rcutoff2 = rcutoff*rcutoff;
518 rswitch = fr->rcoulomb_switch;
519 /* Setup switch parameters */
521 swV3 = -10.0/(d*d*d);
522 swV4 = 15.0/(d*d*d*d);
523 swV5 = -6.0/(d*d*d*d*d);
524 swF2 = -30.0/(d*d*d);
525 swF3 = 60.0/(d*d*d*d);
526 swF4 = -30.0/(d*d*d*d*d);
531 /* Start outer loop over neighborlists */
532 for(iidx=0; iidx<nri; iidx++)
534 /* Load shift vector for this list */
535 i_shift_offset = DIM*shiftidx[iidx];
536 shX = shiftvec[i_shift_offset+XX];
537 shY = shiftvec[i_shift_offset+YY];
538 shZ = shiftvec[i_shift_offset+ZZ];
540 /* Load limits for loop over neighbors */
541 j_index_start = jindex[iidx];
542 j_index_end = jindex[iidx+1];
544 /* Get outer coordinate index */
546 i_coord_offset = DIM*inr;
548 /* Load i particle coords and add shift vector */
549 ix0 = shX + x[i_coord_offset+DIM*0+XX];
550 iy0 = shY + x[i_coord_offset+DIM*0+YY];
551 iz0 = shZ + x[i_coord_offset+DIM*0+ZZ];
552 ix1 = shX + x[i_coord_offset+DIM*1+XX];
553 iy1 = shY + x[i_coord_offset+DIM*1+YY];
554 iz1 = shZ + x[i_coord_offset+DIM*1+ZZ];
555 ix2 = shX + x[i_coord_offset+DIM*2+XX];
556 iy2 = shY + x[i_coord_offset+DIM*2+YY];
557 iz2 = shZ + x[i_coord_offset+DIM*2+ZZ];
569 /* Start inner kernel loop */
570 for(jidx=j_index_start; jidx<j_index_end; jidx++)
572 /* Get j neighbor index, and coordinate index */
574 j_coord_offset = DIM*jnr;
576 /* load j atom coordinates */
577 jx0 = x[j_coord_offset+DIM*0+XX];
578 jy0 = x[j_coord_offset+DIM*0+YY];
579 jz0 = x[j_coord_offset+DIM*0+ZZ];
581 /* Calculate displacement vector */
592 /* Calculate squared distance and things based on it */
593 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
594 rsq10 = dx10*dx10+dy10*dy10+dz10*dz10;
595 rsq20 = dx20*dx20+dy20*dy20+dz20*dz20;
597 rinv00 = gmx_invsqrt(rsq00);
598 rinv10 = gmx_invsqrt(rsq10);
599 rinv20 = gmx_invsqrt(rsq20);
601 rinvsq00 = rinv00*rinv00;
602 rinvsq10 = rinv10*rinv10;
603 rinvsq20 = rinv20*rinv20;
605 /* Load parameters for j particles */
607 vdwjidx0 = 2*vdwtype[jnr+0];
609 /**************************
610 * CALCULATE INTERACTIONS *
611 **************************/
619 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
620 c12_00 = vdwparam[vdwioffset0+vdwjidx0+1];
622 /* EWALD ELECTROSTATICS */
624 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
625 ewrt = r00*ewtabscale;
629 felec = ewtab[ewitab]+eweps*ewtab[ewitab+1];
630 velec = qq00*(rinv00-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
631 felec = qq00*rinv00*(rinvsq00-felec);
633 /* LENNARD-JONES DISPERSION/REPULSION */
635 rinvsix = rinvsq00*rinvsq00*rinvsq00;
636 vvdw6 = c6_00*rinvsix;
637 vvdw12 = c12_00*rinvsix*rinvsix;
638 vvdw = vvdw12*(1.0/12.0) - vvdw6*(1.0/6.0);
639 fvdw = (vvdw12-vvdw6)*rinvsq00;
642 d = (d>0.0) ? d : 0.0;
644 sw = 1.0+d2*d*(swV3+d*(swV4+d*swV5));
646 dsw = d2*(swF2+d*(swF3+d*swF4));
648 /* Evaluate switch function */
649 /* fscal'=f'/r=-(v*sw)'/r=-(v'*sw+v*dsw)/r=-v'*sw/r-v*dsw/r=fscal*sw-v*dsw/r */
650 felec = felec*sw - rinv00*velec*dsw;
651 fvdw = fvdw*sw - rinv00*vvdw*dsw;
655 /* Calculate temporary vectorial force */
660 /* Update vectorial force */
664 f[j_coord_offset+DIM*0+XX] -= tx;
665 f[j_coord_offset+DIM*0+YY] -= ty;
666 f[j_coord_offset+DIM*0+ZZ] -= tz;
670 /**************************
671 * CALCULATE INTERACTIONS *
672 **************************/
681 /* EWALD ELECTROSTATICS */
683 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
684 ewrt = r10*ewtabscale;
688 felec = ewtab[ewitab]+eweps*ewtab[ewitab+1];
689 velec = qq10*(rinv10-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
690 felec = qq10*rinv10*(rinvsq10-felec);
693 d = (d>0.0) ? d : 0.0;
695 sw = 1.0+d2*d*(swV3+d*(swV4+d*swV5));
697 dsw = d2*(swF2+d*(swF3+d*swF4));
699 /* Evaluate switch function */
700 /* fscal'=f'/r=-(v*sw)'/r=-(v'*sw+v*dsw)/r=-v'*sw/r-v*dsw/r=fscal*sw-v*dsw/r */
701 felec = felec*sw - rinv10*velec*dsw;
705 /* Calculate temporary vectorial force */
710 /* Update vectorial force */
714 f[j_coord_offset+DIM*0+XX] -= tx;
715 f[j_coord_offset+DIM*0+YY] -= ty;
716 f[j_coord_offset+DIM*0+ZZ] -= tz;
720 /**************************
721 * CALCULATE INTERACTIONS *
722 **************************/
731 /* EWALD ELECTROSTATICS */
733 /* Calculate Ewald table index by multiplying r with scale and truncate to integer */
734 ewrt = r20*ewtabscale;
738 felec = ewtab[ewitab]+eweps*ewtab[ewitab+1];
739 velec = qq20*(rinv20-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+felec)));
740 felec = qq20*rinv20*(rinvsq20-felec);
743 d = (d>0.0) ? d : 0.0;
745 sw = 1.0+d2*d*(swV3+d*(swV4+d*swV5));
747 dsw = d2*(swF2+d*(swF3+d*swF4));
749 /* Evaluate switch function */
750 /* fscal'=f'/r=-(v*sw)'/r=-(v'*sw+v*dsw)/r=-v'*sw/r-v*dsw/r=fscal*sw-v*dsw/r */
751 felec = felec*sw - rinv20*velec*dsw;
755 /* Calculate temporary vectorial force */
760 /* Update vectorial force */
764 f[j_coord_offset+DIM*0+XX] -= tx;
765 f[j_coord_offset+DIM*0+YY] -= ty;
766 f[j_coord_offset+DIM*0+ZZ] -= tz;
770 /* Inner loop uses 185 flops */
772 /* End of innermost loop */
775 f[i_coord_offset+DIM*0+XX] += fix0;
776 f[i_coord_offset+DIM*0+YY] += fiy0;
777 f[i_coord_offset+DIM*0+ZZ] += fiz0;
781 f[i_coord_offset+DIM*1+XX] += fix1;
782 f[i_coord_offset+DIM*1+YY] += fiy1;
783 f[i_coord_offset+DIM*1+ZZ] += fiz1;
787 f[i_coord_offset+DIM*2+XX] += fix2;
788 f[i_coord_offset+DIM*2+YY] += fiy2;
789 f[i_coord_offset+DIM*2+ZZ] += fiz2;
793 fshift[i_shift_offset+XX] += tx;
794 fshift[i_shift_offset+YY] += ty;
795 fshift[i_shift_offset+ZZ] += tz;
797 /* Increment number of inner iterations */
798 inneriter += j_index_end - j_index_start;
800 /* Outer loop uses 30 flops */
803 /* Increment number of outer iterations */
806 /* Update outer/inner flops */
808 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3_F,outeriter*30 + inneriter*185);