Bug Summary

File:gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecCoul_VdwBham_GeomW3W3_c.c
Location:line 613, column 5
Description:Value stored to 'gid' is never read

Annotated Source Code

1/*
2 * This file is part of the GROMACS molecular simulation package.
3 *
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.
8 *
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.
13 *
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.
18 *
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.
23 *
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.
31 *
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.
34 */
35/*
36 * Note: this file was generated by the GROMACS c kernel generator.
37 */
38#ifdef HAVE_CONFIG_H1
39#include <config.h>
40#endif
41
42#include <math.h>
43
44#include "../nb_kernel.h"
45#include "types/simple.h"
46#include "gromacs/math/vec.h"
47#include "nrnb.h"
48
49/*
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
55 */
56void
57nb_kernel_ElecCoul_VdwBham_GeomW3W3_VF_c
58 (t_nblist * gmx_restrict__restrict nlist,
59 rvec * gmx_restrict__restrict xx,
60 rvec * gmx_restrict__restrict ff,
61 t_forcerec * gmx_restrict__restrict fr,
62 t_mdatoms * gmx_restrict__restrict mdatoms,
63 nb_kernel_data_t gmx_unused__attribute__ ((unused)) * gmx_restrict__restrict kernel_data,
64 t_nrnb * gmx_restrict__restrict nrnb)
65{
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;
72 int vdwioffset0;
73 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
74 int vdwioffset1;
75 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
76 int vdwioffset2;
77 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
78 int vdwjidx0;
79 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
80 int vdwjidx1;
81 real jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
82 int vdwjidx2;
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;
94 real *charge;
95 int nvdwtype;
96 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
97 int *vdwtype;
98 real *vdwparam;
99
100 x = xx[0];
101 f = ff[0];
102
103 nri = nlist->nri;
104 iinr = nlist->iinr;
105 jindex = nlist->jindex;
106 jjnr = nlist->jjnr;
107 shiftidx = nlist->shift;
108 gid = nlist->gid;
109 shiftvec = fr->shift_vec[0];
110 fshift = fr->fshift[0];
111 facel = fr->epsfac;
112 charge = mdatoms->chargeA;
113 nvdwtype = fr->ntype;
114 vdwparam = fr->nbfp;
115 vdwtype = mdatoms->typeA;
116
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];
123
124 jq0 = charge[inr+0];
125 jq1 = charge[inr+1];
126 jq2 = charge[inr+2];
127 vdwjidx0 = 3*vdwtype[inr+0];
128 qq00 = iq0*jq0;
129 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
130 cexp1_00 = vdwparam[vdwioffset0+vdwjidx0+1];
131 cexp2_00 = vdwparam[vdwioffset0+vdwjidx0+2];
132 qq01 = iq0*jq1;
133 qq02 = iq0*jq2;
134 qq10 = iq1*jq0;
135 qq11 = iq1*jq1;
136 qq12 = iq1*jq2;
137 qq20 = iq2*jq0;
138 qq21 = iq2*jq1;
139 qq22 = iq2*jq2;
140
141 outeriter = 0;
142 inneriter = 0;
143
144 /* Start outer loop over neighborlists */
145 for(iidx=0; iidx<nri; iidx++)
146 {
147 /* Load shift vector for this list */
148 i_shift_offset = DIM3*shiftidx[iidx];
149 shX = shiftvec[i_shift_offset+XX0];
150 shY = shiftvec[i_shift_offset+YY1];
151 shZ = shiftvec[i_shift_offset+ZZ2];
152
153 /* Load limits for loop over neighbors */
154 j_index_start = jindex[iidx];
155 j_index_end = jindex[iidx+1];
156
157 /* Get outer coordinate index */
158 inr = iinr[iidx];
159 i_coord_offset = DIM3*inr;
160
161 /* Load i particle coords and add shift vector */
162 ix0 = shX + x[i_coord_offset+DIM3*0+XX0];
163 iy0 = shY + x[i_coord_offset+DIM3*0+YY1];
164 iz0 = shZ + x[i_coord_offset+DIM3*0+ZZ2];
165 ix1 = shX + x[i_coord_offset+DIM3*1+XX0];
166 iy1 = shY + x[i_coord_offset+DIM3*1+YY1];
167 iz1 = shZ + x[i_coord_offset+DIM3*1+ZZ2];
168 ix2 = shX + x[i_coord_offset+DIM3*2+XX0];
169 iy2 = shY + x[i_coord_offset+DIM3*2+YY1];
170 iz2 = shZ + x[i_coord_offset+DIM3*2+ZZ2];
171
172 fix0 = 0.0;
173 fiy0 = 0.0;
174 fiz0 = 0.0;
175 fix1 = 0.0;
176 fiy1 = 0.0;
177 fiz1 = 0.0;
178 fix2 = 0.0;
179 fiy2 = 0.0;
180 fiz2 = 0.0;
181
182 /* Reset potential sums */
183 velecsum = 0.0;
184 vvdwsum = 0.0;
185
186 /* Start inner kernel loop */
187 for(jidx=j_index_start; jidx<j_index_end; jidx++)
188 {
189 /* Get j neighbor index, and coordinate index */
190 jnr = jjnr[jidx];
191 j_coord_offset = DIM3*jnr;
192
193 /* load j atom coordinates */
194 jx0 = x[j_coord_offset+DIM3*0+XX0];
195 jy0 = x[j_coord_offset+DIM3*0+YY1];
196 jz0 = x[j_coord_offset+DIM3*0+ZZ2];
197 jx1 = x[j_coord_offset+DIM3*1+XX0];
198 jy1 = x[j_coord_offset+DIM3*1+YY1];
199 jz1 = x[j_coord_offset+DIM3*1+ZZ2];
200 jx2 = x[j_coord_offset+DIM3*2+XX0];
201 jy2 = x[j_coord_offset+DIM3*2+YY1];
202 jz2 = x[j_coord_offset+DIM3*2+ZZ2];
203
204 /* Calculate displacement vector */
205 dx00 = ix0 - jx0;
206 dy00 = iy0 - jy0;
207 dz00 = iz0 - jz0;
208 dx01 = ix0 - jx1;
209 dy01 = iy0 - jy1;
210 dz01 = iz0 - jz1;
211 dx02 = ix0 - jx2;
212 dy02 = iy0 - jy2;
213 dz02 = iz0 - jz2;
214 dx10 = ix1 - jx0;
215 dy10 = iy1 - jy0;
216 dz10 = iz1 - jz0;
217 dx11 = ix1 - jx1;
218 dy11 = iy1 - jy1;
219 dz11 = iz1 - jz1;
220 dx12 = ix1 - jx2;
221 dy12 = iy1 - jy2;
222 dz12 = iz1 - jz2;
223 dx20 = ix2 - jx0;
224 dy20 = iy2 - jy0;
225 dz20 = iz2 - jz0;
226 dx21 = ix2 - jx1;
227 dy21 = iy2 - jy1;
228 dz21 = iz2 - jz1;
229 dx22 = ix2 - jx2;
230 dy22 = iy2 - jy2;
231 dz22 = iz2 - jz2;
232
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;
243
244 rinv00 = gmx_invsqrt(rsq00)gmx_software_invsqrt(rsq00);
245 rinv01 = gmx_invsqrt(rsq01)gmx_software_invsqrt(rsq01);
246 rinv02 = gmx_invsqrt(rsq02)gmx_software_invsqrt(rsq02);
247 rinv10 = gmx_invsqrt(rsq10)gmx_software_invsqrt(rsq10);
248 rinv11 = gmx_invsqrt(rsq11)gmx_software_invsqrt(rsq11);
249 rinv12 = gmx_invsqrt(rsq12)gmx_software_invsqrt(rsq12);
250 rinv20 = gmx_invsqrt(rsq20)gmx_software_invsqrt(rsq20);
251 rinv21 = gmx_invsqrt(rsq21)gmx_software_invsqrt(rsq21);
252 rinv22 = gmx_invsqrt(rsq22)gmx_software_invsqrt(rsq22);
253
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;
263
264 /**************************
265 * CALCULATE INTERACTIONS *
266 **************************/
267
268 r00 = rsq00*rinv00;
269
270 /* COULOMB ELECTROSTATICS */
271 velec = qq00*rinv00;
272 felec = velec*rinvsq00;
273
274 /* BUCKINGHAM DISPERSION/REPULSION */
275 rinvsix = rinvsq00*rinvsq00*rinvsq00;
276 vvdw6 = c6_00*rinvsix;
277 br = cexp2_00*r00;
278 vvdwexp = cexp1_00*exp(-br);
279 vvdw = vvdwexp - vvdw6*(1.0/6.0);
280 fvdw = (br*vvdwexp-vvdw6)*rinvsq00;
281
282 /* Update potential sums from outer loop */
283 velecsum += velec;
284 vvdwsum += vvdw;
285
286 fscal = felec+fvdw;
287
288 /* Calculate temporary vectorial force */
289 tx = fscal*dx00;
290 ty = fscal*dy00;
291 tz = fscal*dz00;
292
293 /* Update vectorial force */
294 fix0 += tx;
295 fiy0 += ty;
296 fiz0 += tz;
297 f[j_coord_offset+DIM3*0+XX0] -= tx;
298 f[j_coord_offset+DIM3*0+YY1] -= ty;
299 f[j_coord_offset+DIM3*0+ZZ2] -= tz;
300
301 /**************************
302 * CALCULATE INTERACTIONS *
303 **************************/
304
305 /* COULOMB ELECTROSTATICS */
306 velec = qq01*rinv01;
307 felec = velec*rinvsq01;
308
309 /* Update potential sums from outer loop */
310 velecsum += velec;
311
312 fscal = felec;
313
314 /* Calculate temporary vectorial force */
315 tx = fscal*dx01;
316 ty = fscal*dy01;
317 tz = fscal*dz01;
318
319 /* Update vectorial force */
320 fix0 += tx;
321 fiy0 += ty;
322 fiz0 += tz;
323 f[j_coord_offset+DIM3*1+XX0] -= tx;
324 f[j_coord_offset+DIM3*1+YY1] -= ty;
325 f[j_coord_offset+DIM3*1+ZZ2] -= tz;
326
327 /**************************
328 * CALCULATE INTERACTIONS *
329 **************************/
330
331 /* COULOMB ELECTROSTATICS */
332 velec = qq02*rinv02;
333 felec = velec*rinvsq02;
334
335 /* Update potential sums from outer loop */
336 velecsum += velec;
337
338 fscal = felec;
339
340 /* Calculate temporary vectorial force */
341 tx = fscal*dx02;
342 ty = fscal*dy02;
343 tz = fscal*dz02;
344
345 /* Update vectorial force */
346 fix0 += tx;
347 fiy0 += ty;
348 fiz0 += tz;
349 f[j_coord_offset+DIM3*2+XX0] -= tx;
350 f[j_coord_offset+DIM3*2+YY1] -= ty;
351 f[j_coord_offset+DIM3*2+ZZ2] -= tz;
352
353 /**************************
354 * CALCULATE INTERACTIONS *
355 **************************/
356
357 /* COULOMB ELECTROSTATICS */
358 velec = qq10*rinv10;
359 felec = velec*rinvsq10;
360
361 /* Update potential sums from outer loop */
362 velecsum += velec;
363
364 fscal = felec;
365
366 /* Calculate temporary vectorial force */
367 tx = fscal*dx10;
368 ty = fscal*dy10;
369 tz = fscal*dz10;
370
371 /* Update vectorial force */
372 fix1 += tx;
373 fiy1 += ty;
374 fiz1 += tz;
375 f[j_coord_offset+DIM3*0+XX0] -= tx;
376 f[j_coord_offset+DIM3*0+YY1] -= ty;
377 f[j_coord_offset+DIM3*0+ZZ2] -= tz;
378
379 /**************************
380 * CALCULATE INTERACTIONS *
381 **************************/
382
383 /* COULOMB ELECTROSTATICS */
384 velec = qq11*rinv11;
385 felec = velec*rinvsq11;
386
387 /* Update potential sums from outer loop */
388 velecsum += velec;
389
390 fscal = felec;
391
392 /* Calculate temporary vectorial force */
393 tx = fscal*dx11;
394 ty = fscal*dy11;
395 tz = fscal*dz11;
396
397 /* Update vectorial force */
398 fix1 += tx;
399 fiy1 += ty;
400 fiz1 += tz;
401 f[j_coord_offset+DIM3*1+XX0] -= tx;
402 f[j_coord_offset+DIM3*1+YY1] -= ty;
403 f[j_coord_offset+DIM3*1+ZZ2] -= tz;
404
405 /**************************
406 * CALCULATE INTERACTIONS *
407 **************************/
408
409 /* COULOMB ELECTROSTATICS */
410 velec = qq12*rinv12;
411 felec = velec*rinvsq12;
412
413 /* Update potential sums from outer loop */
414 velecsum += velec;
415
416 fscal = felec;
417
418 /* Calculate temporary vectorial force */
419 tx = fscal*dx12;
420 ty = fscal*dy12;
421 tz = fscal*dz12;
422
423 /* Update vectorial force */
424 fix1 += tx;
425 fiy1 += ty;
426 fiz1 += tz;
427 f[j_coord_offset+DIM3*2+XX0] -= tx;
428 f[j_coord_offset+DIM3*2+YY1] -= ty;
429 f[j_coord_offset+DIM3*2+ZZ2] -= tz;
430
431 /**************************
432 * CALCULATE INTERACTIONS *
433 **************************/
434
435 /* COULOMB ELECTROSTATICS */
436 velec = qq20*rinv20;
437 felec = velec*rinvsq20;
438
439 /* Update potential sums from outer loop */
440 velecsum += velec;
441
442 fscal = felec;
443
444 /* Calculate temporary vectorial force */
445 tx = fscal*dx20;
446 ty = fscal*dy20;
447 tz = fscal*dz20;
448
449 /* Update vectorial force */
450 fix2 += tx;
451 fiy2 += ty;
452 fiz2 += tz;
453 f[j_coord_offset+DIM3*0+XX0] -= tx;
454 f[j_coord_offset+DIM3*0+YY1] -= ty;
455 f[j_coord_offset+DIM3*0+ZZ2] -= tz;
456
457 /**************************
458 * CALCULATE INTERACTIONS *
459 **************************/
460
461 /* COULOMB ELECTROSTATICS */
462 velec = qq21*rinv21;
463 felec = velec*rinvsq21;
464
465 /* Update potential sums from outer loop */
466 velecsum += velec;
467
468 fscal = felec;
469
470 /* Calculate temporary vectorial force */
471 tx = fscal*dx21;
472 ty = fscal*dy21;
473 tz = fscal*dz21;
474
475 /* Update vectorial force */
476 fix2 += tx;
477 fiy2 += ty;
478 fiz2 += tz;
479 f[j_coord_offset+DIM3*1+XX0] -= tx;
480 f[j_coord_offset+DIM3*1+YY1] -= ty;
481 f[j_coord_offset+DIM3*1+ZZ2] -= tz;
482
483 /**************************
484 * CALCULATE INTERACTIONS *
485 **************************/
486
487 /* COULOMB ELECTROSTATICS */
488 velec = qq22*rinv22;
489 felec = velec*rinvsq22;
490
491 /* Update potential sums from outer loop */
492 velecsum += velec;
493
494 fscal = felec;
495
496 /* Calculate temporary vectorial force */
497 tx = fscal*dx22;
498 ty = fscal*dy22;
499 tz = fscal*dz22;
500
501 /* Update vectorial force */
502 fix2 += tx;
503 fiy2 += ty;
504 fiz2 += tz;
505 f[j_coord_offset+DIM3*2+XX0] -= tx;
506 f[j_coord_offset+DIM3*2+YY1] -= ty;
507 f[j_coord_offset+DIM3*2+ZZ2] -= tz;
508
509 /* Inner loop uses 282 flops */
510 }
511 /* End of innermost loop */
512
513 tx = ty = tz = 0;
514 f[i_coord_offset+DIM3*0+XX0] += fix0;
515 f[i_coord_offset+DIM3*0+YY1] += fiy0;
516 f[i_coord_offset+DIM3*0+ZZ2] += fiz0;
517 tx += fix0;
518 ty += fiy0;
519 tz += fiz0;
520 f[i_coord_offset+DIM3*1+XX0] += fix1;
521 f[i_coord_offset+DIM3*1+YY1] += fiy1;
522 f[i_coord_offset+DIM3*1+ZZ2] += fiz1;
523 tx += fix1;
524 ty += fiy1;
525 tz += fiz1;
526 f[i_coord_offset+DIM3*2+XX0] += fix2;
527 f[i_coord_offset+DIM3*2+YY1] += fiy2;
528 f[i_coord_offset+DIM3*2+ZZ2] += fiz2;
529 tx += fix2;
530 ty += fiy2;
531 tz += fiz2;
532 fshift[i_shift_offset+XX0] += tx;
533 fshift[i_shift_offset+YY1] += ty;
534 fshift[i_shift_offset+ZZ2] += tz;
535
536 ggid = gid[iidx];
537 /* Update potential energies */
538 kernel_data->energygrp_elec[ggid] += velecsum;
539 kernel_data->energygrp_vdw[ggid] += vvdwsum;
540
541 /* Increment number of inner iterations */
542 inneriter += j_index_end - j_index_start;
543
544 /* Outer loop uses 32 flops */
545 }
546
547 /* Increment number of outer iterations */
548 outeriter += nri;
549
550 /* Update outer/inner flops */
551
552 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_VF,outeriter*32 + inneriter*282)(nrnb)->n[eNR_NBKERNEL_ELEC_VDW_W3W3_VF] += outeriter*32 +
inneriter*282
;
553}
554/*
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
560 */
561void
562nb_kernel_ElecCoul_VdwBham_GeomW3W3_F_c
563 (t_nblist * gmx_restrict__restrict nlist,
564 rvec * gmx_restrict__restrict xx,
565 rvec * gmx_restrict__restrict ff,
566 t_forcerec * gmx_restrict__restrict fr,
567 t_mdatoms * gmx_restrict__restrict mdatoms,
568 nb_kernel_data_t gmx_unused__attribute__ ((unused)) * gmx_restrict__restrict kernel_data,
569 t_nrnb * gmx_restrict__restrict nrnb)
570{
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;
577 int vdwioffset0;
578 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
579 int vdwioffset1;
580 real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1;
581 int vdwioffset2;
582 real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2;
583 int vdwjidx0;
584 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
585 int vdwjidx1;
586 real jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1;
587 int vdwjidx2;
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;
599 real *charge;
600 int nvdwtype;
601 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
602 int *vdwtype;
603 real *vdwparam;
604
605 x = xx[0];
606 f = ff[0];
607
608 nri = nlist->nri;
609 iinr = nlist->iinr;
610 jindex = nlist->jindex;
611 jjnr = nlist->jjnr;
612 shiftidx = nlist->shift;
613 gid = nlist->gid;
Value stored to 'gid' is never read
614 shiftvec = fr->shift_vec[0];
615 fshift = fr->fshift[0];
616 facel = fr->epsfac;
617 charge = mdatoms->chargeA;
618 nvdwtype = fr->ntype;
619 vdwparam = fr->nbfp;
620 vdwtype = mdatoms->typeA;
621
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];
628
629 jq0 = charge[inr+0];
630 jq1 = charge[inr+1];
631 jq2 = charge[inr+2];
632 vdwjidx0 = 3*vdwtype[inr+0];
633 qq00 = iq0*jq0;
634 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
635 cexp1_00 = vdwparam[vdwioffset0+vdwjidx0+1];
636 cexp2_00 = vdwparam[vdwioffset0+vdwjidx0+2];
637 qq01 = iq0*jq1;
638 qq02 = iq0*jq2;
639 qq10 = iq1*jq0;
640 qq11 = iq1*jq1;
641 qq12 = iq1*jq2;
642 qq20 = iq2*jq0;
643 qq21 = iq2*jq1;
644 qq22 = iq2*jq2;
645
646 outeriter = 0;
647 inneriter = 0;
648
649 /* Start outer loop over neighborlists */
650 for(iidx=0; iidx<nri; iidx++)
651 {
652 /* Load shift vector for this list */
653 i_shift_offset = DIM3*shiftidx[iidx];
654 shX = shiftvec[i_shift_offset+XX0];
655 shY = shiftvec[i_shift_offset+YY1];
656 shZ = shiftvec[i_shift_offset+ZZ2];
657
658 /* Load limits for loop over neighbors */
659 j_index_start = jindex[iidx];
660 j_index_end = jindex[iidx+1];
661
662 /* Get outer coordinate index */
663 inr = iinr[iidx];
664 i_coord_offset = DIM3*inr;
665
666 /* Load i particle coords and add shift vector */
667 ix0 = shX + x[i_coord_offset+DIM3*0+XX0];
668 iy0 = shY + x[i_coord_offset+DIM3*0+YY1];
669 iz0 = shZ + x[i_coord_offset+DIM3*0+ZZ2];
670 ix1 = shX + x[i_coord_offset+DIM3*1+XX0];
671 iy1 = shY + x[i_coord_offset+DIM3*1+YY1];
672 iz1 = shZ + x[i_coord_offset+DIM3*1+ZZ2];
673 ix2 = shX + x[i_coord_offset+DIM3*2+XX0];
674 iy2 = shY + x[i_coord_offset+DIM3*2+YY1];
675 iz2 = shZ + x[i_coord_offset+DIM3*2+ZZ2];
676
677 fix0 = 0.0;
678 fiy0 = 0.0;
679 fiz0 = 0.0;
680 fix1 = 0.0;
681 fiy1 = 0.0;
682 fiz1 = 0.0;
683 fix2 = 0.0;
684 fiy2 = 0.0;
685 fiz2 = 0.0;
686
687 /* Start inner kernel loop */
688 for(jidx=j_index_start; jidx<j_index_end; jidx++)
689 {
690 /* Get j neighbor index, and coordinate index */
691 jnr = jjnr[jidx];
692 j_coord_offset = DIM3*jnr;
693
694 /* load j atom coordinates */
695 jx0 = x[j_coord_offset+DIM3*0+XX0];
696 jy0 = x[j_coord_offset+DIM3*0+YY1];
697 jz0 = x[j_coord_offset+DIM3*0+ZZ2];
698 jx1 = x[j_coord_offset+DIM3*1+XX0];
699 jy1 = x[j_coord_offset+DIM3*1+YY1];
700 jz1 = x[j_coord_offset+DIM3*1+ZZ2];
701 jx2 = x[j_coord_offset+DIM3*2+XX0];
702 jy2 = x[j_coord_offset+DIM3*2+YY1];
703 jz2 = x[j_coord_offset+DIM3*2+ZZ2];
704
705 /* Calculate displacement vector */
706 dx00 = ix0 - jx0;
707 dy00 = iy0 - jy0;
708 dz00 = iz0 - jz0;
709 dx01 = ix0 - jx1;
710 dy01 = iy0 - jy1;
711 dz01 = iz0 - jz1;
712 dx02 = ix0 - jx2;
713 dy02 = iy0 - jy2;
714 dz02 = iz0 - jz2;
715 dx10 = ix1 - jx0;
716 dy10 = iy1 - jy0;
717 dz10 = iz1 - jz0;
718 dx11 = ix1 - jx1;
719 dy11 = iy1 - jy1;
720 dz11 = iz1 - jz1;
721 dx12 = ix1 - jx2;
722 dy12 = iy1 - jy2;
723 dz12 = iz1 - jz2;
724 dx20 = ix2 - jx0;
725 dy20 = iy2 - jy0;
726 dz20 = iz2 - jz0;
727 dx21 = ix2 - jx1;
728 dy21 = iy2 - jy1;
729 dz21 = iz2 - jz1;
730 dx22 = ix2 - jx2;
731 dy22 = iy2 - jy2;
732 dz22 = iz2 - jz2;
733
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;
744
745 rinv00 = gmx_invsqrt(rsq00)gmx_software_invsqrt(rsq00);
746 rinv01 = gmx_invsqrt(rsq01)gmx_software_invsqrt(rsq01);
747 rinv02 = gmx_invsqrt(rsq02)gmx_software_invsqrt(rsq02);
748 rinv10 = gmx_invsqrt(rsq10)gmx_software_invsqrt(rsq10);
749 rinv11 = gmx_invsqrt(rsq11)gmx_software_invsqrt(rsq11);
750 rinv12 = gmx_invsqrt(rsq12)gmx_software_invsqrt(rsq12);
751 rinv20 = gmx_invsqrt(rsq20)gmx_software_invsqrt(rsq20);
752 rinv21 = gmx_invsqrt(rsq21)gmx_software_invsqrt(rsq21);
753 rinv22 = gmx_invsqrt(rsq22)gmx_software_invsqrt(rsq22);
754
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;
764
765 /**************************
766 * CALCULATE INTERACTIONS *
767 **************************/
768
769 r00 = rsq00*rinv00;
770
771 /* COULOMB ELECTROSTATICS */
772 velec = qq00*rinv00;
773 felec = velec*rinvsq00;
774
775 /* BUCKINGHAM DISPERSION/REPULSION */
776 rinvsix = rinvsq00*rinvsq00*rinvsq00;
777 vvdw6 = c6_00*rinvsix;
778 br = cexp2_00*r00;
779 vvdwexp = cexp1_00*exp(-br);
780 fvdw = (br*vvdwexp-vvdw6)*rinvsq00;
781
782 fscal = felec+fvdw;
783
784 /* Calculate temporary vectorial force */
785 tx = fscal*dx00;
786 ty = fscal*dy00;
787 tz = fscal*dz00;
788
789 /* Update vectorial force */
790 fix0 += tx;
791 fiy0 += ty;
792 fiz0 += tz;
793 f[j_coord_offset+DIM3*0+XX0] -= tx;
794 f[j_coord_offset+DIM3*0+YY1] -= ty;
795 f[j_coord_offset+DIM3*0+ZZ2] -= tz;
796
797 /**************************
798 * CALCULATE INTERACTIONS *
799 **************************/
800
801 /* COULOMB ELECTROSTATICS */
802 velec = qq01*rinv01;
803 felec = velec*rinvsq01;
804
805 fscal = felec;
806
807 /* Calculate temporary vectorial force */
808 tx = fscal*dx01;
809 ty = fscal*dy01;
810 tz = fscal*dz01;
811
812 /* Update vectorial force */
813 fix0 += tx;
814 fiy0 += ty;
815 fiz0 += tz;
816 f[j_coord_offset+DIM3*1+XX0] -= tx;
817 f[j_coord_offset+DIM3*1+YY1] -= ty;
818 f[j_coord_offset+DIM3*1+ZZ2] -= tz;
819
820 /**************************
821 * CALCULATE INTERACTIONS *
822 **************************/
823
824 /* COULOMB ELECTROSTATICS */
825 velec = qq02*rinv02;
826 felec = velec*rinvsq02;
827
828 fscal = felec;
829
830 /* Calculate temporary vectorial force */
831 tx = fscal*dx02;
832 ty = fscal*dy02;
833 tz = fscal*dz02;
834
835 /* Update vectorial force */
836 fix0 += tx;
837 fiy0 += ty;
838 fiz0 += tz;
839 f[j_coord_offset+DIM3*2+XX0] -= tx;
840 f[j_coord_offset+DIM3*2+YY1] -= ty;
841 f[j_coord_offset+DIM3*2+ZZ2] -= tz;
842
843 /**************************
844 * CALCULATE INTERACTIONS *
845 **************************/
846
847 /* COULOMB ELECTROSTATICS */
848 velec = qq10*rinv10;
849 felec = velec*rinvsq10;
850
851 fscal = felec;
852
853 /* Calculate temporary vectorial force */
854 tx = fscal*dx10;
855 ty = fscal*dy10;
856 tz = fscal*dz10;
857
858 /* Update vectorial force */
859 fix1 += tx;
860 fiy1 += ty;
861 fiz1 += tz;
862 f[j_coord_offset+DIM3*0+XX0] -= tx;
863 f[j_coord_offset+DIM3*0+YY1] -= ty;
864 f[j_coord_offset+DIM3*0+ZZ2] -= tz;
865
866 /**************************
867 * CALCULATE INTERACTIONS *
868 **************************/
869
870 /* COULOMB ELECTROSTATICS */
871 velec = qq11*rinv11;
872 felec = velec*rinvsq11;
873
874 fscal = felec;
875
876 /* Calculate temporary vectorial force */
877 tx = fscal*dx11;
878 ty = fscal*dy11;
879 tz = fscal*dz11;
880
881 /* Update vectorial force */
882 fix1 += tx;
883 fiy1 += ty;
884 fiz1 += tz;
885 f[j_coord_offset+DIM3*1+XX0] -= tx;
886 f[j_coord_offset+DIM3*1+YY1] -= ty;
887 f[j_coord_offset+DIM3*1+ZZ2] -= tz;
888
889 /**************************
890 * CALCULATE INTERACTIONS *
891 **************************/
892
893 /* COULOMB ELECTROSTATICS */
894 velec = qq12*rinv12;
895 felec = velec*rinvsq12;
896
897 fscal = felec;
898
899 /* Calculate temporary vectorial force */
900 tx = fscal*dx12;
901 ty = fscal*dy12;
902 tz = fscal*dz12;
903
904 /* Update vectorial force */
905 fix1 += tx;
906 fiy1 += ty;
907 fiz1 += tz;
908 f[j_coord_offset+DIM3*2+XX0] -= tx;
909 f[j_coord_offset+DIM3*2+YY1] -= ty;
910 f[j_coord_offset+DIM3*2+ZZ2] -= tz;
911
912 /**************************
913 * CALCULATE INTERACTIONS *
914 **************************/
915
916 /* COULOMB ELECTROSTATICS */
917 velec = qq20*rinv20;
918 felec = velec*rinvsq20;
919
920 fscal = felec;
921
922 /* Calculate temporary vectorial force */
923 tx = fscal*dx20;
924 ty = fscal*dy20;
925 tz = fscal*dz20;
926
927 /* Update vectorial force */
928 fix2 += tx;
929 fiy2 += ty;
930 fiz2 += tz;
931 f[j_coord_offset+DIM3*0+XX0] -= tx;
932 f[j_coord_offset+DIM3*0+YY1] -= ty;
933 f[j_coord_offset+DIM3*0+ZZ2] -= tz;
934
935 /**************************
936 * CALCULATE INTERACTIONS *
937 **************************/
938
939 /* COULOMB ELECTROSTATICS */
940 velec = qq21*rinv21;
941 felec = velec*rinvsq21;
942
943 fscal = felec;
944
945 /* Calculate temporary vectorial force */
946 tx = fscal*dx21;
947 ty = fscal*dy21;
948 tz = fscal*dz21;
949
950 /* Update vectorial force */
951 fix2 += tx;
952 fiy2 += ty;
953 fiz2 += tz;
954 f[j_coord_offset+DIM3*1+XX0] -= tx;
955 f[j_coord_offset+DIM3*1+YY1] -= ty;
956 f[j_coord_offset+DIM3*1+ZZ2] -= tz;
957
958 /**************************
959 * CALCULATE INTERACTIONS *
960 **************************/
961
962 /* COULOMB ELECTROSTATICS */
963 velec = qq22*rinv22;
964 felec = velec*rinvsq22;
965
966 fscal = felec;
967
968 /* Calculate temporary vectorial force */
969 tx = fscal*dx22;
970 ty = fscal*dy22;
971 tz = fscal*dz22;
972
973 /* Update vectorial force */
974 fix2 += tx;
975 fiy2 += ty;
976 fiz2 += tz;
977 f[j_coord_offset+DIM3*2+XX0] -= tx;
978 f[j_coord_offset+DIM3*2+YY1] -= ty;
979 f[j_coord_offset+DIM3*2+ZZ2] -= tz;
980
981 /* Inner loop uses 270 flops */
982 }
983 /* End of innermost loop */
984
985 tx = ty = tz = 0;
986 f[i_coord_offset+DIM3*0+XX0] += fix0;
987 f[i_coord_offset+DIM3*0+YY1] += fiy0;
988 f[i_coord_offset+DIM3*0+ZZ2] += fiz0;
989 tx += fix0;
990 ty += fiy0;
991 tz += fiz0;
992 f[i_coord_offset+DIM3*1+XX0] += fix1;
993 f[i_coord_offset+DIM3*1+YY1] += fiy1;
994 f[i_coord_offset+DIM3*1+ZZ2] += fiz1;
995 tx += fix1;
996 ty += fiy1;
997 tz += fiz1;
998 f[i_coord_offset+DIM3*2+XX0] += fix2;
999 f[i_coord_offset+DIM3*2+YY1] += fiy2;
1000 f[i_coord_offset+DIM3*2+ZZ2] += fiz2;
1001 tx += fix2;
1002 ty += fiy2;
1003 tz += fiz2;
1004 fshift[i_shift_offset+XX0] += tx;
1005 fshift[i_shift_offset+YY1] += ty;
1006 fshift[i_shift_offset+ZZ2] += tz;
1007
1008 /* Increment number of inner iterations */
1009 inneriter += j_index_end - j_index_start;
1010
1011 /* Outer loop uses 30 flops */
1012 }
1013
1014 /* Increment number of outer iterations */
1015 outeriter += nri;
1016
1017 /* Update outer/inner flops */
1018
1019 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W3W3_F,outeriter*30 + inneriter*270)(nrnb)->n[eNR_NBKERNEL_ELEC_VDW_W3W3_F] += outeriter*30 + inneriter
*270
;
1020}