File: | gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecRF_VdwBham_GeomW4W4_c.c |
Location: | line 675, column 5 |
Description: | Value stored to 'crf' is never read |
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_ElecRF_VdwBham_GeomW4W4_VF_c |
51 | * Electrostatics interaction: ReactionField |
52 | * VdW interaction: Buckingham |
53 | * Geometry: Water4-Water4 |
54 | * Calculate force/pot: PotentialAndForce |
55 | */ |
56 | void |
57 | nb_kernel_ElecRF_VdwBham_GeomW4W4_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 vdwioffset3; |
79 | real ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3; |
80 | int vdwjidx0; |
81 | real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0; |
82 | int vdwjidx1; |
83 | real jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1; |
84 | int vdwjidx2; |
85 | real jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2; |
86 | int vdwjidx3; |
87 | real jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3; |
88 | real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00; |
89 | real dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11; |
90 | real dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12; |
91 | real dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13,cexp1_13,cexp2_13; |
92 | real dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21; |
93 | real dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22; |
94 | real dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23,cexp1_23,cexp2_23; |
95 | real dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31,cexp1_31,cexp2_31; |
96 | real dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32,cexp1_32,cexp2_32; |
97 | real dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33,cexp1_33,cexp2_33; |
98 | real velec,felec,velecsum,facel,crf,krf,krf2; |
99 | real *charge; |
100 | int nvdwtype; |
101 | real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6; |
102 | int *vdwtype; |
103 | real *vdwparam; |
104 | |
105 | x = xx[0]; |
106 | f = ff[0]; |
107 | |
108 | nri = nlist->nri; |
109 | iinr = nlist->iinr; |
110 | jindex = nlist->jindex; |
111 | jjnr = nlist->jjnr; |
112 | shiftidx = nlist->shift; |
113 | gid = nlist->gid; |
114 | shiftvec = fr->shift_vec[0]; |
115 | fshift = fr->fshift[0]; |
116 | facel = fr->epsfac; |
117 | charge = mdatoms->chargeA; |
118 | krf = fr->ic->k_rf; |
119 | krf2 = krf*2.0; |
120 | crf = fr->ic->c_rf; |
121 | nvdwtype = fr->ntype; |
122 | vdwparam = fr->nbfp; |
123 | vdwtype = mdatoms->typeA; |
124 | |
125 | /* Setup water-specific parameters */ |
126 | inr = nlist->iinr[0]; |
127 | iq1 = facel*charge[inr+1]; |
128 | iq2 = facel*charge[inr+2]; |
129 | iq3 = facel*charge[inr+3]; |
130 | vdwioffset0 = 3*nvdwtype*vdwtype[inr+0]; |
131 | |
132 | jq1 = charge[inr+1]; |
133 | jq2 = charge[inr+2]; |
134 | jq3 = charge[inr+3]; |
135 | vdwjidx0 = 3*vdwtype[inr+0]; |
136 | c6_00 = vdwparam[vdwioffset0+vdwjidx0]; |
137 | cexp1_00 = vdwparam[vdwioffset0+vdwjidx0+1]; |
138 | cexp2_00 = vdwparam[vdwioffset0+vdwjidx0+2]; |
139 | qq11 = iq1*jq1; |
140 | qq12 = iq1*jq2; |
141 | qq13 = iq1*jq3; |
142 | qq21 = iq2*jq1; |
143 | qq22 = iq2*jq2; |
144 | qq23 = iq2*jq3; |
145 | qq31 = iq3*jq1; |
146 | qq32 = iq3*jq2; |
147 | qq33 = iq3*jq3; |
148 | |
149 | outeriter = 0; |
150 | inneriter = 0; |
151 | |
152 | /* Start outer loop over neighborlists */ |
153 | for(iidx=0; iidx<nri; iidx++) |
154 | { |
155 | /* Load shift vector for this list */ |
156 | i_shift_offset = DIM3*shiftidx[iidx]; |
157 | shX = shiftvec[i_shift_offset+XX0]; |
158 | shY = shiftvec[i_shift_offset+YY1]; |
159 | shZ = shiftvec[i_shift_offset+ZZ2]; |
160 | |
161 | /* Load limits for loop over neighbors */ |
162 | j_index_start = jindex[iidx]; |
163 | j_index_end = jindex[iidx+1]; |
164 | |
165 | /* Get outer coordinate index */ |
166 | inr = iinr[iidx]; |
167 | i_coord_offset = DIM3*inr; |
168 | |
169 | /* Load i particle coords and add shift vector */ |
170 | ix0 = shX + x[i_coord_offset+DIM3*0+XX0]; |
171 | iy0 = shY + x[i_coord_offset+DIM3*0+YY1]; |
172 | iz0 = shZ + x[i_coord_offset+DIM3*0+ZZ2]; |
173 | ix1 = shX + x[i_coord_offset+DIM3*1+XX0]; |
174 | iy1 = shY + x[i_coord_offset+DIM3*1+YY1]; |
175 | iz1 = shZ + x[i_coord_offset+DIM3*1+ZZ2]; |
176 | ix2 = shX + x[i_coord_offset+DIM3*2+XX0]; |
177 | iy2 = shY + x[i_coord_offset+DIM3*2+YY1]; |
178 | iz2 = shZ + x[i_coord_offset+DIM3*2+ZZ2]; |
179 | ix3 = shX + x[i_coord_offset+DIM3*3+XX0]; |
180 | iy3 = shY + x[i_coord_offset+DIM3*3+YY1]; |
181 | iz3 = shZ + x[i_coord_offset+DIM3*3+ZZ2]; |
182 | |
183 | fix0 = 0.0; |
184 | fiy0 = 0.0; |
185 | fiz0 = 0.0; |
186 | fix1 = 0.0; |
187 | fiy1 = 0.0; |
188 | fiz1 = 0.0; |
189 | fix2 = 0.0; |
190 | fiy2 = 0.0; |
191 | fiz2 = 0.0; |
192 | fix3 = 0.0; |
193 | fiy3 = 0.0; |
194 | fiz3 = 0.0; |
195 | |
196 | /* Reset potential sums */ |
197 | velecsum = 0.0; |
198 | vvdwsum = 0.0; |
199 | |
200 | /* Start inner kernel loop */ |
201 | for(jidx=j_index_start; jidx<j_index_end; jidx++) |
202 | { |
203 | /* Get j neighbor index, and coordinate index */ |
204 | jnr = jjnr[jidx]; |
205 | j_coord_offset = DIM3*jnr; |
206 | |
207 | /* load j atom coordinates */ |
208 | jx0 = x[j_coord_offset+DIM3*0+XX0]; |
209 | jy0 = x[j_coord_offset+DIM3*0+YY1]; |
210 | jz0 = x[j_coord_offset+DIM3*0+ZZ2]; |
211 | jx1 = x[j_coord_offset+DIM3*1+XX0]; |
212 | jy1 = x[j_coord_offset+DIM3*1+YY1]; |
213 | jz1 = x[j_coord_offset+DIM3*1+ZZ2]; |
214 | jx2 = x[j_coord_offset+DIM3*2+XX0]; |
215 | jy2 = x[j_coord_offset+DIM3*2+YY1]; |
216 | jz2 = x[j_coord_offset+DIM3*2+ZZ2]; |
217 | jx3 = x[j_coord_offset+DIM3*3+XX0]; |
218 | jy3 = x[j_coord_offset+DIM3*3+YY1]; |
219 | jz3 = x[j_coord_offset+DIM3*3+ZZ2]; |
220 | |
221 | /* Calculate displacement vector */ |
222 | dx00 = ix0 - jx0; |
223 | dy00 = iy0 - jy0; |
224 | dz00 = iz0 - jz0; |
225 | dx11 = ix1 - jx1; |
226 | dy11 = iy1 - jy1; |
227 | dz11 = iz1 - jz1; |
228 | dx12 = ix1 - jx2; |
229 | dy12 = iy1 - jy2; |
230 | dz12 = iz1 - jz2; |
231 | dx13 = ix1 - jx3; |
232 | dy13 = iy1 - jy3; |
233 | dz13 = iz1 - jz3; |
234 | dx21 = ix2 - jx1; |
235 | dy21 = iy2 - jy1; |
236 | dz21 = iz2 - jz1; |
237 | dx22 = ix2 - jx2; |
238 | dy22 = iy2 - jy2; |
239 | dz22 = iz2 - jz2; |
240 | dx23 = ix2 - jx3; |
241 | dy23 = iy2 - jy3; |
242 | dz23 = iz2 - jz3; |
243 | dx31 = ix3 - jx1; |
244 | dy31 = iy3 - jy1; |
245 | dz31 = iz3 - jz1; |
246 | dx32 = ix3 - jx2; |
247 | dy32 = iy3 - jy2; |
248 | dz32 = iz3 - jz2; |
249 | dx33 = ix3 - jx3; |
250 | dy33 = iy3 - jy3; |
251 | dz33 = iz3 - jz3; |
252 | |
253 | /* Calculate squared distance and things based on it */ |
254 | rsq00 = dx00*dx00+dy00*dy00+dz00*dz00; |
255 | rsq11 = dx11*dx11+dy11*dy11+dz11*dz11; |
256 | rsq12 = dx12*dx12+dy12*dy12+dz12*dz12; |
257 | rsq13 = dx13*dx13+dy13*dy13+dz13*dz13; |
258 | rsq21 = dx21*dx21+dy21*dy21+dz21*dz21; |
259 | rsq22 = dx22*dx22+dy22*dy22+dz22*dz22; |
260 | rsq23 = dx23*dx23+dy23*dy23+dz23*dz23; |
261 | rsq31 = dx31*dx31+dy31*dy31+dz31*dz31; |
262 | rsq32 = dx32*dx32+dy32*dy32+dz32*dz32; |
263 | rsq33 = dx33*dx33+dy33*dy33+dz33*dz33; |
264 | |
265 | rinv00 = gmx_invsqrt(rsq00)gmx_software_invsqrt(rsq00); |
266 | rinv11 = gmx_invsqrt(rsq11)gmx_software_invsqrt(rsq11); |
267 | rinv12 = gmx_invsqrt(rsq12)gmx_software_invsqrt(rsq12); |
268 | rinv13 = gmx_invsqrt(rsq13)gmx_software_invsqrt(rsq13); |
269 | rinv21 = gmx_invsqrt(rsq21)gmx_software_invsqrt(rsq21); |
270 | rinv22 = gmx_invsqrt(rsq22)gmx_software_invsqrt(rsq22); |
271 | rinv23 = gmx_invsqrt(rsq23)gmx_software_invsqrt(rsq23); |
272 | rinv31 = gmx_invsqrt(rsq31)gmx_software_invsqrt(rsq31); |
273 | rinv32 = gmx_invsqrt(rsq32)gmx_software_invsqrt(rsq32); |
274 | rinv33 = gmx_invsqrt(rsq33)gmx_software_invsqrt(rsq33); |
275 | |
276 | rinvsq00 = rinv00*rinv00; |
277 | rinvsq11 = rinv11*rinv11; |
278 | rinvsq12 = rinv12*rinv12; |
279 | rinvsq13 = rinv13*rinv13; |
280 | rinvsq21 = rinv21*rinv21; |
281 | rinvsq22 = rinv22*rinv22; |
282 | rinvsq23 = rinv23*rinv23; |
283 | rinvsq31 = rinv31*rinv31; |
284 | rinvsq32 = rinv32*rinv32; |
285 | rinvsq33 = rinv33*rinv33; |
286 | |
287 | /************************** |
288 | * CALCULATE INTERACTIONS * |
289 | **************************/ |
290 | |
291 | r00 = rsq00*rinv00; |
292 | |
293 | /* BUCKINGHAM DISPERSION/REPULSION */ |
294 | rinvsix = rinvsq00*rinvsq00*rinvsq00; |
295 | vvdw6 = c6_00*rinvsix; |
296 | br = cexp2_00*r00; |
297 | vvdwexp = cexp1_00*exp(-br); |
298 | vvdw = vvdwexp - vvdw6*(1.0/6.0); |
299 | fvdw = (br*vvdwexp-vvdw6)*rinvsq00; |
300 | |
301 | /* Update potential sums from outer loop */ |
302 | vvdwsum += vvdw; |
303 | |
304 | fscal = fvdw; |
305 | |
306 | /* Calculate temporary vectorial force */ |
307 | tx = fscal*dx00; |
308 | ty = fscal*dy00; |
309 | tz = fscal*dz00; |
310 | |
311 | /* Update vectorial force */ |
312 | fix0 += tx; |
313 | fiy0 += ty; |
314 | fiz0 += tz; |
315 | f[j_coord_offset+DIM3*0+XX0] -= tx; |
316 | f[j_coord_offset+DIM3*0+YY1] -= ty; |
317 | f[j_coord_offset+DIM3*0+ZZ2] -= tz; |
318 | |
319 | /************************** |
320 | * CALCULATE INTERACTIONS * |
321 | **************************/ |
322 | |
323 | /* REACTION-FIELD ELECTROSTATICS */ |
324 | velec = qq11*(rinv11+krf*rsq11-crf); |
325 | felec = qq11*(rinv11*rinvsq11-krf2); |
326 | |
327 | /* Update potential sums from outer loop */ |
328 | velecsum += velec; |
329 | |
330 | fscal = felec; |
331 | |
332 | /* Calculate temporary vectorial force */ |
333 | tx = fscal*dx11; |
334 | ty = fscal*dy11; |
335 | tz = fscal*dz11; |
336 | |
337 | /* Update vectorial force */ |
338 | fix1 += tx; |
339 | fiy1 += ty; |
340 | fiz1 += tz; |
341 | f[j_coord_offset+DIM3*1+XX0] -= tx; |
342 | f[j_coord_offset+DIM3*1+YY1] -= ty; |
343 | f[j_coord_offset+DIM3*1+ZZ2] -= tz; |
344 | |
345 | /************************** |
346 | * CALCULATE INTERACTIONS * |
347 | **************************/ |
348 | |
349 | /* REACTION-FIELD ELECTROSTATICS */ |
350 | velec = qq12*(rinv12+krf*rsq12-crf); |
351 | felec = qq12*(rinv12*rinvsq12-krf2); |
352 | |
353 | /* Update potential sums from outer loop */ |
354 | velecsum += velec; |
355 | |
356 | fscal = felec; |
357 | |
358 | /* Calculate temporary vectorial force */ |
359 | tx = fscal*dx12; |
360 | ty = fscal*dy12; |
361 | tz = fscal*dz12; |
362 | |
363 | /* Update vectorial force */ |
364 | fix1 += tx; |
365 | fiy1 += ty; |
366 | fiz1 += tz; |
367 | f[j_coord_offset+DIM3*2+XX0] -= tx; |
368 | f[j_coord_offset+DIM3*2+YY1] -= ty; |
369 | f[j_coord_offset+DIM3*2+ZZ2] -= tz; |
370 | |
371 | /************************** |
372 | * CALCULATE INTERACTIONS * |
373 | **************************/ |
374 | |
375 | /* REACTION-FIELD ELECTROSTATICS */ |
376 | velec = qq13*(rinv13+krf*rsq13-crf); |
377 | felec = qq13*(rinv13*rinvsq13-krf2); |
378 | |
379 | /* Update potential sums from outer loop */ |
380 | velecsum += velec; |
381 | |
382 | fscal = felec; |
383 | |
384 | /* Calculate temporary vectorial force */ |
385 | tx = fscal*dx13; |
386 | ty = fscal*dy13; |
387 | tz = fscal*dz13; |
388 | |
389 | /* Update vectorial force */ |
390 | fix1 += tx; |
391 | fiy1 += ty; |
392 | fiz1 += tz; |
393 | f[j_coord_offset+DIM3*3+XX0] -= tx; |
394 | f[j_coord_offset+DIM3*3+YY1] -= ty; |
395 | f[j_coord_offset+DIM3*3+ZZ2] -= tz; |
396 | |
397 | /************************** |
398 | * CALCULATE INTERACTIONS * |
399 | **************************/ |
400 | |
401 | /* REACTION-FIELD ELECTROSTATICS */ |
402 | velec = qq21*(rinv21+krf*rsq21-crf); |
403 | felec = qq21*(rinv21*rinvsq21-krf2); |
404 | |
405 | /* Update potential sums from outer loop */ |
406 | velecsum += velec; |
407 | |
408 | fscal = felec; |
409 | |
410 | /* Calculate temporary vectorial force */ |
411 | tx = fscal*dx21; |
412 | ty = fscal*dy21; |
413 | tz = fscal*dz21; |
414 | |
415 | /* Update vectorial force */ |
416 | fix2 += tx; |
417 | fiy2 += ty; |
418 | fiz2 += tz; |
419 | f[j_coord_offset+DIM3*1+XX0] -= tx; |
420 | f[j_coord_offset+DIM3*1+YY1] -= ty; |
421 | f[j_coord_offset+DIM3*1+ZZ2] -= tz; |
422 | |
423 | /************************** |
424 | * CALCULATE INTERACTIONS * |
425 | **************************/ |
426 | |
427 | /* REACTION-FIELD ELECTROSTATICS */ |
428 | velec = qq22*(rinv22+krf*rsq22-crf); |
429 | felec = qq22*(rinv22*rinvsq22-krf2); |
430 | |
431 | /* Update potential sums from outer loop */ |
432 | velecsum += velec; |
433 | |
434 | fscal = felec; |
435 | |
436 | /* Calculate temporary vectorial force */ |
437 | tx = fscal*dx22; |
438 | ty = fscal*dy22; |
439 | tz = fscal*dz22; |
440 | |
441 | /* Update vectorial force */ |
442 | fix2 += tx; |
443 | fiy2 += ty; |
444 | fiz2 += tz; |
445 | f[j_coord_offset+DIM3*2+XX0] -= tx; |
446 | f[j_coord_offset+DIM3*2+YY1] -= ty; |
447 | f[j_coord_offset+DIM3*2+ZZ2] -= tz; |
448 | |
449 | /************************** |
450 | * CALCULATE INTERACTIONS * |
451 | **************************/ |
452 | |
453 | /* REACTION-FIELD ELECTROSTATICS */ |
454 | velec = qq23*(rinv23+krf*rsq23-crf); |
455 | felec = qq23*(rinv23*rinvsq23-krf2); |
456 | |
457 | /* Update potential sums from outer loop */ |
458 | velecsum += velec; |
459 | |
460 | fscal = felec; |
461 | |
462 | /* Calculate temporary vectorial force */ |
463 | tx = fscal*dx23; |
464 | ty = fscal*dy23; |
465 | tz = fscal*dz23; |
466 | |
467 | /* Update vectorial force */ |
468 | fix2 += tx; |
469 | fiy2 += ty; |
470 | fiz2 += tz; |
471 | f[j_coord_offset+DIM3*3+XX0] -= tx; |
472 | f[j_coord_offset+DIM3*3+YY1] -= ty; |
473 | f[j_coord_offset+DIM3*3+ZZ2] -= tz; |
474 | |
475 | /************************** |
476 | * CALCULATE INTERACTIONS * |
477 | **************************/ |
478 | |
479 | /* REACTION-FIELD ELECTROSTATICS */ |
480 | velec = qq31*(rinv31+krf*rsq31-crf); |
481 | felec = qq31*(rinv31*rinvsq31-krf2); |
482 | |
483 | /* Update potential sums from outer loop */ |
484 | velecsum += velec; |
485 | |
486 | fscal = felec; |
487 | |
488 | /* Calculate temporary vectorial force */ |
489 | tx = fscal*dx31; |
490 | ty = fscal*dy31; |
491 | tz = fscal*dz31; |
492 | |
493 | /* Update vectorial force */ |
494 | fix3 += tx; |
495 | fiy3 += ty; |
496 | fiz3 += tz; |
497 | f[j_coord_offset+DIM3*1+XX0] -= tx; |
498 | f[j_coord_offset+DIM3*1+YY1] -= ty; |
499 | f[j_coord_offset+DIM3*1+ZZ2] -= tz; |
500 | |
501 | /************************** |
502 | * CALCULATE INTERACTIONS * |
503 | **************************/ |
504 | |
505 | /* REACTION-FIELD ELECTROSTATICS */ |
506 | velec = qq32*(rinv32+krf*rsq32-crf); |
507 | felec = qq32*(rinv32*rinvsq32-krf2); |
508 | |
509 | /* Update potential sums from outer loop */ |
510 | velecsum += velec; |
511 | |
512 | fscal = felec; |
513 | |
514 | /* Calculate temporary vectorial force */ |
515 | tx = fscal*dx32; |
516 | ty = fscal*dy32; |
517 | tz = fscal*dz32; |
518 | |
519 | /* Update vectorial force */ |
520 | fix3 += tx; |
521 | fiy3 += ty; |
522 | fiz3 += tz; |
523 | f[j_coord_offset+DIM3*2+XX0] -= tx; |
524 | f[j_coord_offset+DIM3*2+YY1] -= ty; |
525 | f[j_coord_offset+DIM3*2+ZZ2] -= tz; |
526 | |
527 | /************************** |
528 | * CALCULATE INTERACTIONS * |
529 | **************************/ |
530 | |
531 | /* REACTION-FIELD ELECTROSTATICS */ |
532 | velec = qq33*(rinv33+krf*rsq33-crf); |
533 | felec = qq33*(rinv33*rinvsq33-krf2); |
534 | |
535 | /* Update potential sums from outer loop */ |
536 | velecsum += velec; |
537 | |
538 | fscal = felec; |
539 | |
540 | /* Calculate temporary vectorial force */ |
541 | tx = fscal*dx33; |
542 | ty = fscal*dy33; |
543 | tz = fscal*dz33; |
544 | |
545 | /* Update vectorial force */ |
546 | fix3 += tx; |
547 | fiy3 += ty; |
548 | fiz3 += tz; |
549 | f[j_coord_offset+DIM3*3+XX0] -= tx; |
550 | f[j_coord_offset+DIM3*3+YY1] -= ty; |
551 | f[j_coord_offset+DIM3*3+ZZ2] -= tz; |
552 | |
553 | /* Inner loop uses 340 flops */ |
554 | } |
555 | /* End of innermost loop */ |
556 | |
557 | tx = ty = tz = 0; |
558 | f[i_coord_offset+DIM3*0+XX0] += fix0; |
559 | f[i_coord_offset+DIM3*0+YY1] += fiy0; |
560 | f[i_coord_offset+DIM3*0+ZZ2] += fiz0; |
561 | tx += fix0; |
562 | ty += fiy0; |
563 | tz += fiz0; |
564 | f[i_coord_offset+DIM3*1+XX0] += fix1; |
565 | f[i_coord_offset+DIM3*1+YY1] += fiy1; |
566 | f[i_coord_offset+DIM3*1+ZZ2] += fiz1; |
567 | tx += fix1; |
568 | ty += fiy1; |
569 | tz += fiz1; |
570 | f[i_coord_offset+DIM3*2+XX0] += fix2; |
571 | f[i_coord_offset+DIM3*2+YY1] += fiy2; |
572 | f[i_coord_offset+DIM3*2+ZZ2] += fiz2; |
573 | tx += fix2; |
574 | ty += fiy2; |
575 | tz += fiz2; |
576 | f[i_coord_offset+DIM3*3+XX0] += fix3; |
577 | f[i_coord_offset+DIM3*3+YY1] += fiy3; |
578 | f[i_coord_offset+DIM3*3+ZZ2] += fiz3; |
579 | tx += fix3; |
580 | ty += fiy3; |
581 | tz += fiz3; |
582 | fshift[i_shift_offset+XX0] += tx; |
583 | fshift[i_shift_offset+YY1] += ty; |
584 | fshift[i_shift_offset+ZZ2] += tz; |
585 | |
586 | ggid = gid[iidx]; |
587 | /* Update potential energies */ |
588 | kernel_data->energygrp_elec[ggid] += velecsum; |
589 | kernel_data->energygrp_vdw[ggid] += vvdwsum; |
590 | |
591 | /* Increment number of inner iterations */ |
592 | inneriter += j_index_end - j_index_start; |
593 | |
594 | /* Outer loop uses 41 flops */ |
595 | } |
596 | |
597 | /* Increment number of outer iterations */ |
598 | outeriter += nri; |
599 | |
600 | /* Update outer/inner flops */ |
601 | |
602 | inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4W4_VF,outeriter*41 + inneriter*340)(nrnb)->n[eNR_NBKERNEL_ELEC_VDW_W4W4_VF] += outeriter*41 + inneriter*340; |
603 | } |
604 | /* |
605 | * Gromacs nonbonded kernel: nb_kernel_ElecRF_VdwBham_GeomW4W4_F_c |
606 | * Electrostatics interaction: ReactionField |
607 | * VdW interaction: Buckingham |
608 | * Geometry: Water4-Water4 |
609 | * Calculate force/pot: Force |
610 | */ |
611 | void |
612 | nb_kernel_ElecRF_VdwBham_GeomW4W4_F_c |
613 | (t_nblist * gmx_restrict__restrict nlist, |
614 | rvec * gmx_restrict__restrict xx, |
615 | rvec * gmx_restrict__restrict ff, |
616 | t_forcerec * gmx_restrict__restrict fr, |
617 | t_mdatoms * gmx_restrict__restrict mdatoms, |
618 | nb_kernel_data_t gmx_unused__attribute__ ((unused)) * gmx_restrict__restrict kernel_data, |
619 | t_nrnb * gmx_restrict__restrict nrnb) |
620 | { |
621 | int i_shift_offset,i_coord_offset,j_coord_offset; |
622 | int j_index_start,j_index_end; |
623 | int nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter; |
624 | real shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2; |
625 | int *iinr,*jindex,*jjnr,*shiftidx,*gid; |
626 | real *shiftvec,*fshift,*x,*f; |
627 | int vdwioffset0; |
628 | real ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0; |
629 | int vdwioffset1; |
630 | real ix1,iy1,iz1,fix1,fiy1,fiz1,iq1,isai1; |
631 | int vdwioffset2; |
632 | real ix2,iy2,iz2,fix2,fiy2,fiz2,iq2,isai2; |
633 | int vdwioffset3; |
634 | real ix3,iy3,iz3,fix3,fiy3,fiz3,iq3,isai3; |
635 | int vdwjidx0; |
636 | real jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0; |
637 | int vdwjidx1; |
638 | real jx1,jy1,jz1,fjx1,fjy1,fjz1,jq1,isaj1; |
639 | int vdwjidx2; |
640 | real jx2,jy2,jz2,fjx2,fjy2,fjz2,jq2,isaj2; |
641 | int vdwjidx3; |
642 | real jx3,jy3,jz3,fjx3,fjy3,fjz3,jq3,isaj3; |
643 | real dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00; |
644 | real dx11,dy11,dz11,rsq11,rinv11,rinvsq11,r11,qq11,c6_11,c12_11,cexp1_11,cexp2_11; |
645 | real dx12,dy12,dz12,rsq12,rinv12,rinvsq12,r12,qq12,c6_12,c12_12,cexp1_12,cexp2_12; |
646 | real dx13,dy13,dz13,rsq13,rinv13,rinvsq13,r13,qq13,c6_13,c12_13,cexp1_13,cexp2_13; |
647 | real dx21,dy21,dz21,rsq21,rinv21,rinvsq21,r21,qq21,c6_21,c12_21,cexp1_21,cexp2_21; |
648 | real dx22,dy22,dz22,rsq22,rinv22,rinvsq22,r22,qq22,c6_22,c12_22,cexp1_22,cexp2_22; |
649 | real dx23,dy23,dz23,rsq23,rinv23,rinvsq23,r23,qq23,c6_23,c12_23,cexp1_23,cexp2_23; |
650 | real dx31,dy31,dz31,rsq31,rinv31,rinvsq31,r31,qq31,c6_31,c12_31,cexp1_31,cexp2_31; |
651 | real dx32,dy32,dz32,rsq32,rinv32,rinvsq32,r32,qq32,c6_32,c12_32,cexp1_32,cexp2_32; |
652 | real dx33,dy33,dz33,rsq33,rinv33,rinvsq33,r33,qq33,c6_33,c12_33,cexp1_33,cexp2_33; |
653 | real velec,felec,velecsum,facel,crf,krf,krf2; |
654 | real *charge; |
655 | int nvdwtype; |
656 | real rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6; |
657 | int *vdwtype; |
658 | real *vdwparam; |
659 | |
660 | x = xx[0]; |
661 | f = ff[0]; |
662 | |
663 | nri = nlist->nri; |
664 | iinr = nlist->iinr; |
665 | jindex = nlist->jindex; |
666 | jjnr = nlist->jjnr; |
667 | shiftidx = nlist->shift; |
668 | gid = nlist->gid; |
669 | shiftvec = fr->shift_vec[0]; |
670 | fshift = fr->fshift[0]; |
671 | facel = fr->epsfac; |
672 | charge = mdatoms->chargeA; |
673 | krf = fr->ic->k_rf; |
674 | krf2 = krf*2.0; |
675 | crf = fr->ic->c_rf; |
Value stored to 'crf' is never read | |
676 | nvdwtype = fr->ntype; |
677 | vdwparam = fr->nbfp; |
678 | vdwtype = mdatoms->typeA; |
679 | |
680 | /* Setup water-specific parameters */ |
681 | inr = nlist->iinr[0]; |
682 | iq1 = facel*charge[inr+1]; |
683 | iq2 = facel*charge[inr+2]; |
684 | iq3 = facel*charge[inr+3]; |
685 | vdwioffset0 = 3*nvdwtype*vdwtype[inr+0]; |
686 | |
687 | jq1 = charge[inr+1]; |
688 | jq2 = charge[inr+2]; |
689 | jq3 = charge[inr+3]; |
690 | vdwjidx0 = 3*vdwtype[inr+0]; |
691 | c6_00 = vdwparam[vdwioffset0+vdwjidx0]; |
692 | cexp1_00 = vdwparam[vdwioffset0+vdwjidx0+1]; |
693 | cexp2_00 = vdwparam[vdwioffset0+vdwjidx0+2]; |
694 | qq11 = iq1*jq1; |
695 | qq12 = iq1*jq2; |
696 | qq13 = iq1*jq3; |
697 | qq21 = iq2*jq1; |
698 | qq22 = iq2*jq2; |
699 | qq23 = iq2*jq3; |
700 | qq31 = iq3*jq1; |
701 | qq32 = iq3*jq2; |
702 | qq33 = iq3*jq3; |
703 | |
704 | outeriter = 0; |
705 | inneriter = 0; |
706 | |
707 | /* Start outer loop over neighborlists */ |
708 | for(iidx=0; iidx<nri; iidx++) |
709 | { |
710 | /* Load shift vector for this list */ |
711 | i_shift_offset = DIM3*shiftidx[iidx]; |
712 | shX = shiftvec[i_shift_offset+XX0]; |
713 | shY = shiftvec[i_shift_offset+YY1]; |
714 | shZ = shiftvec[i_shift_offset+ZZ2]; |
715 | |
716 | /* Load limits for loop over neighbors */ |
717 | j_index_start = jindex[iidx]; |
718 | j_index_end = jindex[iidx+1]; |
719 | |
720 | /* Get outer coordinate index */ |
721 | inr = iinr[iidx]; |
722 | i_coord_offset = DIM3*inr; |
723 | |
724 | /* Load i particle coords and add shift vector */ |
725 | ix0 = shX + x[i_coord_offset+DIM3*0+XX0]; |
726 | iy0 = shY + x[i_coord_offset+DIM3*0+YY1]; |
727 | iz0 = shZ + x[i_coord_offset+DIM3*0+ZZ2]; |
728 | ix1 = shX + x[i_coord_offset+DIM3*1+XX0]; |
729 | iy1 = shY + x[i_coord_offset+DIM3*1+YY1]; |
730 | iz1 = shZ + x[i_coord_offset+DIM3*1+ZZ2]; |
731 | ix2 = shX + x[i_coord_offset+DIM3*2+XX0]; |
732 | iy2 = shY + x[i_coord_offset+DIM3*2+YY1]; |
733 | iz2 = shZ + x[i_coord_offset+DIM3*2+ZZ2]; |
734 | ix3 = shX + x[i_coord_offset+DIM3*3+XX0]; |
735 | iy3 = shY + x[i_coord_offset+DIM3*3+YY1]; |
736 | iz3 = shZ + x[i_coord_offset+DIM3*3+ZZ2]; |
737 | |
738 | fix0 = 0.0; |
739 | fiy0 = 0.0; |
740 | fiz0 = 0.0; |
741 | fix1 = 0.0; |
742 | fiy1 = 0.0; |
743 | fiz1 = 0.0; |
744 | fix2 = 0.0; |
745 | fiy2 = 0.0; |
746 | fiz2 = 0.0; |
747 | fix3 = 0.0; |
748 | fiy3 = 0.0; |
749 | fiz3 = 0.0; |
750 | |
751 | /* Start inner kernel loop */ |
752 | for(jidx=j_index_start; jidx<j_index_end; jidx++) |
753 | { |
754 | /* Get j neighbor index, and coordinate index */ |
755 | jnr = jjnr[jidx]; |
756 | j_coord_offset = DIM3*jnr; |
757 | |
758 | /* load j atom coordinates */ |
759 | jx0 = x[j_coord_offset+DIM3*0+XX0]; |
760 | jy0 = x[j_coord_offset+DIM3*0+YY1]; |
761 | jz0 = x[j_coord_offset+DIM3*0+ZZ2]; |
762 | jx1 = x[j_coord_offset+DIM3*1+XX0]; |
763 | jy1 = x[j_coord_offset+DIM3*1+YY1]; |
764 | jz1 = x[j_coord_offset+DIM3*1+ZZ2]; |
765 | jx2 = x[j_coord_offset+DIM3*2+XX0]; |
766 | jy2 = x[j_coord_offset+DIM3*2+YY1]; |
767 | jz2 = x[j_coord_offset+DIM3*2+ZZ2]; |
768 | jx3 = x[j_coord_offset+DIM3*3+XX0]; |
769 | jy3 = x[j_coord_offset+DIM3*3+YY1]; |
770 | jz3 = x[j_coord_offset+DIM3*3+ZZ2]; |
771 | |
772 | /* Calculate displacement vector */ |
773 | dx00 = ix0 - jx0; |
774 | dy00 = iy0 - jy0; |
775 | dz00 = iz0 - jz0; |
776 | dx11 = ix1 - jx1; |
777 | dy11 = iy1 - jy1; |
778 | dz11 = iz1 - jz1; |
779 | dx12 = ix1 - jx2; |
780 | dy12 = iy1 - jy2; |
781 | dz12 = iz1 - jz2; |
782 | dx13 = ix1 - jx3; |
783 | dy13 = iy1 - jy3; |
784 | dz13 = iz1 - jz3; |
785 | dx21 = ix2 - jx1; |
786 | dy21 = iy2 - jy1; |
787 | dz21 = iz2 - jz1; |
788 | dx22 = ix2 - jx2; |
789 | dy22 = iy2 - jy2; |
790 | dz22 = iz2 - jz2; |
791 | dx23 = ix2 - jx3; |
792 | dy23 = iy2 - jy3; |
793 | dz23 = iz2 - jz3; |
794 | dx31 = ix3 - jx1; |
795 | dy31 = iy3 - jy1; |
796 | dz31 = iz3 - jz1; |
797 | dx32 = ix3 - jx2; |
798 | dy32 = iy3 - jy2; |
799 | dz32 = iz3 - jz2; |
800 | dx33 = ix3 - jx3; |
801 | dy33 = iy3 - jy3; |
802 | dz33 = iz3 - jz3; |
803 | |
804 | /* Calculate squared distance and things based on it */ |
805 | rsq00 = dx00*dx00+dy00*dy00+dz00*dz00; |
806 | rsq11 = dx11*dx11+dy11*dy11+dz11*dz11; |
807 | rsq12 = dx12*dx12+dy12*dy12+dz12*dz12; |
808 | rsq13 = dx13*dx13+dy13*dy13+dz13*dz13; |
809 | rsq21 = dx21*dx21+dy21*dy21+dz21*dz21; |
810 | rsq22 = dx22*dx22+dy22*dy22+dz22*dz22; |
811 | rsq23 = dx23*dx23+dy23*dy23+dz23*dz23; |
812 | rsq31 = dx31*dx31+dy31*dy31+dz31*dz31; |
813 | rsq32 = dx32*dx32+dy32*dy32+dz32*dz32; |
814 | rsq33 = dx33*dx33+dy33*dy33+dz33*dz33; |
815 | |
816 | rinv00 = gmx_invsqrt(rsq00)gmx_software_invsqrt(rsq00); |
817 | rinv11 = gmx_invsqrt(rsq11)gmx_software_invsqrt(rsq11); |
818 | rinv12 = gmx_invsqrt(rsq12)gmx_software_invsqrt(rsq12); |
819 | rinv13 = gmx_invsqrt(rsq13)gmx_software_invsqrt(rsq13); |
820 | rinv21 = gmx_invsqrt(rsq21)gmx_software_invsqrt(rsq21); |
821 | rinv22 = gmx_invsqrt(rsq22)gmx_software_invsqrt(rsq22); |
822 | rinv23 = gmx_invsqrt(rsq23)gmx_software_invsqrt(rsq23); |
823 | rinv31 = gmx_invsqrt(rsq31)gmx_software_invsqrt(rsq31); |
824 | rinv32 = gmx_invsqrt(rsq32)gmx_software_invsqrt(rsq32); |
825 | rinv33 = gmx_invsqrt(rsq33)gmx_software_invsqrt(rsq33); |
826 | |
827 | rinvsq00 = rinv00*rinv00; |
828 | rinvsq11 = rinv11*rinv11; |
829 | rinvsq12 = rinv12*rinv12; |
830 | rinvsq13 = rinv13*rinv13; |
831 | rinvsq21 = rinv21*rinv21; |
832 | rinvsq22 = rinv22*rinv22; |
833 | rinvsq23 = rinv23*rinv23; |
834 | rinvsq31 = rinv31*rinv31; |
835 | rinvsq32 = rinv32*rinv32; |
836 | rinvsq33 = rinv33*rinv33; |
837 | |
838 | /************************** |
839 | * CALCULATE INTERACTIONS * |
840 | **************************/ |
841 | |
842 | r00 = rsq00*rinv00; |
843 | |
844 | /* BUCKINGHAM DISPERSION/REPULSION */ |
845 | rinvsix = rinvsq00*rinvsq00*rinvsq00; |
846 | vvdw6 = c6_00*rinvsix; |
847 | br = cexp2_00*r00; |
848 | vvdwexp = cexp1_00*exp(-br); |
849 | fvdw = (br*vvdwexp-vvdw6)*rinvsq00; |
850 | |
851 | fscal = fvdw; |
852 | |
853 | /* Calculate temporary vectorial force */ |
854 | tx = fscal*dx00; |
855 | ty = fscal*dy00; |
856 | tz = fscal*dz00; |
857 | |
858 | /* Update vectorial force */ |
859 | fix0 += tx; |
860 | fiy0 += ty; |
861 | fiz0 += 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 | /* REACTION-FIELD ELECTROSTATICS */ |
871 | felec = qq11*(rinv11*rinvsq11-krf2); |
872 | |
873 | fscal = felec; |
874 | |
875 | /* Calculate temporary vectorial force */ |
876 | tx = fscal*dx11; |
877 | ty = fscal*dy11; |
878 | tz = fscal*dz11; |
879 | |
880 | /* Update vectorial force */ |
881 | fix1 += tx; |
882 | fiy1 += ty; |
883 | fiz1 += tz; |
884 | f[j_coord_offset+DIM3*1+XX0] -= tx; |
885 | f[j_coord_offset+DIM3*1+YY1] -= ty; |
886 | f[j_coord_offset+DIM3*1+ZZ2] -= tz; |
887 | |
888 | /************************** |
889 | * CALCULATE INTERACTIONS * |
890 | **************************/ |
891 | |
892 | /* REACTION-FIELD ELECTROSTATICS */ |
893 | felec = qq12*(rinv12*rinvsq12-krf2); |
894 | |
895 | fscal = felec; |
896 | |
897 | /* Calculate temporary vectorial force */ |
898 | tx = fscal*dx12; |
899 | ty = fscal*dy12; |
900 | tz = fscal*dz12; |
901 | |
902 | /* Update vectorial force */ |
903 | fix1 += tx; |
904 | fiy1 += ty; |
905 | fiz1 += tz; |
906 | f[j_coord_offset+DIM3*2+XX0] -= tx; |
907 | f[j_coord_offset+DIM3*2+YY1] -= ty; |
908 | f[j_coord_offset+DIM3*2+ZZ2] -= tz; |
909 | |
910 | /************************** |
911 | * CALCULATE INTERACTIONS * |
912 | **************************/ |
913 | |
914 | /* REACTION-FIELD ELECTROSTATICS */ |
915 | felec = qq13*(rinv13*rinvsq13-krf2); |
916 | |
917 | fscal = felec; |
918 | |
919 | /* Calculate temporary vectorial force */ |
920 | tx = fscal*dx13; |
921 | ty = fscal*dy13; |
922 | tz = fscal*dz13; |
923 | |
924 | /* Update vectorial force */ |
925 | fix1 += tx; |
926 | fiy1 += ty; |
927 | fiz1 += tz; |
928 | f[j_coord_offset+DIM3*3+XX0] -= tx; |
929 | f[j_coord_offset+DIM3*3+YY1] -= ty; |
930 | f[j_coord_offset+DIM3*3+ZZ2] -= tz; |
931 | |
932 | /************************** |
933 | * CALCULATE INTERACTIONS * |
934 | **************************/ |
935 | |
936 | /* REACTION-FIELD ELECTROSTATICS */ |
937 | felec = qq21*(rinv21*rinvsq21-krf2); |
938 | |
939 | fscal = felec; |
940 | |
941 | /* Calculate temporary vectorial force */ |
942 | tx = fscal*dx21; |
943 | ty = fscal*dy21; |
944 | tz = fscal*dz21; |
945 | |
946 | /* Update vectorial force */ |
947 | fix2 += tx; |
948 | fiy2 += ty; |
949 | fiz2 += tz; |
950 | f[j_coord_offset+DIM3*1+XX0] -= tx; |
951 | f[j_coord_offset+DIM3*1+YY1] -= ty; |
952 | f[j_coord_offset+DIM3*1+ZZ2] -= tz; |
953 | |
954 | /************************** |
955 | * CALCULATE INTERACTIONS * |
956 | **************************/ |
957 | |
958 | /* REACTION-FIELD ELECTROSTATICS */ |
959 | felec = qq22*(rinv22*rinvsq22-krf2); |
960 | |
961 | fscal = felec; |
962 | |
963 | /* Calculate temporary vectorial force */ |
964 | tx = fscal*dx22; |
965 | ty = fscal*dy22; |
966 | tz = fscal*dz22; |
967 | |
968 | /* Update vectorial force */ |
969 | fix2 += tx; |
970 | fiy2 += ty; |
971 | fiz2 += tz; |
972 | f[j_coord_offset+DIM3*2+XX0] -= tx; |
973 | f[j_coord_offset+DIM3*2+YY1] -= ty; |
974 | f[j_coord_offset+DIM3*2+ZZ2] -= tz; |
975 | |
976 | /************************** |
977 | * CALCULATE INTERACTIONS * |
978 | **************************/ |
979 | |
980 | /* REACTION-FIELD ELECTROSTATICS */ |
981 | felec = qq23*(rinv23*rinvsq23-krf2); |
982 | |
983 | fscal = felec; |
984 | |
985 | /* Calculate temporary vectorial force */ |
986 | tx = fscal*dx23; |
987 | ty = fscal*dy23; |
988 | tz = fscal*dz23; |
989 | |
990 | /* Update vectorial force */ |
991 | fix2 += tx; |
992 | fiy2 += ty; |
993 | fiz2 += tz; |
994 | f[j_coord_offset+DIM3*3+XX0] -= tx; |
995 | f[j_coord_offset+DIM3*3+YY1] -= ty; |
996 | f[j_coord_offset+DIM3*3+ZZ2] -= tz; |
997 | |
998 | /************************** |
999 | * CALCULATE INTERACTIONS * |
1000 | **************************/ |
1001 | |
1002 | /* REACTION-FIELD ELECTROSTATICS */ |
1003 | felec = qq31*(rinv31*rinvsq31-krf2); |
1004 | |
1005 | fscal = felec; |
1006 | |
1007 | /* Calculate temporary vectorial force */ |
1008 | tx = fscal*dx31; |
1009 | ty = fscal*dy31; |
1010 | tz = fscal*dz31; |
1011 | |
1012 | /* Update vectorial force */ |
1013 | fix3 += tx; |
1014 | fiy3 += ty; |
1015 | fiz3 += tz; |
1016 | f[j_coord_offset+DIM3*1+XX0] -= tx; |
1017 | f[j_coord_offset+DIM3*1+YY1] -= ty; |
1018 | f[j_coord_offset+DIM3*1+ZZ2] -= tz; |
1019 | |
1020 | /************************** |
1021 | * CALCULATE INTERACTIONS * |
1022 | **************************/ |
1023 | |
1024 | /* REACTION-FIELD ELECTROSTATICS */ |
1025 | felec = qq32*(rinv32*rinvsq32-krf2); |
1026 | |
1027 | fscal = felec; |
1028 | |
1029 | /* Calculate temporary vectorial force */ |
1030 | tx = fscal*dx32; |
1031 | ty = fscal*dy32; |
1032 | tz = fscal*dz32; |
1033 | |
1034 | /* Update vectorial force */ |
1035 | fix3 += tx; |
1036 | fiy3 += ty; |
1037 | fiz3 += tz; |
1038 | f[j_coord_offset+DIM3*2+XX0] -= tx; |
1039 | f[j_coord_offset+DIM3*2+YY1] -= ty; |
1040 | f[j_coord_offset+DIM3*2+ZZ2] -= tz; |
1041 | |
1042 | /************************** |
1043 | * CALCULATE INTERACTIONS * |
1044 | **************************/ |
1045 | |
1046 | /* REACTION-FIELD ELECTROSTATICS */ |
1047 | felec = qq33*(rinv33*rinvsq33-krf2); |
1048 | |
1049 | fscal = felec; |
1050 | |
1051 | /* Calculate temporary vectorial force */ |
1052 | tx = fscal*dx33; |
1053 | ty = fscal*dy33; |
1054 | tz = fscal*dz33; |
1055 | |
1056 | /* Update vectorial force */ |
1057 | fix3 += tx; |
1058 | fiy3 += ty; |
1059 | fiz3 += tz; |
1060 | f[j_coord_offset+DIM3*3+XX0] -= tx; |
1061 | f[j_coord_offset+DIM3*3+YY1] -= ty; |
1062 | f[j_coord_offset+DIM3*3+ZZ2] -= tz; |
1063 | |
1064 | /* Inner loop uses 292 flops */ |
1065 | } |
1066 | /* End of innermost loop */ |
1067 | |
1068 | tx = ty = tz = 0; |
1069 | f[i_coord_offset+DIM3*0+XX0] += fix0; |
1070 | f[i_coord_offset+DIM3*0+YY1] += fiy0; |
1071 | f[i_coord_offset+DIM3*0+ZZ2] += fiz0; |
1072 | tx += fix0; |
1073 | ty += fiy0; |
1074 | tz += fiz0; |
1075 | f[i_coord_offset+DIM3*1+XX0] += fix1; |
1076 | f[i_coord_offset+DIM3*1+YY1] += fiy1; |
1077 | f[i_coord_offset+DIM3*1+ZZ2] += fiz1; |
1078 | tx += fix1; |
1079 | ty += fiy1; |
1080 | tz += fiz1; |
1081 | f[i_coord_offset+DIM3*2+XX0] += fix2; |
1082 | f[i_coord_offset+DIM3*2+YY1] += fiy2; |
1083 | f[i_coord_offset+DIM3*2+ZZ2] += fiz2; |
1084 | tx += fix2; |
1085 | ty += fiy2; |
1086 | tz += fiz2; |
1087 | f[i_coord_offset+DIM3*3+XX0] += fix3; |
1088 | f[i_coord_offset+DIM3*3+YY1] += fiy3; |
1089 | f[i_coord_offset+DIM3*3+ZZ2] += fiz3; |
1090 | tx += fix3; |
1091 | ty += fiy3; |
1092 | tz += fiz3; |
1093 | fshift[i_shift_offset+XX0] += tx; |
1094 | fshift[i_shift_offset+YY1] += ty; |
1095 | fshift[i_shift_offset+ZZ2] += tz; |
1096 | |
1097 | /* Increment number of inner iterations */ |
1098 | inneriter += j_index_end - j_index_start; |
1099 | |
1100 | /* Outer loop uses 39 flops */ |
1101 | } |
1102 | |
1103 | /* Increment number of outer iterations */ |
1104 | outeriter += nri; |
1105 | |
1106 | /* Update outer/inner flops */ |
1107 | |
1108 | inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_W4W4_F,outeriter*39 + inneriter*292)(nrnb)->n[eNR_NBKERNEL_ELEC_VDW_W4W4_F] += outeriter*39 + inneriter *292; |
1109 | } |