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