Bug Summary

File:gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_c.c
Location:line 334, column 5
Description:Value stored to 'crf' 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_ElecRFCut_VdwCSTab_GeomP1P1_VF_c
51 * Electrostatics interaction: ReactionField
52 * VdW interaction: CubicSplineTable
53 * Geometry: Particle-Particle
54 * Calculate force/pot: PotentialAndForce
55 */
56void
57nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_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 vdwjidx0;
75 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
76 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
77 real velec,felec,velecsum,facel,crf,krf,krf2;
78 real *charge;
79 int nvdwtype;
80 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
81 int *vdwtype;
82 real *vdwparam;
83 int vfitab;
84 real rt,vfeps,vftabscale,Y,F,Geps,Heps2,Fp,VV,FF;
85 real *vftab;
86
87 x = xx[0];
88 f = ff[0];
89
90 nri = nlist->nri;
91 iinr = nlist->iinr;
92 jindex = nlist->jindex;
93 jjnr = nlist->jjnr;
94 shiftidx = nlist->shift;
95 gid = nlist->gid;
96 shiftvec = fr->shift_vec[0];
97 fshift = fr->fshift[0];
98 facel = fr->epsfac;
99 charge = mdatoms->chargeA;
100 krf = fr->ic->k_rf;
101 krf2 = krf*2.0;
102 crf = fr->ic->c_rf;
103 nvdwtype = fr->ntype;
104 vdwparam = fr->nbfp;
105 vdwtype = mdatoms->typeA;
106
107 vftab = kernel_data->table_vdw->data;
108 vftabscale = kernel_data->table_vdw->scale;
109
110 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
111 rcutoff = fr->rcoulomb;
112 rcutoff2 = rcutoff*rcutoff;
113
114 outeriter = 0;
115 inneriter = 0;
116
117 /* Start outer loop over neighborlists */
118 for(iidx=0; iidx<nri; iidx++)
119 {
120 /* Load shift vector for this list */
121 i_shift_offset = DIM3*shiftidx[iidx];
122 shX = shiftvec[i_shift_offset+XX0];
123 shY = shiftvec[i_shift_offset+YY1];
124 shZ = shiftvec[i_shift_offset+ZZ2];
125
126 /* Load limits for loop over neighbors */
127 j_index_start = jindex[iidx];
128 j_index_end = jindex[iidx+1];
129
130 /* Get outer coordinate index */
131 inr = iinr[iidx];
132 i_coord_offset = DIM3*inr;
133
134 /* Load i particle coords and add shift vector */
135 ix0 = shX + x[i_coord_offset+DIM3*0+XX0];
136 iy0 = shY + x[i_coord_offset+DIM3*0+YY1];
137 iz0 = shZ + x[i_coord_offset+DIM3*0+ZZ2];
138
139 fix0 = 0.0;
140 fiy0 = 0.0;
141 fiz0 = 0.0;
142
143 /* Load parameters for i particles */
144 iq0 = facel*charge[inr+0];
145 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
146
147 /* Reset potential sums */
148 velecsum = 0.0;
149 vvdwsum = 0.0;
150
151 /* Start inner kernel loop */
152 for(jidx=j_index_start; jidx<j_index_end; jidx++)
153 {
154 /* Get j neighbor index, and coordinate index */
155 jnr = jjnr[jidx];
156 j_coord_offset = DIM3*jnr;
157
158 /* load j atom coordinates */
159 jx0 = x[j_coord_offset+DIM3*0+XX0];
160 jy0 = x[j_coord_offset+DIM3*0+YY1];
161 jz0 = x[j_coord_offset+DIM3*0+ZZ2];
162
163 /* Calculate displacement vector */
164 dx00 = ix0 - jx0;
165 dy00 = iy0 - jy0;
166 dz00 = iz0 - jz0;
167
168 /* Calculate squared distance and things based on it */
169 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
170
171 rinv00 = gmx_invsqrt(rsq00)gmx_software_invsqrt(rsq00);
172
173 rinvsq00 = rinv00*rinv00;
174
175 /* Load parameters for j particles */
176 jq0 = charge[jnr+0];
177 vdwjidx0 = 2*vdwtype[jnr+0];
178
179 /**************************
180 * CALCULATE INTERACTIONS *
181 **************************/
182
183 if (rsq00<rcutoff2)
184 {
185
186 r00 = rsq00*rinv00;
187
188 qq00 = iq0*jq0;
189 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
190 c12_00 = vdwparam[vdwioffset0+vdwjidx0+1];
191
192 /* Calculate table index by multiplying r with table scale and truncate to integer */
193 rt = r00*vftabscale;
194 vfitab = rt;
195 vfeps = rt-vfitab;
196 vfitab = 2*4*vfitab;
197
198 /* REACTION-FIELD ELECTROSTATICS */
199 velec = qq00*(rinv00+krf*rsq00-crf);
200 felec = qq00*(rinv00*rinvsq00-krf2);
201
202 /* CUBIC SPLINE TABLE DISPERSION */
203 vfitab += 0;
204 Y = vftab[vfitab];
205 F = vftab[vfitab+1];
206 Geps = vfeps*vftab[vfitab+2];
207 Heps2 = vfeps*vfeps*vftab[vfitab+3];
208 Fp = F+Geps+Heps2;
209 VV = Y+vfeps*Fp;
210 vvdw6 = c6_00*VV;
211 FF = Fp+Geps+2.0*Heps2;
212 fvdw6 = c6_00*FF;
213
214 /* CUBIC SPLINE TABLE REPULSION */
215 Y = vftab[vfitab+4];
216 F = vftab[vfitab+5];
217 Geps = vfeps*vftab[vfitab+6];
218 Heps2 = vfeps*vfeps*vftab[vfitab+7];
219 Fp = F+Geps+Heps2;
220 VV = Y+vfeps*Fp;
221 vvdw12 = c12_00*VV;
222 FF = Fp+Geps+2.0*Heps2;
223 fvdw12 = c12_00*FF;
224 vvdw = vvdw12+vvdw6;
225 fvdw = -(fvdw6+fvdw12)*vftabscale*rinv00;
226
227 /* Update potential sums from outer loop */
228 velecsum += velec;
229 vvdwsum += vvdw;
230
231 fscal = felec+fvdw;
232
233 /* Calculate temporary vectorial force */
234 tx = fscal*dx00;
235 ty = fscal*dy00;
236 tz = fscal*dz00;
237
238 /* Update vectorial force */
239 fix0 += tx;
240 fiy0 += ty;
241 fiz0 += tz;
242 f[j_coord_offset+DIM3*0+XX0] -= tx;
243 f[j_coord_offset+DIM3*0+YY1] -= ty;
244 f[j_coord_offset+DIM3*0+ZZ2] -= tz;
245
246 }
247
248 /* Inner loop uses 66 flops */
249 }
250 /* End of innermost loop */
251
252 tx = ty = tz = 0;
253 f[i_coord_offset+DIM3*0+XX0] += fix0;
254 f[i_coord_offset+DIM3*0+YY1] += fiy0;
255 f[i_coord_offset+DIM3*0+ZZ2] += fiz0;
256 tx += fix0;
257 ty += fiy0;
258 tz += fiz0;
259 fshift[i_shift_offset+XX0] += tx;
260 fshift[i_shift_offset+YY1] += ty;
261 fshift[i_shift_offset+ZZ2] += tz;
262
263 ggid = gid[iidx];
264 /* Update potential energies */
265 kernel_data->energygrp_elec[ggid] += velecsum;
266 kernel_data->energygrp_vdw[ggid] += vvdwsum;
267
268 /* Increment number of inner iterations */
269 inneriter += j_index_end - j_index_start;
270
271 /* Outer loop uses 15 flops */
272 }
273
274 /* Increment number of outer iterations */
275 outeriter += nri;
276
277 /* Update outer/inner flops */
278
279 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*15 + inneriter*66)(nrnb)->n[eNR_NBKERNEL_ELEC_VDW_VF] += outeriter*15 + inneriter
*66
;
280}
281/*
282 * Gromacs nonbonded kernel: nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_F_c
283 * Electrostatics interaction: ReactionField
284 * VdW interaction: CubicSplineTable
285 * Geometry: Particle-Particle
286 * Calculate force/pot: Force
287 */
288void
289nb_kernel_ElecRFCut_VdwCSTab_GeomP1P1_F_c
290 (t_nblist * gmx_restrict__restrict nlist,
291 rvec * gmx_restrict__restrict xx,
292 rvec * gmx_restrict__restrict ff,
293 t_forcerec * gmx_restrict__restrict fr,
294 t_mdatoms * gmx_restrict__restrict mdatoms,
295 nb_kernel_data_t gmx_unused__attribute__ ((unused)) * gmx_restrict__restrict kernel_data,
296 t_nrnb * gmx_restrict__restrict nrnb)
297{
298 int i_shift_offset,i_coord_offset,j_coord_offset;
299 int j_index_start,j_index_end;
300 int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
301 real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
302 int *iinr,*jindex,*jjnr,*shiftidx,*gid;
303 real *shiftvec,*fshift,*x,*f;
304 int vdwioffset0;
305 real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
306 int vdwjidx0;
307 real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
308 real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
309 real velec,felec,velecsum,facel,crf,krf,krf2;
310 real *charge;
311 int nvdwtype;
312 real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
313 int *vdwtype;
314 real *vdwparam;
315 int vfitab;
316 real rt,vfeps,vftabscale,Y,F,Geps,Heps2,Fp,VV,FF;
317 real *vftab;
318
319 x = xx[0];
320 f = ff[0];
321
322 nri = nlist->nri;
323 iinr = nlist->iinr;
324 jindex = nlist->jindex;
325 jjnr = nlist->jjnr;
326 shiftidx = nlist->shift;
327 gid = nlist->gid;
328 shiftvec = fr->shift_vec[0];
329 fshift = fr->fshift[0];
330 facel = fr->epsfac;
331 charge = mdatoms->chargeA;
332 krf = fr->ic->k_rf;
333 krf2 = krf*2.0;
334 crf = fr->ic->c_rf;
Value stored to 'crf' is never read
335 nvdwtype = fr->ntype;
336 vdwparam = fr->nbfp;
337 vdwtype = mdatoms->typeA;
338
339 vftab = kernel_data->table_vdw->data;
340 vftabscale = kernel_data->table_vdw->scale;
341
342 /* When we use explicit cutoffs the value must be identical for elec and VdW, so use elec as an arbitrary choice */
343 rcutoff = fr->rcoulomb;
344 rcutoff2 = rcutoff*rcutoff;
345
346 outeriter = 0;
347 inneriter = 0;
348
349 /* Start outer loop over neighborlists */
350 for(iidx=0; iidx<nri; iidx++)
351 {
352 /* Load shift vector for this list */
353 i_shift_offset = DIM3*shiftidx[iidx];
354 shX = shiftvec[i_shift_offset+XX0];
355 shY = shiftvec[i_shift_offset+YY1];
356 shZ = shiftvec[i_shift_offset+ZZ2];
357
358 /* Load limits for loop over neighbors */
359 j_index_start = jindex[iidx];
360 j_index_end = jindex[iidx+1];
361
362 /* Get outer coordinate index */
363 inr = iinr[iidx];
364 i_coord_offset = DIM3*inr;
365
366 /* Load i particle coords and add shift vector */
367 ix0 = shX + x[i_coord_offset+DIM3*0+XX0];
368 iy0 = shY + x[i_coord_offset+DIM3*0+YY1];
369 iz0 = shZ + x[i_coord_offset+DIM3*0+ZZ2];
370
371 fix0 = 0.0;
372 fiy0 = 0.0;
373 fiz0 = 0.0;
374
375 /* Load parameters for i particles */
376 iq0 = facel*charge[inr+0];
377 vdwioffset0 = 2*nvdwtype*vdwtype[inr+0];
378
379 /* Start inner kernel loop */
380 for(jidx=j_index_start; jidx<j_index_end; jidx++)
381 {
382 /* Get j neighbor index, and coordinate index */
383 jnr = jjnr[jidx];
384 j_coord_offset = DIM3*jnr;
385
386 /* load j atom coordinates */
387 jx0 = x[j_coord_offset+DIM3*0+XX0];
388 jy0 = x[j_coord_offset+DIM3*0+YY1];
389 jz0 = x[j_coord_offset+DIM3*0+ZZ2];
390
391 /* Calculate displacement vector */
392 dx00 = ix0 - jx0;
393 dy00 = iy0 - jy0;
394 dz00 = iz0 - jz0;
395
396 /* Calculate squared distance and things based on it */
397 rsq00 = dx00*dx00+dy00*dy00+dz00*dz00;
398
399 rinv00 = gmx_invsqrt(rsq00)gmx_software_invsqrt(rsq00);
400
401 rinvsq00 = rinv00*rinv00;
402
403 /* Load parameters for j particles */
404 jq0 = charge[jnr+0];
405 vdwjidx0 = 2*vdwtype[jnr+0];
406
407 /**************************
408 * CALCULATE INTERACTIONS *
409 **************************/
410
411 if (rsq00<rcutoff2)
412 {
413
414 r00 = rsq00*rinv00;
415
416 qq00 = iq0*jq0;
417 c6_00 = vdwparam[vdwioffset0+vdwjidx0];
418 c12_00 = vdwparam[vdwioffset0+vdwjidx0+1];
419
420 /* Calculate table index by multiplying r with table scale and truncate to integer */
421 rt = r00*vftabscale;
422 vfitab = rt;
423 vfeps = rt-vfitab;
424 vfitab = 2*4*vfitab;
425
426 /* REACTION-FIELD ELECTROSTATICS */
427 felec = qq00*(rinv00*rinvsq00-krf2);
428
429 /* CUBIC SPLINE TABLE DISPERSION */
430 vfitab += 0;
431 F = vftab[vfitab+1];
432 Geps = vfeps*vftab[vfitab+2];
433 Heps2 = vfeps*vfeps*vftab[vfitab+3];
434 Fp = F+Geps+Heps2;
435 FF = Fp+Geps+2.0*Heps2;
436 fvdw6 = c6_00*FF;
437
438 /* CUBIC SPLINE TABLE REPULSION */
439 F = vftab[vfitab+5];
440 Geps = vfeps*vftab[vfitab+6];
441 Heps2 = vfeps*vfeps*vftab[vfitab+7];
442 Fp = F+Geps+Heps2;
443 FF = Fp+Geps+2.0*Heps2;
444 fvdw12 = c12_00*FF;
445 fvdw = -(fvdw6+fvdw12)*vftabscale*rinv00;
446
447 fscal = felec+fvdw;
448
449 /* Calculate temporary vectorial force */
450 tx = fscal*dx00;
451 ty = fscal*dy00;
452 tz = fscal*dz00;
453
454 /* Update vectorial force */
455 fix0 += tx;
456 fiy0 += ty;
457 fiz0 += tz;
458 f[j_coord_offset+DIM3*0+XX0] -= tx;
459 f[j_coord_offset+DIM3*0+YY1] -= ty;
460 f[j_coord_offset+DIM3*0+ZZ2] -= tz;
461
462 }
463
464 /* Inner loop uses 53 flops */
465 }
466 /* End of innermost loop */
467
468 tx = ty = tz = 0;
469 f[i_coord_offset+DIM3*0+XX0] += fix0;
470 f[i_coord_offset+DIM3*0+YY1] += fiy0;
471 f[i_coord_offset+DIM3*0+ZZ2] += fiz0;
472 tx += fix0;
473 ty += fiy0;
474 tz += fiz0;
475 fshift[i_shift_offset+XX0] += tx;
476 fshift[i_shift_offset+YY1] += ty;
477 fshift[i_shift_offset+ZZ2] += tz;
478
479 /* Increment number of inner iterations */
480 inneriter += j_index_end - j_index_start;
481
482 /* Outer loop uses 13 flops */
483 }
484
485 /* Increment number of outer iterations */
486 outeriter += nri;
487
488 /* Update outer/inner flops */
489
490 inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*13 + inneriter*53)(nrnb)->n[eNR_NBKERNEL_ELEC_VDW_F] += outeriter*13 + inneriter
*53
;
491}