ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/freemol/trunk/smi23d/src/mengine/etorsion.c
Revision: 3
Committed: Mon Jun 9 21:38:26 2008 UTC (11 years, 4 months ago) by tjod
File size: 132141 byte(s)
Log Message:
test

Line File contents
1 #define EXTERN extern
2
3 #include "pcwin.h"
4 #include "pcmod.h"
5
6 #include "energies.h"
7 #include "torsions.h"
8 #include "derivs.h"
9 #include "hess.h"
10 #include "pot.h"
11 #include "fix.h"
12
13 double dihdrl(int,int,int,int);
14 void etorsion(void);
15 void etorsion1(void);
16 void etorsion2(int);
17
18
19 EXTERN struct t_units {
20 double bndunit, cbnd, qbnd;
21 double angunit, cang, qang, pang, sang, aaunit;
22 double stbnunit, ureyunit, torsunit, storunit, v14scale;
23 double aterm, bterm, cterm, dielec, chgscale;
24 } units;
25
26 EXTERN struct t_minim_values {
27 int iprint, ndc, nconst;
28 float dielc;
29 } minim_values;
30
31 struct t_smooth {
32 int run, nmode, method, freq_cutoff, current_struct;
33 double deform;
34 double diffb, diffa, diffid, difft, diffv, diffc;
35 } smooth;
36
37 void etorsion()
38 {
39 int i,ia, ib, ic, id;
40 double e, rt2, ru2, rtru;
41 double xt,yt,zt,xu,yu,zu;
42 double v1,v2,v3,v4,v5,v6;
43 double s1,s2,s3,s4,s5,s6;
44 double cosine,cosine2,cosine3;
45 double cosine4,cosine5,cosine6;
46 double phi1,phi2,phi3;
47 double phi4,phi5,phi6;
48 double xia,yia,zia,xib,yib,zib;
49 double xic,yic,zic,xid,yid,zid;
50 double xba,yba,zba,xcb,ycb,zcb;
51 double xdc,ydc,zdc;
52 double xtu,ytu,ztu,rcb, angle,rdihed;
53 double width,sine,dt2;
54 int curang;
55
56 energies.etor = 0.0;
57 if (minim_values.iprint)
58 {
59 fprintf(pcmoutfile,"\nTorsion Terms\n");
60 fprintf(pcmoutfile," At1 At2 At3 At4 Types Angle V1 V2 V3 Etor\n");
61 }
62
63 width = 0.0;
64 if (pot.use_deform) width = smooth.difft/smooth.deform;
65
66 for (i=0; i < torsions.ntor; i++)
67 {
68 ia = torsions.i14[i][0];
69 ib = torsions.i14[i][1];
70 ic = torsions.i14[i][2];
71 id = torsions.i14[i][3];
72 if (atom[ia].use || atom[ib].use || atom[ic].use || atom[id].use )
73 {
74 xia = atom[ia].x;
75 yia = atom[ia].y;
76 zia = atom[ia].z;
77 xib = atom[ib].x;
78 yib = atom[ib].y;
79 zib = atom[ib].z;
80 xic = atom[ic].x;
81 yic = atom[ic].y;
82 zic = atom[ic].z;
83 xid = atom[id].x;
84 yid = atom[id].y;
85 zid = atom[id].z;
86 xba = xib - xia;
87 yba = yib - yia;
88 zba = zib - zia;
89 xcb = xic - xib;
90 ycb = yic - yib;
91 zcb = zic - zib;
92 xdc = xid - xic;
93 ydc = yid - yic;
94 zdc = zid - zic;
95 xt = yba*zcb - ycb*zba;
96 yt = zba*xcb - zcb*xba;
97 zt = xba*ycb - xcb*yba;
98 xu = ycb*zdc - ydc*zcb;
99 yu = zcb*xdc - zdc*xcb;
100 zu = xcb*ydc - xdc*ycb;
101 rt2 = xt*xt + yt*yt + zt*zt;
102 ru2 = xu*xu + yu*yu + zu*zu;
103 rtru = sqrt(rt2 * ru2);
104 if (rtru != 0.0)
105 {
106 cosine = (xt*xu + yt*yu + zt*zu) / rtru;
107
108 v1 = torsions.v1[i];
109 s1 = torsions.ph1[i];
110 v2 = torsions.v2[i];
111 s2 = torsions.ph2[i];
112 v3 = torsions.v3[i];
113 s3 = torsions.ph3[i];
114 v4 = torsions.v4[i];
115 s4 = torsions.ph4[i];
116 v5 = torsions.v5[i];
117 s5 = torsions.ph5[i];
118 v6 = torsions.v6[i];
119 s6 = torsions.ph6[i];
120
121 // compute the powers of the cosine of this angle
122
123 cosine2 = cosine * cosine;
124 cosine3 = cosine2 * cosine;
125 cosine4 = cosine2 * cosine2;
126 cosine5 = cosine3 * cosine2;
127 cosine6 = cosine3 * cosine3;
128
129 phi1 = 1.0 + s1*cosine;
130 phi2 = 1.0 + s2*(2.0*cosine2 - 1.0);
131 phi3 = 1.0 + s3*(4.0*cosine3 - 3.0*cosine);
132 phi4 = 1.0 + s4*(8.0*(cosine4-cosine2) + 1.0);
133 phi5 = 1.0 + s5*(16.0*cosine5 - 20.0*cosine3 + 5.0*cosine);
134 phi6 = 1.0 + s6*(32.0*cosine6 - 48.0*cosine4 + 18.0*cosine2 - 1.0);
135
136 if (pot.use_deform)
137 {
138 phi1 = phi1*exp(-width);
139 phi2 = phi2*exp(-4.0*width);
140 phi3 = phi3*exp(-9.0*width);
141 phi4 = phi4*exp(-16.0*width);
142 phi5 = phi5*exp(-25.0*width);
143 phi6 = phi6*exp(-36.0*width);
144 }
145 e = units.torsunit * (v1*phi1 + v2*phi2 + v3*phi3
146 + v4*phi4 + v5*phi5 + v6*phi6);
147 energies.etor += e;
148 atom[ia].energy += e;
149 atom[ib].energy += e;
150 atom[ic].energy += e;
151 atom[id].energy += e;
152 if(minim_values.iprint)
153 {
154 rdihed = dihdrl(ia,ib,ic,id);
155 fprintf(pcmoutfile,"Tor: %2s(%-3d)- %2s(%-3d)- %2s(%-3d)- %2s(%-3d) %d %d %d %d %8.2f %-8.3f %-8.3f %-8.3f = %-8.4f\n",
156 atom[ia].name,ia,atom[ib].name,ib,atom[ic].name,ic,atom[id].name,id, atom[ia].type, atom[ib].type,
157 atom[ic].type, atom[id].type, rdihed,v1,v2,v3,e);
158 }
159 }
160 }
161 }
162 // fixed torsions
163 for (i=0; i < fxtor.nfxtor; i++)
164 {
165 ia = fxtor.iatom[i][0];
166 ib = fxtor.iatom[i][1];
167 ic = fxtor.iatom[i][2];
168 id = fxtor.iatom[i][3];
169 if (atom[ia].use || atom[ib].use || atom[ic].use || atom[id].use )
170 {
171 xia = atom[ia].x;
172 yia = atom[ia].y;
173 zia = atom[ia].z;
174 xib = atom[ib].x;
175 yib = atom[ib].y;
176 zib = atom[ib].z;
177 xic = atom[ic].x;
178 yic = atom[ic].y;
179 zic = atom[ic].z;
180 xid = atom[id].x;
181 yid = atom[id].y;
182 zid = atom[id].z;
183 xba = xib - xia;
184 yba = yib - yia;
185 zba = zib - zia;
186 xcb = xic - xib;
187 ycb = yic - yib;
188 zcb = zic - zib;
189 xdc = xid - xic;
190 ydc = yid - yic;
191 zdc = zid - zic;
192 xt = yba*zcb - ycb*zba;
193 yt = zba*xcb - zcb*xba;
194 zt = xba*ycb - xcb*yba;
195 xu = ycb*zdc - ydc*zcb;
196 yu = zcb*xdc - zdc*xcb;
197 zu = xcb*ydc - xdc*ycb;
198 xtu = yt*zu - yu*zt;
199 ytu = zt*xu - zu*xt;
200 ztu = xt*yu - xu*yt;
201 rt2 = xt*xt + yt*yt + zt*zt;
202 ru2 = xu*xu + yu*yu + zu*zu;
203 rtru = sqrt(rt2 * ru2);
204 if (rtru != 0.0)
205 {
206 rcb = sqrt(xcb*xcb + ycb*ycb + zcb*zcb);
207 cosine = (xt*xu + yt*yu + zt*zu) / rtru;
208 sine = (xcb*xtu + ycb*ytu + zcb*ztu) / (rcb*rtru);
209 cosine = MinFun(1.0, MaxFun(-1.0,cosine));
210 angle = radian*acos(cosine);
211 if (sine < 0.0) angle = -angle;
212
213 curang = fxtor.curr_ang[i];
214 if (curang > 360)
215 curang %= 360;
216
217 v1 = 2.0;
218 s1 = 1.0;
219 phi1 = s1*(curang - angle);
220 if (phi1 > 180.0)
221 phi1 -= 360.0;
222 else if (phi1 < -180.0)
223 phi1 += 360.0;
224 dt2 = phi1*phi1;
225 e = units.torsunit * v1*dt2;
226 energies.etor += e;
227 atom[ia].energy += e;
228 atom[ib].energy += e;
229 atom[ic].energy += e;
230 atom[id].energy += e;
231 if(minim_values.iprint)
232 {
233 rdihed = dihdrl(ia,ib,ic,id);
234 fprintf(pcmoutfile,"FxTor: %2s(%-3d)- %2s(%-3d)- %2s(%-3d)- %2s(%-3d) %8.2f %-8.3f = %-8.4f\n",
235 atom[ia].name,ia,atom[ib].name,ib,atom[ic].name,ic,atom[id].name,id, rdihed,v1,e);
236 }
237 }
238 }
239 }
240
241
242 }
243
244 void etorsion1()
245 {
246 int i,ia, ib, ic, id;
247 int curang;
248 double angle;
249 double e, rt2, ru2, rtru,dedphi,sine,dt2;
250 double xt,yt,zt,xu,yu,zu;
251 double v1,v2,v3,v4,v5,v6;
252 double s1,s2,s3,s4,s5,s6;
253 double cosine,cosine2,cosine3;
254 double cosine4,cosine5,cosine6;
255 double phi1,phi2,phi3;
256 double phi4,phi5,phi6;
257 double xia,yia,zia,xib,yib,zib;
258 double xic,yic,zic,xid,yid,zid;
259 double xba,yba,zba,xcb,ycb,zcb;
260 double xdc,ydc,zdc;
261 double xca,yca,zca,xdb,ydb,zdb;
262 double xtu,ytu,ztu,rcb;
263 double dphi1,dphi2,dphi3;
264 double dphi4,dphi5,dphi6;
265 double dphidxt,dphidyt,dphidzt;
266 double dphidxu,dphidyu,dphidzu;
267 double dphidxia,dphidyia,dphidzia;
268 double dphidxib,dphidyib,dphidzib;
269 double dphidxic,dphidyic,dphidzic;
270 double dphidxid,dphidyid,dphidzid;
271 double dedxia,dedyia,dedzia;
272 double dedxib,dedyib,dedzib;
273 double dedxic,dedyic,dedzic;
274 double dedxid,dedyid,dedzid;
275 double dedxt,dedyt,dedzt, dedxu,dedyu,dedzu;
276 double deform1,deform2,deform3;
277 double deform4,deform5,deform6, width;
278
279 energies.etor = 0.0;
280 for (i=0; i <= natom; i++)
281 {
282 deriv.detor[i][0] = 0.0;
283 deriv.detor[i][1] = 0.0;
284 deriv.detor[i][2] = 0.0;
285 }
286
287 width = 0.0;
288 if (pot.use_deform) width = smooth.difft/smooth.deform;
289
290 for (i=0; i < torsions.ntor; i++)
291 {
292 ia = torsions.i14[i][0];
293 ib = torsions.i14[i][1];
294 ic = torsions.i14[i][2];
295 id = torsions.i14[i][3];
296 if (atom[ia].use || atom[ib].use || atom[ic].use || atom[id].use )
297 {
298 xia = atom[ia].x;
299 yia = atom[ia].y;
300 zia = atom[ia].z;
301 xib = atom[ib].x;
302 yib = atom[ib].y;
303 zib = atom[ib].z;
304 xic = atom[ic].x;
305 yic = atom[ic].y;
306 zic = atom[ic].z;
307 xid = atom[id].x;
308 yid = atom[id].y;
309 zid = atom[id].z;
310 xba = xib - xia;
311 yba = yib - yia;
312 zba = zib - zia;
313 xcb = xic - xib;
314 ycb = yic - yib;
315 zcb = zic - zib;
316 xdc = xid - xic;
317 ydc = yid - yic;
318 zdc = zid - zic;
319 xt = yba*zcb - ycb*zba;
320 yt = zba*xcb - zcb*xba;
321 zt = xba*ycb - xcb*yba;
322 xu = ycb*zdc - ydc*zcb;
323 yu = zcb*xdc - zdc*xcb;
324 zu = xcb*ydc - xdc*ycb;
325 xtu = yt*zu - yu*zt;
326 ytu = zt*xu - zu*xt;
327 ztu = xt*yu - xu*yt;
328 rt2 = xt*xt + yt*yt + zt*zt;
329 ru2 = xu*xu + yu*yu + zu*zu;
330 rtru = sqrt(rt2 * ru2);
331 if (rtru != 0.0)
332 {
333 rcb = sqrt(xcb*xcb + ycb*ycb + zcb*zcb);
334 cosine = (xt*xu + yt*yu + zt*zu) / rtru;
335 sine = (xcb*xtu + ycb*ytu + zcb*ztu) / (rcb*rtru);
336
337 v1 = torsions.v1[i];
338 s1 = torsions.ph1[i];
339 v2 = torsions.v2[i];
340 s2 = torsions.ph2[i];
341 v3 = torsions.v3[i];
342 s3 = torsions.ph3[i];
343 v4 = torsions.v4[i];
344 s4 = torsions.ph4[i];
345 v5 = torsions.v5[i];
346 s5 = torsions.ph5[i];
347 v6 = torsions.v6[i];
348 s6 = torsions.ph6[i];
349 // compute the powers of the cosine of this angle
350
351 cosine2 = cosine * cosine;
352 cosine3 = cosine2 * cosine;
353 cosine4 = cosine2 * cosine2;
354 cosine5 = cosine3 * cosine2;
355 cosine6 = cosine3 * cosine3;
356
357 phi1 = 1.0 + s1*cosine;
358 phi2 = 1.0 + s2*(2.0*cosine2 - 1.0);
359 phi3 = 1.0 + s3*(4.0*cosine3 - 3.0*cosine);
360 phi4 = 1.0 + s4*(8.0*(cosine4-cosine2) + 1.0);
361 phi5 = 1.0 + s5*(16.0*cosine5 - 20.0*cosine3 + 5.0*cosine);
362 phi6 = 1.0 + s6*(32.0*cosine6 - 48.0*cosine4 + 18.0*cosine2 - 1.0);
363
364 dphi1 = s1;
365 dphi2 = s2 * (4.0*cosine);
366 dphi3 = s3 * (12.0*cosine2 - 3.0);
367 dphi4 = s4 * (32.0*cosine3 - 16.0*cosine);
368 dphi5 = s5 * (80.0*cosine4 - 60.0*cosine2 + 5.0);
369 dphi6 = s6 * (192.0*(cosine5-cosine3) + 36.0*cosine);
370
371 if (pot.use_deform)
372 {
373 deform1 = exp(-width);
374 deform2 = exp(-4.0*width);
375 deform3 = exp(-9.0*width);
376 deform4 = exp(-16.0*width);
377 deform5 = exp(-25.0*width);
378 deform6 = exp(-36.0*width);
379 phi1 *= deform1;
380 phi2 *= deform2;
381 phi3 *= deform3;
382 phi4 *= deform4;
383 phi5 *= deform5;
384 phi6 *= deform6;
385 dphi1 *= deform1;
386 dphi2 *= deform2;
387 dphi3 *= deform3;
388 dphi4 *= deform4;
389 dphi5 *= deform5;
390 dphi6 *= deform6;
391 }
392
393 e = units.torsunit * (v1*phi1 + v2*phi2 + v3*phi3
394 + v4*phi4 + v5*phi5 + v6*phi6);
395 dedphi = -sine * units.torsunit
396 * (v1*dphi1+v2*dphi2+v3*dphi3+v4*dphi4+v5*dphi5+v6*dphi6);
397
398 xca = xic - xia;
399 yca = yic - yia;
400 zca = zic - zia;
401 xdb = xid - xib;
402 ydb = yid - yib;
403 zdb = zid - zib;
404 dphidxt = (yt*zcb - ycb*zt) / (rt2*rcb);
405 dphidyt = (zt*xcb - zcb*xt) / (rt2*rcb);
406 dphidzt = (xt*ycb - xcb*yt) / (rt2*rcb);
407 dphidxu = -(yu*zcb - ycb*zu) / (ru2*rcb);
408 dphidyu = -(zu*xcb - zcb*xu) / (ru2*rcb);
409 dphidzu = -(xu*ycb - xcb*yu) / (ru2*rcb);
410
411 dphidxia = zcb*dphidyt - ycb*dphidzt;
412 dphidyia = xcb*dphidzt - zcb*dphidxt;
413 dphidzia = ycb*dphidxt - xcb*dphidyt;
414 dphidxib = yca*dphidzt - zca*dphidyt + zdc*dphidyu - ydc*dphidzu;
415 dphidyib = zca*dphidxt - xca*dphidzt + xdc*dphidzu - zdc*dphidxu;
416 dphidzib = xca*dphidyt - yca*dphidxt + ydc*dphidxu - xdc*dphidyu;
417 dphidxic = zba*dphidyt - yba*dphidzt + ydb*dphidzu - zdb*dphidyu;
418 dphidyic = xba*dphidzt - zba*dphidxt + zdb*dphidxu - xdb*dphidzu;
419 dphidzic = yba*dphidxt - xba*dphidyt + xdb*dphidyu - ydb*dphidxu;
420 dphidxid = zcb*dphidyu - ycb*dphidzu;
421 dphidyid = xcb*dphidzu - zcb*dphidxu;
422 dphidzid = ycb*dphidxu - xcb*dphidyu;
423 dedxia = dedphi * dphidxia;
424 dedyia = dedphi * dphidyia;
425 dedzia = dedphi * dphidzia;
426 dedxib = dedphi * dphidxib;
427 dedyib = dedphi * dphidyib;
428 dedzib = dedphi * dphidzib;
429 dedxic = dedphi * dphidxic;
430 dedyic = dedphi * dphidyic;
431 dedzic = dedphi * dphidzic;
432 dedxid = dedphi * dphidxid;
433 dedyid = dedphi * dphidyid;
434 dedzid = dedphi * dphidzid;
435
436 energies.etor += e;
437 deriv.detor[ia][0] += dedxia;
438 deriv.detor[ia][1] += dedyia;
439 deriv.detor[ia][2] += dedzia;
440
441 deriv.detor[ib][0] += dedxib;
442 deriv.detor[ib][1] += dedyib;
443 deriv.detor[ib][2] += dedzib;
444
445 deriv.detor[ic][0] += dedxic;
446 deriv.detor[ic][1] += dedyic;
447 deriv.detor[ic][2] += dedzic;
448
449 deriv.detor[id][0] += dedxid;
450 deriv.detor[id][1] += dedyid;
451 deriv.detor[id][2] += dedzid;
452
453 virial.virx = virial.virx - xba*dedxia + xdc*dedxid
454 + xcb*(dedxic+dedxid);
455 virial.viry = virial.viry - yba*dedyia + ydc*dedyid
456 + ycb*(dedyic+dedyid);
457 virial.virz = virial.virz - zba*dedzia + zdc*dedzid
458 + zcb*(dedzic+dedzid);
459 }
460 }
461 }
462 // fixed torsions
463 for (i=0; i < fxtor.nfxtor; i++)
464 {
465 ia = fxtor.iatom[i][0];
466 ib = fxtor.iatom[i][1];
467 ic = fxtor.iatom[i][2];
468 id = fxtor.iatom[i][3];
469 if (atom[ia].use || atom[ib].use || atom[ic].use || atom[id].use )
470 {
471 xia = atom[ia].x;
472 yia = atom[ia].y;
473 zia = atom[ia].z;
474 xib = atom[ib].x;
475 yib = atom[ib].y;
476 zib = atom[ib].z;
477 xic = atom[ic].x;
478 yic = atom[ic].y;
479 zic = atom[ic].z;
480 xid = atom[id].x;
481 yid = atom[id].y;
482 zid = atom[id].z;
483 xba = xib - xia;
484 yba = yib - yia;
485 zba = zib - zia;
486 xcb = xic - xib;
487 ycb = yic - yib;
488 zcb = zic - zib;
489 xdc = xid - xic;
490 ydc = yid - yic;
491 zdc = zid - zic;
492 xt = yba*zcb - ycb*zba;
493 yt = zba*xcb - zcb*xba;
494 zt = xba*ycb - xcb*yba;
495 xu = ycb*zdc - ydc*zcb;
496 yu = zcb*xdc - zdc*xcb;
497 zu = xcb*ydc - xdc*ycb;
498 xtu = yt*zu - yu*zt;
499 ytu = zt*xu - zu*xt;
500 ztu = xt*yu - xu*yt;
501 rt2 = xt*xt + yt*yt + zt*zt;
502 ru2 = xu*xu + yu*yu + zu*zu;
503 rtru = sqrt(rt2 * ru2);
504 if (rtru != 0.0)
505 {
506 rcb = sqrt(xcb*xcb + ycb*ycb + zcb*zcb);
507 cosine = (xt*xu + yt*yu + zt*zu) / rtru;
508 sine = (xcb*xtu + ycb*ytu + zcb*ztu) / (rcb*rtru);
509 cosine = MinFun(1.0, MaxFun(-1.0,cosine));
510 angle = radian*acos(cosine);
511 if (sine < 0.0) angle = -angle;
512 curang = fxtor.curr_ang[i];
513 if (curang > 360)
514 curang %= 360;
515
516 v1 = 2.0;
517 s1 = 1.0;
518 phi1 = s1*(angle - curang);
519 if (phi1 > 180.0)
520 phi1 -= 360.0;
521 else if (phi1 < -180.0)
522 phi1 += 360.0;
523 dt2 = phi1*phi1;
524 e = units.torsunit * v1*dt2;
525 dedphi = 2.0*radian*units.torsunit*v1*phi1;
526
527 xca = xic - xia;
528 yca = yic - yia;
529 zca = zic - zia;
530 xdb = xid - xib;
531 ydb = yid - yib;
532 zdb = zid - zib;
533 dedxt = dedphi * (yt*zcb - ycb*zt) / (rt2*rcb);
534 dedyt = dedphi * (zt*xcb - zcb*xt) / (rt2*rcb);
535 dedzt = dedphi * (xt*ycb - xcb*yt) / (rt2*rcb);
536 dedxu = -dedphi * (yu*zcb - ycb*zu) / (ru2*rcb);
537 dedyu = -dedphi * (zu*xcb - zcb*xu) / (ru2*rcb);
538 dedzu = -dedphi * (xu*ycb - xcb*yu) / (ru2*rcb);
539
540 dedxia = zcb*dedyt - ycb*dedzt;
541 dedyia = xcb*dedzt - zcb*dedxt;
542 dedzia = ycb*dedxt - xcb*dedyt;
543 dedxib = yca*dedzt - zca*dedyt + zdc*dedyu - ydc*dedzu;
544 dedyib = zca*dedxt - xca*dedzt + xdc*dedzu - zdc*dedxu;
545 dedzib = xca*dedyt - yca*dedxt + ydc*dedxu - xdc*dedyu;
546 dedxic = zba*dedyt - yba*dedzt + ydb*dedzu - zdb*dedyu;
547 dedyic = xba*dedzt - zba*dedxt + zdb*dedxu - xdb*dedzu;
548 dedzic = yba*dedxt - xba*dedyt + xdb*dedyu - ydb*dedxu;
549 dedxid = zcb*dedyu - ycb*dedzu;
550 dedyid = xcb*dedzu - zcb*dedxu;
551 dedzid = ycb*dedxu - xcb*dedyu;
552
553 energies.etor += e;
554 deriv.detor[ia][0] += dedxia;
555 deriv.detor[ia][1] += dedyia;
556 deriv.detor[ia][2] += dedzia;
557
558 deriv.detor[ib][0] += dedxib;
559 deriv.detor[ib][1] += dedyib;
560 deriv.detor[ib][2] += dedzib;
561
562 deriv.detor[ic][0] += dedxic;
563 deriv.detor[ic][1] += dedyic;
564 deriv.detor[ic][2] += dedzic;
565
566 deriv.detor[id][0] += dedxid;
567 deriv.detor[id][1] += dedyid;
568 deriv.detor[id][2] += dedzid;
569 }
570 }
571 }
572
573
574 }
575
576 void etorsion2(iatom)
577 {
578 int i,ia,ib,ic,id;
579 int curang;
580 double agl, cosm, sinm;
581 double dot, denom, denom2, denom3;
582 double dedphi,d2edphi2,sine;
583 double term1, term2, term3;
584 double v1,v2,v3,v4,v5,v6;
585 double s1,s2,s3,s4,s5,s6;
586 double cosine,cosine2,cosine3;
587 double cosine4,cosine5,cosine6;
588 double xia,yia,zia,xib,yib,zib;
589 double xic,yic,zic,xid,yid,zid;
590 double xba,yba,zba,xcb,ycb,zcb;
591 double xdc,ydc,zdc;
592 double xca,yca,zca,xdb,ydb,zdb;
593 double xt,yt,zt,xu,yu,zu,xtu,ytu,ztu;
594 double rt2,ru2,rtru,rcb, rt2ru2;
595 double phi1,phi2,phi3;
596 double phi4,phi5,phi6;
597 double dphi1,dphi2,dphi3;
598 double dphi4,dphi5,dphi6;
599 double d2phi1,d2phi2,d2phi3;
600 double d2phi4,d2phi5,d2phi6;
601 double dphidxt,dphidyt,dphidzt;
602 double dphidxu,dphidyu,dphidzu;
603 double dphidxt1,dphidyt1,dphidzt1;
604 double dphidxu1,dphidyu1,dphidzu1;
605 double dphidxia,dphidyia,dphidzia;
606 double dphidxib,dphidyib,dphidzib;
607 double dphidxic,dphidyic,dphidzic;
608 double dphidxid,dphidyid,dphidzid;
609 double xycb2,xzcb2,yzcb2;
610 double rcbxt,rcbyt,rcbzt,rcbt2;
611 double rcbxu,rcbyu,rcbzu,rcbu2;
612 double dphidxibt,dphidyibt,dphidzibt;
613 double dphidxibu,dphidyibu,dphidzibu;
614 double dphidxict,dphidyict,dphidzict;
615 double dphidxicu,dphidyicu,dphidzicu;
616 double dxiaxia,dyiayia,dziazia,dxibxib,dyibyib,dzibzib;
617 double dxicxic,dyicyic,dziczic,dxidxid,dyidyid,dzidzid;
618 double dxiayia,dxiazia,dyiazia,dxibyib,dxibzib,dyibzib;
619 double dxicyic,dxiczic,dyiczic,dxidyid,dxidzid,dyidzid;
620 double dxiaxib,dxiayib,dxiazib,dyiaxib,dyiayib,dyiazib;
621 double dziaxib,dziayib,dziazib,dxiaxic,dxiayic,dxiazic;
622 double dyiaxic,dyiayic,dyiazic,dziaxic,dziayic,dziazic;
623 double dxiaxid,dxiayid,dxiazid,dyiaxid,dyiayid,dyiazid;
624 double dziaxid,dziayid,dziazid,dxibxic,dxibyic,dxibzic;
625 double dyibxic,dyibyic,dyibzic,dzibxic,dzibyic,dzibzic;
626 double dxibxid,dxibyid,dxibzid,dyibxid,dyibyid,dyibzid;
627 double dzibxid,dzibyid,dzibzid,dxicxid,dxicyid,dxiczid;
628 double dyicxid,dyicyid,dyiczid,dzicxid,dzicyid,dziczid;
629 double yuzab, zuydb, ytzba, rtru32, rtru322;
630 double zdcyu, xdczu, ydcxu, ycazt, zcaxt, xcayt;
631 double deform1,deform2,deform3;
632 double deform4,deform5,deform6,width;
633
634 width = 0.0;
635 if (pot.use_deform) width = smooth.difft/smooth.deform;
636
637 for (i=0; i < torsions.ntor; i++)
638 {
639 ia = torsions.i14[i][0];
640 ib = torsions.i14[i][1];
641 ic = torsions.i14[i][2];
642 id = torsions.i14[i][3];
643 if (ia == iatom || ib == iatom || ic == iatom || id == iatom)
644 {
645 xia = atom[ia].x;
646 yia = atom[ia].y;
647 zia = atom[ia].z;
648 xib = atom[ib].x;
649 yib = atom[ib].y;
650 zib = atom[ib].z;
651 xic = atom[ic].x;
652 yic = atom[ic].y;
653 zic = atom[ic].z;
654 xid = atom[id].x;
655 yid = atom[id].y;
656 zid = atom[id].z;
657 xba = xib - xia;
658 yba = yib - yia;
659 zba = zib - zia;
660 xcb = xic - xib;
661 ycb = yic - yib;
662 zcb = zic - zib;
663 xdc = xid - xic;
664 ydc = yid - yic;
665 zdc = zid - zic;
666 xt = yba*zcb - ycb*zba;
667 yt = zba*xcb - zcb*xba;
668 zt = xba*ycb - xcb*yba;
669 xu = ycb*zdc - ydc*zcb;
670 yu = zcb*xdc - zdc*xcb;
671 zu = xcb*ydc - xdc*ycb;
672 xtu = yt*zu - yu*zt;
673 ytu = zt*xu - zu*xt;
674 ztu = xt*yu - xu*yt;
675 rt2 = xt*xt + yt*yt + zt*zt;
676 ru2 = xu*xu + yu*yu + zu*zu;
677 rtru = sqrt(rt2 * ru2);
678 if (rtru != 0.0)
679 {
680 rcb = sqrt(xcb*xcb + ycb*ycb + zcb*zcb);
681 cosine = (xt*xu + yt*yu + zt*zu) / rtru;
682 sine = (xcb*xtu + ycb*ytu + zcb*ztu) / (rcb*rtru);
683
684 v1 = torsions.v1[i];
685 s1 = torsions.ph1[i];
686 v2 = torsions.v2[i];
687 s2 = torsions.ph2[i];
688 v3 = torsions.v3[i];
689 s3 = torsions.ph3[i];
690 v4 = torsions.v4[i];
691 s4 = torsions.ph4[i];
692 v5 = torsions.v5[i];
693 s5 = torsions.ph5[i];
694 v6 = torsions.v6[i];
695 s6 = torsions.ph6[i];
696
697 // compute the powers of the cosine of this angle
698
699 cosine2 = cosine * cosine;
700 cosine3 = cosine2 * cosine;
701 cosine4 = cosine2 * cosine2;
702 cosine5 = cosine3 * cosine2;
703 cosine6 = cosine3 * cosine3;
704
705 phi1 = 1.0 + s1*cosine;
706 phi2 = 1.0 + s2*(2.0*cosine2 - 1.0);
707 phi3 = 1.0 + s3*(4.0*cosine3 - 3.0*cosine);
708 phi4 = 1.0 + s4*(8.0*(cosine4-cosine2) + 1.0);
709 phi5 = 1.0 + s5*(16.0*cosine5 - 20.0*cosine3 + 5.0*cosine);
710 phi6 = 1.0 + s6*(32.0*cosine6 - 48.0*cosine4 + 18.0*cosine2 - 1.0);
711
712 dphi1 = s1;
713 dphi2 = s2 * (4.0*cosine);
714 dphi3 = s3 * (12.0*cosine2 - 3.0);
715 dphi4 = s4 * (32.0*cosine3 - 16.0*cosine);
716 dphi5 = s5 * (80.0*cosine4 - 60.0*cosine2 + 5.0);
717 dphi6 = s6 * (192.0*(cosine5-cosine3) + 36.0*cosine);
718
719 d2phi1 = -s1 * cosine;
720 d2phi2 = -s2 * (8.0*cosine2 - 4.0);
721 d2phi3 = -s3 * (36.0*cosine3 - 27.0*cosine);
722 d2phi4 = -s4 * (128.0*(cosine4-cosine2) + 16.0);
723 d2phi5 = -s5 * (400.0*cosine5 - 500.0*cosine + 125.0*cosine);
724 d2phi6 = -s6 * (1152.0*cosine6 - 1728.0*cosine2 + 648.0*cosine2);
725
726 if (pot.use_deform)
727 {
728 deform1 = exp(-width);
729 deform2 = exp(-4.0*width);
730 deform3 = exp(-9.0*width);
731 deform4 = exp(-16.0*width);
732 deform5 = exp(-25.0*width);
733 deform6 = exp(-36.0*width);
734 phi1 *= deform1;
735 phi2 *= deform2;
736 phi3 *= deform3;
737 phi4 *= deform4;
738 phi5 *= deform5;
739 phi6 *= deform6;
740 dphi1 *= deform1;
741 dphi2 *= deform2;
742 dphi3 *= deform3;
743 dphi4 *= deform4;
744 dphi5 *= deform5;
745 dphi6 *= deform6;
746 d2phi1 *= deform1;
747 d2phi2 *= deform2;
748 d2phi3 *= deform3;
749 d2phi4 *= deform4;
750 d2phi5 *= deform5;
751 d2phi6 *= deform6;
752 }
753
754
755 dedphi = -sine * units.torsunit * (v1*dphi1 + v2*dphi2 + v3*dphi3
756 + v4*dphi4 + v5*dphi5 + v6*dphi6);
757 d2edphi2 = units.torsunit * (v1*d2phi1 + v2*d2phi2 + v3*d2phi3
758 + v4*d2phi4 + v5*d2phi5 + v6*d2phi6);
759
760 xca = xic - xia;
761 yca = yic - yia;
762 zca = zic - zia;
763 xdb = xid - xib;
764 ydb = yid - yib;
765 zdb = zid - zib;
766 dphidxt = (yt*zcb - ycb*zt) / (rt2*rcb);
767 dphidyt = (zt*xcb - zcb*xt) / (rt2*rcb);
768 dphidzt = (xt*ycb - xcb*yt) / (rt2*rcb);
769 dphidxu = -(yu*zcb - ycb*zu) / (ru2*rcb);
770 dphidyu = -(zu*xcb - zcb*xu) / (ru2*rcb);
771 dphidzu = -(xu*ycb - xcb*yu) / (ru2*rcb);
772
773 xycb2 = xcb*xcb + ycb*ycb;
774 xzcb2 = xcb*xcb + zcb*zcb;
775 yzcb2 = ycb*ycb + zcb*zcb;
776 rcbxt = -2.0 * rcb * dphidxt;
777 rcbyt = -2.0 * rcb * dphidyt;
778 rcbzt = -2.0 * rcb * dphidzt;
779 rcbt2 = rcb * rt2;
780 rcbxu = 2.0 * rcb * dphidxu;
781 rcbyu = 2.0 * rcb * dphidyu;
782 rcbzu = 2.0 * rcb * dphidzu;
783 rcbu2 = rcb * ru2;
784 dphidxibt = yca*dphidzt - zca*dphidyt;
785 dphidxibu = zdc*dphidyu - ydc*dphidzu;
786 dphidyibt = zca*dphidxt - xca*dphidzt;
787 dphidyibu = xdc*dphidzu - zdc*dphidxu;
788 dphidzibt = xca*dphidyt - yca*dphidxt;
789 dphidzibu = ydc*dphidxu - xdc*dphidyu;
790 dphidxict = zba*dphidyt - yba*dphidzt;
791 dphidxicu = ydb*dphidzu - zdb*dphidyu;
792 dphidyict = xba*dphidzt - zba*dphidxt;
793 dphidyicu = zdb*dphidxu - xdb*dphidzu;
794 dphidzict = yba*dphidxt - xba*dphidyt;
795 dphidzicu = xdb*dphidyu - ydb*dphidxu;
796
797 dphidxia = zcb*dphidyt - ycb*dphidzt;
798 dphidyia = xcb*dphidzt - zcb*dphidxt;
799 dphidzia = ycb*dphidxt - xcb*dphidyt;
800 dphidxib = dphidxibt + dphidxibu;
801 dphidyib = dphidyibt + dphidyibu;
802 dphidzib = dphidzibt + dphidzibu;
803 dphidxic = dphidxict + dphidxicu;
804 dphidyic = dphidyict + dphidyicu;
805 dphidzic = dphidzict + dphidzicu;
806 dphidxid = zcb*dphidyu - ycb*dphidzu;
807 dphidyid = xcb*dphidzu - zcb*dphidxu;
808 dphidzid = ycb*dphidxu - xcb*dphidyu;
809
810 dxiaxia = rcbxt*dphidxia;
811 dxiayia = rcbxt*dphidyia - zcb*rcb/rt2;
812 dxiazia = rcbxt*dphidzia + ycb*rcb/rt2;
813 dxiaxib = rcbxt*dphidxibt + xcb*(zca*ycb-yca*zcb)/rcbt2;
814 dxiayib = rcbxt*dphidyibt + dphidzt + (xca*zcb*xcb+zca*yzcb2)/rcbt2;
815 dxiazib = rcbxt*dphidzibt - dphidyt - (xca*ycb*xcb+yca*yzcb2)/rcbt2;
816 dxiaxic = rcbxt*dphidxict + xcb*xt/rcbt2;
817 dxiayic = rcbxt*dphidyict - dphidzt - (xba*zcb*xcb+zba*yzcb2)/rcbt2;
818 dxiazic = rcbxt*dphidzict + dphidyt + (xba*ycb*xcb+yba*yzcb2)/rcbt2;
819 dxiaxid = 0.0;
820 dxiayid = 0.0;
821 dxiazid = 0.0;
822 dyiayia = rcbyt*dphidyia;
823 dyiazia = rcbyt*dphidzia - xcb*rcb/rt2;
824 dyiaxib = rcbyt*dphidxibt - dphidzt - (yca*zcb*ycb+zca*xzcb2)/rcbt2;
825 dyiayib = rcbyt*dphidyibt + ycb*(xca*zcb-zca*xcb)/rcbt2;
826 dyiazib = rcbyt*dphidzibt + dphidxt + (yca*xcb*ycb+xca*xzcb2)/rcbt2;
827 dyiaxic = rcbyt*dphidxict + dphidzt + (yba*zcb*ycb+zba*xzcb2)/rcbt2;
828 dyiayic = rcbyt*dphidyict + ycb*yt/rcbt2;
829 dyiazic = rcbyt*dphidzict - dphidxt - (yba*xcb*ycb+xba*xzcb2)/rcbt2;
830 dyiaxid = 0.0;
831 dyiayid = 0.0;
832 dyiazid = 0.0;
833 dziazia = rcbzt*dphidzia;
834 dziaxib = rcbzt*dphidxibt + dphidyt + (zca*ycb*zcb+yca*xycb2)/rcbt2;
835 dziayib = rcbzt*dphidyibt - dphidxt - (zca*xcb*zcb+xca*xycb2)/rcbt2;
836 dziazib = rcbzt*dphidzibt + zcb*(yca*xcb-xca*ycb)/rcbt2;
837 dziaxic = rcbzt*dphidxict - dphidyt - (zba*ycb*zcb+yba*xycb2)/rcbt2;
838 dziayic = rcbzt*dphidyict + dphidxt + (zba*xcb*zcb+xba*xycb2)/rcbt2;
839 dziazic = rcbzt*dphidzict + zcb*zt/rcbt2;
840 dziaxid = 0.0;
841 dziayid = 0.0;
842 dziazid = 0.0;
843 dxibxic = -xcb*dphidxib/(rcb*rcb) - (yca*(zba*xcb+yt)-zca*(yba*xcb-zt))/rcbt2
844 - 2.0*(yt*zba-yba*zt)*dphidxibt/rt2 - (zdc*(ydb*xcb+zu)-ydc*(zdb*xcb-yu))/rcbu2
845 + 2.0*(yu*zdb-ydb*zu)*dphidxibu/ru2;
846 dxibyic = -ycb*dphidxib/(rcb*rcb) + dphidzt + dphidzu - (yca*(zba*ycb-xt)+zca*(xba*xcb+zcb*zba))/rcbt2
847 - 2.0*(zt*xba-zba*xt)*dphidxibt/rt2 + (zdc*(xdb*xcb+zcb*zdb)+ydc*(zdb*ycb+xu))/rcbu2
848 + 2.0*(zu*xdb-zdb*xu)*dphidxibu/ru2;
849 dxibxid = rcbxu*dphidxibu + xcb*xu/rcbu2;
850 dxibyid = rcbyu*dphidxibu - dphidzu - (ydc*zcb*ycb+zdc*xzcb2)/rcbu2;
851 dxibzid = rcbzu*dphidxibu + dphidyu + (zdc*ycb*zcb+ydc*xycb2)/rcbu2;
852 dyibzib = ycb*dphidzib/(rcb*rcb) - (xca*(xca*xcb+zcb*zca)+yca*(ycb*xca+zt))/rcbt2
853 - 2.0*(xt*zca-xca*zt)*dphidzibt/rt2 + (ydc*(xdc*ycb-zu)+xdc*(xdc*xcb+zcb*zdc))/rcbu2
854 + 2.0*(xu*zdc-xdc*zu)*dphidzibu/ru2;
855 dyibxic = -xcb*dphidyib/(rcb*rcb) - dphidzt - dphidzu + (xca*(zba*xcb+yt)+zca*(zba*zcb+ycb*yba))/rcbt2
856 - 2.0*(yt*zba-yba*zt)*dphidyibt/rt2 - (zdc*(zdb*zcb+ycb*ydb)+xdc*(zdb*xcb-yu))/rcbu2
857 + 2.0*(yu*zdb-ydb*zu)*dphidyibu/ru2;
858 dyibyic = -ycb*dphidyib/(rcb*rcb)- (zca*(xba*ycb+zt)-xca*(zba*ycb-xt))/rcbt2
859 - 2.0*(zt*xba-zba*xt)*dphidyibt/rt2 - (xdc*(zdb*ycb+xu)-zdc*(xdb*ycb-zu))/rcbu2
860 + 2.0*(zu*xdb-zdb*xu)*dphidyibu/ru2;
861 dyibxid = rcbxu*dphidyibu + dphidzu + (xdc*zcb*xcb+zdc*yzcb2)/rcbu2;
862 dyibyid = rcbyu*dphidyibu + ycb*yu/rcbu2;
863 dyibzid = rcbzu*dphidyibu - dphidxu - (zdc*xcb*zcb+xdc*xycb2)/rcbu2;
864 dzibxic = -xcb*dphidzib/(rcb*rcb) + dphidyt + dphidyu - (xca*(yba*xcb-zt)+yca*(zba*zcb+ycb*yba))/rcbt2
865 - 2.0*(yt*zba-yba*zt)*dphidzibt/rt2 + (ydc*(zdb*zcb+ycb*ydb)+xdc*(ydb*xcb+zu))/rcbu2
866 + 2.0*(yu*zdb-ydb*zu)*dphidzibu/ru2;
867 dzibzic = -zcb*dphidzib/(rcb*rcb) - (xca*(yba*zcb+xt)-yca*(xba*zcb-yt))/rcbt2
868 - 2.0*(xt*yba-xba*yt)*dphidzibt/rt2 - (ydc*(xdb*zcb+yu)-xdc*(ydb*zcb-xu))/rcbu2
869 + 2.0*(xu*ydb-xdb*yu)*dphidzibu/ru2;
870 dzibxid = rcbxu*dphidzibu - dphidyu - (xdc*ycb*xcb+ydc*yzcb2)/rcbu2;
871 dzibyid = rcbyu*dphidzibu + dphidxu + (ydc*xcb*ycb+xdc*xzcb2)/rcbu2;
872 dzibzid = rcbzu*dphidzibu + zcb*zu/rcbu2;
873 dxicxid = rcbxu*dphidxicu - xcb*(zdb*ycb-ydb*zcb)/rcbu2;
874 dxicyid = rcbyu*dphidxicu + dphidzu + (ydb*zcb*ycb+zdb*xzcb2)/rcbu2;
875 dxiczid = rcbzu*dphidxicu - dphidyu - (zdb*ycb*zcb+ydb*xycb2)/rcbu2;
876 dyicxid = rcbxu*dphidyicu - dphidzu - (xdb*zcb*xcb+zdb*yzcb2)/rcbu2;
877 dyicyid = rcbyu*dphidyicu - ycb*(xdb*zcb-zdb*xcb)/rcbu2;
878 dyiczid = rcbzu*dphidyicu + dphidxu + (zdb*xcb*zcb+xdb*xycb2)/rcbu2;
879 dzicxid = rcbxu*dphidzicu + dphidyu + (xdb*ycb*xcb+ydb*yzcb2)/rcbu2;
880 dzicyid = rcbyu*dphidzicu - dphidxu - (ydb*xcb*ycb+xdb*xzcb2)/rcbu2;
881 dziczid = rcbzu*dphidzicu - zcb*(ydb*xcb-xdb*ycb)/rcbu2;
882 dxidxid = rcbxu*dphidxid;
883 dxidyid = rcbxu*dphidyid + zcb*rcb/ru2;
884 dxidzid = rcbxu*dphidzid - ycb*rcb/ru2;
885 dyidyid = rcbyu*dphidyid;
886 dyidzid = rcbyu*dphidzid + xcb*rcb/ru2;
887 dzidzid = rcbzu*dphidzid;
888
889 dxibxib = -dxiaxib - dxibxic - dxibxid;
890 dxibyib = -dyiaxib - dxibyic - dxibyid;
891 dxibzib = -dxiazib - dzibxic - dzibxid;
892 dxibzic = -dziaxib - dxibzib - dxibzid;
893 dyibyib = -dyiayib - dyibyic - dyibyid;
894 dyibzic = -dziayib - dyibzib - dyibzid;
895 dzibzib = -dziazib - dzibzic - dzibzid;
896 dzibyic = -dyiazib - dyibzib - dzibyid;
897 dxicxic = -dxiaxic - dxibxic - dxicxid;
898 dxicyic = -dyiaxic - dyibxic - dxicyid;
899 dxiczic = -dziaxic - dzibxic - dxiczid;
900 dyicyic = -dyiayic - dyibyic - dyicyid;
901 dyiczic = -dziayic - dzibyic - dyiczid;
902 dziczic = -dziazic - dzibzic - dziczid;
903
904 if (iatom == ia)
905 {
906 hess.hessx[ia][0] += dedphi*dxiaxia + d2edphi2*dphidxia*dphidxia;
907 hess.hessy[ia][0] += dedphi*dxiayia + d2edphi2*dphidxia*dphidyia;
908 hess.hessz[ia][0] += dedphi*dxiazia + d2edphi2*dphidxia*dphidzia;
909 hess.hessx[ia][1] += dedphi*dxiayia + d2edphi2*dphidxia*dphidyia;
910 hess.hessy[ia][1] += dedphi*dyiayia + d2edphi2*dphidyia*dphidyia;
911 hess.hessz[ia][1] += dedphi*dyiazia + d2edphi2*dphidyia*dphidzia;
912 hess.hessx[ia][2] += dedphi*dxiazia + d2edphi2*dphidxia*dphidzia;
913 hess.hessy[ia][2] += dedphi*dyiazia + d2edphi2*dphidyia*dphidzia;
914 hess.hessz[ia][2] += dedphi*dziazia + d2edphi2*dphidzia*dphidzia;
915 hess.hessx[ib][0] += dedphi*dxiaxib + d2edphi2*dphidxia*dphidxib;
916 hess.hessy[ib][0] += dedphi*dyiaxib + d2edphi2*dphidyia*dphidxib;
917 hess.hessz[ib][0] += dedphi*dziaxib + d2edphi2*dphidzia*dphidxib;
918 hess.hessx[ib][1] += dedphi*dxiayib + d2edphi2*dphidxia*dphidyib;
919 hess.hessy[ib][1] += dedphi*dyiayib + d2edphi2*dphidyia*dphidyib;
920 hess.hessz[ib][1] += dedphi*dziayib + d2edphi2*dphidzia*dphidyib;
921 hess.hessx[ib][2] += dedphi*dxiazib + d2edphi2*dphidxia*dphidzib;
922 hess.hessy[ib][2] += dedphi*dyiazib + d2edphi2*dphidyia*dphidzib;
923 hess.hessz[ib][2] += dedphi*dziazib + d2edphi2*dphidzia*dphidzib;
924 hess.hessx[ic][0] += dedphi*dxiaxic + d2edphi2*dphidxia*dphidxic;
925 hess.hessy[ic][0] += dedphi*dyiaxic + d2edphi2*dphidyia*dphidxic;
926 hess.hessz[ic][0] += dedphi*dziaxic + d2edphi2*dphidzia*dphidxic;
927 hess.hessx[ic][1] += dedphi*dxiayic + d2edphi2*dphidxia*dphidyic;
928 hess.hessy[ic][1] += dedphi*dyiayic + d2edphi2*dphidyia*dphidyic;
929 hess.hessz[ic][1] += dedphi*dziayic + d2edphi2*dphidzia*dphidyic;
930 hess.hessx[ic][2] += dedphi*dxiazic + d2edphi2*dphidxia*dphidzic;
931 hess.hessy[ic][2] += dedphi*dyiazic + d2edphi2*dphidyia*dphidzic;
932 hess.hessz[ic][2] += dedphi*dziazic + d2edphi2*dphidzia*dphidzic;
933 hess.hessx[id][0] += dedphi*dxiaxid + d2edphi2*dphidxia*dphidxid;
934 hess.hessy[id][0] += dedphi*dyiaxid + d2edphi2*dphidyia*dphidxid;
935 hess.hessz[id][0] += dedphi*dziaxid + d2edphi2*dphidzia*dphidxid;
936 hess.hessx[id][1] += dedphi*dxiayid + d2edphi2*dphidxia*dphidyid;
937 hess.hessy[id][1] += dedphi*dyiayid + d2edphi2*dphidyia*dphidyid;
938 hess.hessz[id][1] += dedphi*dziayid + d2edphi2*dphidzia*dphidyid;
939 hess.hessx[id][2] += dedphi*dxiazid + d2edphi2*dphidxia*dphidzid;
940 hess.hessy[id][2] += dedphi*dyiazid + d2edphi2*dphidyia*dphidzid;
941 hess.hessz[id][2] += dedphi*dziazid + d2edphi2*dphidzia*dphidzid;
942 }else if (iatom == ib)
943 {
944 hess.hessx[ib][0] += dedphi*dxibxib + d2edphi2*dphidxib*dphidxib;
945 hess.hessy[ib][0] += dedphi*dxibyib + d2edphi2*dphidxib*dphidyib;
946 hess.hessz[ib][0] += dedphi*dxibzib + d2edphi2*dphidxib*dphidzib;
947 hess.hessx[ib][1] += dedphi*dxibyib + d2edphi2*dphidxib*dphidyib;
948 hess.hessy[ib][1] += dedphi*dyibyib + d2edphi2*dphidyib*dphidyib;
949 hess.hessz[ib][1] += dedphi*dyibzib + d2edphi2*dphidyib*dphidzib;
950 hess.hessx[ib][2] += dedphi*dxibzib + d2edphi2*dphidxib*dphidzib;
951 hess.hessy[ib][2] += dedphi*dyibzib + d2edphi2*dphidyib*dphidzib;
952 hess.hessz[ib][2] += dedphi*dzibzib + d2edphi2*dphidzib*dphidzib;
953 hess.hessx[ia][0] += dedphi*dxiaxib + d2edphi2*dphidxib*dphidxia;
954 hess.hessy[ia][0] += dedphi*dxiayib + d2edphi2*dphidyib*dphidxia;
955 hess.hessz[ia][0] += dedphi*dxiazib + d2edphi2*dphidzib*dphidxia;
956 hess.hessx[ia][1] += dedphi*dyiaxib + d2edphi2*dphidxib*dphidyia;
957 hess.hessy[ia][1] += dedphi*dyiayib + d2edphi2*dphidyib*dphidyia;
958 hess.hessz[ia][1] += dedphi*dyiazib + d2edphi2*dphidzib*dphidyia;
959 hess.hessx[ia][2] += dedphi*dziaxib + d2edphi2*dphidxib*dphidzia;
960 hess.hessy[ia][2] += dedphi*dziayib + d2edphi2*dphidyib*dphidzia;
961 hess.hessz[ia][2] += dedphi*dziazib + d2edphi2*dphidzib*dphidzia;
962 hess.hessx[ic][0] += dedphi*dxibxic + d2edphi2*dphidxib*dphidxic;
963 hess.hessy[ic][0] += dedphi*dyibxic + d2edphi2*dphidyib*dphidxic;
964 hess.hessz[ic][0] += dedphi*dzibxic + d2edphi2*dphidzib*dphidxic;
965 hess.hessx[ic][1] += dedphi*dxibyic + d2edphi2*dphidxib*dphidyic;
966 hess.hessy[ic][1] += dedphi*dyibyic + d2edphi2*dphidyib*dphidyic;
967 hess.hessz[ic][1] += dedphi*dzibyic + d2edphi2*dphidzib*dphidyic;
968 hess.hessx[ic][2] += dedphi*dxibzic + d2edphi2*dphidxib*dphidzic;
969 hess.hessy[ic][2] += dedphi*dyibzic + d2edphi2*dphidyib*dphidzic;
970 hess.hessz[ic][2] += dedphi*dzibzic + d2edphi2*dphidzib*dphidzic;
971 hess.hessx[id][0] += dedphi*dxibxid + d2edphi2*dphidxib*dphidxid;
972 hess.hessy[id][0] += dedphi*dyibxid + d2edphi2*dphidyib*dphidxid;
973 hess.hessz[id][0] += dedphi*dzibxid + d2edphi2*dphidzib*dphidxid;
974 hess.hessx[id][1] += dedphi*dxibyid + d2edphi2*dphidxib*dphidyid;
975 hess.hessy[id][1] += dedphi*dyibyid + d2edphi2*dphidyib*dphidyid;
976 hess.hessz[id][1] += dedphi*dzibyid + d2edphi2*dphidzib*dphidyid;
977 hess.hessx[id][2] += dedphi*dxibzid + d2edphi2*dphidxib*dphidzid;
978 hess.hessy[id][2] += dedphi*dyibzid + d2edphi2*dphidyib*dphidzid;
979 hess.hessz[id][2] += dedphi*dzibzid + d2edphi2*dphidzib*dphidzid;
980 }else if (iatom == ic)
981 {
982 hess.hessx[ic][0] += dedphi*dxicxic + d2edphi2*dphidxic*dphidxic;
983 hess.hessy[ic][0] += dedphi*dxicyic + d2edphi2*dphidxic*dphidyic;
984 hess.hessz[ic][0] += dedphi*dxiczic + d2edphi2*dphidxic*dphidzic;
985 hess.hessx[ic][1] += dedphi*dxicyic + d2edphi2*dphidxic*dphidyic;
986 hess.hessy[ic][1] += dedphi*dyicyic + d2edphi2*dphidyic*dphidyic;
987 hess.hessz[ic][1] += dedphi*dyiczic + d2edphi2*dphidyic*dphidzic;
988 hess.hessx[ic][2] += dedphi*dxiczic + d2edphi2*dphidxic*dphidzic;
989 hess.hessy[ic][2] += dedphi*dyiczic + d2edphi2*dphidyic*dphidzic;
990 hess.hessz[ic][2] += dedphi*dziczic + d2edphi2*dphidzic*dphidzic;
991 hess.hessx[ia][0] += dedphi*dxiaxic + d2edphi2*dphidxic*dphidxia;
992 hess.hessy[ia][0] += dedphi*dxiayic + d2edphi2*dphidyic*dphidxia;
993 hess.hessz[ia][0] += dedphi*dxiazic + d2edphi2*dphidzic*dphidxia;
994 hess.hessx[ia][1] += dedphi*dyiaxic + d2edphi2*dphidxic*dphidyia;
995 hess.hessy[ia][1] += dedphi*dyiayic + d2edphi2*dphidyic*dphidyia;
996 hess.hessz[ia][1] += dedphi*dyiazic + d2edphi2*dphidzic*dphidyia;
997 hess.hessx[ia][2] += dedphi*dziaxic + d2edphi2*dphidxic*dphidzia;
998 hess.hessy[ia][2] += dedphi*dziayic + d2edphi2*dphidyic*dphidzia;
999 hess.hessz[ia][2] += dedphi*dziazic + d2edphi2*dphidzic*dphidzia;
1000 hess.hessx[ib][0] += dedphi*dxibxic + d2edphi2*dphidxic*dphidxib;
1001 hess.hessy[ib][0] += dedphi*dxibyic + d2edphi2*dphidyic*dphidxib;
1002 hess.hessz[ib][0] += dedphi*dxibzic + d2edphi2*dphidzic*dphidxib;
1003 hess.hessx[ib][1] += dedphi*dyibxic + d2edphi2*dphidxic*dphidyib;
1004 hess.hessy[ib][1] += dedphi*dyibyic + d2edphi2*dphidyic*dphidyib;
1005 hess.hessz[ib][1] += dedphi*dyibzic + d2edphi2*dphidzic*dphidyib;
1006 hess.hessx[ib][2] += dedphi*dzibxic + d2edphi2*dphidxic*dphidzib;
1007 hess.hessy[ib][2] += dedphi*dzibyic + d2edphi2*dphidyic*dphidzib;
1008 hess.hessz[ib][2] += dedphi*dzibzic + d2edphi2*dphidzic*dphidzib;
1009 hess.hessx[id][0] += dedphi*dxicxid + d2edphi2*dphidxic*dphidxid;
1010 hess.hessy[id][0] += dedphi*dyicxid + d2edphi2*dphidyic*dphidxid;
1011 hess.hessz[id][0] += dedphi*dzicxid + d2edphi2*dphidzic*dphidxid;
1012 hess.hessx[id][1] += dedphi*dxicyid + d2edphi2*dphidxic*dphidyid;
1013 hess.hessy[id][1] += dedphi*dyicyid + d2edphi2*dphidyic*dphidyid;
1014 hess.hessz[id][1] += dedphi*dzicyid + d2edphi2*dphidzic*dphidyid;
1015 hess.hessx[id][2] += dedphi*dxiczid + d2edphi2*dphidxic*dphidzid;
1016 hess.hessy[id][2] += dedphi*dyiczid + d2edphi2*dphidyic*dphidzid;
1017 hess.hessz[id][2] += dedphi*dziczid + d2edphi2*dphidzic*dphidzid;
1018 }else if (iatom == id)
1019 {
1020 hess.hessx[id][0] += dedphi*dxidxid + d2edphi2*dphidxid*dphidxid;
1021 hess.hessy[id][0] += dedphi*dxidyid + d2edphi2*dphidxid*dphidyid;
1022 hess.hessz[id][0] += dedphi*dxidzid + d2edphi2*dphidxid*dphidzid;
1023 hess.hessx[id][1] += dedphi*dxidyid + d2edphi2*dphidxid*dphidyid;
1024 hess.hessy[id][1] += dedphi*dyidyid + d2edphi2*dphidyid*dphidyid;
1025 hess.hessz[id][1] += dedphi*dyidzid + d2edphi2*dphidyid*dphidzid;
1026 hess.hessx[id][2] += dedphi*dxidzid + d2edphi2*dphidxid*dphidzid;
1027 hess.hessy[id][2] += dedphi*dyidzid + d2edphi2*dphidyid*dphidzid;
1028 hess.hessz[id][2] += dedphi*dzidzid + d2edphi2*dphidzid*dphidzid;
1029 hess.hessx[ia][0] += dedphi*dxiaxid + d2edphi2*dphidxid*dphidxia;
1030 hess.hessy[ia][0] += dedphi*dxiayid + d2edphi2*dphidyid*dphidxia;
1031 hess.hessz[ia][0] += dedphi*dxiazid + d2edphi2*dphidzid*dphidxia;
1032 hess.hessx[ia][1] += dedphi*dyiaxid + d2edphi2*dphidxid*dphidyia;
1033 hess.hessy[ia][1] += dedphi*dyiayid + d2edphi2*dphidyid*dphidyia;
1034 hess.hessz[ia][1] += dedphi*dyiazid + d2edphi2*dphidzid*dphidyia;
1035 hess.hessx[ia][2] += dedphi*dziaxid + d2edphi2*dphidxid*dphidzia;
1036 hess.hessy[ia][2] += dedphi*dziayid + d2edphi2*dphidyid*dphidzia;
1037 hess.hessz[ia][2] += dedphi*dziazid + d2edphi2*dphidzid*dphidzia;
1038 hess.hessx[ib][0] += dedphi*dxibxid + d2edphi2*dphidxid*dphidxib;
1039 hess.hessy[ib][0] += dedphi*dxibyid + d2edphi2*dphidyid*dphidxib;
1040 hess.hessz[ib][0] += dedphi*dxibzid + d2edphi2*dphidzid*dphidxib;
1041 hess.hessx[ib][1] += dedphi*dyibxid + d2edphi2*dphidxid*dphidyib;
1042 hess.hessy[ib][1] += dedphi*dyibyid + d2edphi2*dphidyid*dphidyib;
1043 hess.hessz[ib][1] += dedphi*dyibzid + d2edphi2*dphidzid*dphidyib;
1044 hess.hessx[ib][2] += dedphi*dzibxid + d2edphi2*dphidxid*dphidzib;
1045 hess.hessy[ib][2] += dedphi*dzibyid + d2edphi2*dphidyid*dphidzib;
1046 hess.hessz[ib][2] += dedphi*dzibzid + d2edphi2*dphidzid*dphidzib;
1047 hess.hessx[ic][0] += dedphi*dxicxid + d2edphi2*dphidxid*dphidxic;
1048 hess.hessy[ic][0] += dedphi*dxicyid + d2edphi2*dphidyid*dphidxic;
1049 hess.hessz[ic][0] += dedphi*dxiczid + d2edphi2*dphidzid*dphidxic;
1050 hess.hessx[ic][1] += dedphi*dyicxid + d2edphi2*dphidxid*dphidyic;
1051 hess.hessy[ic][1] += dedphi*dyicyid + d2edphi2*dphidyid*dphidyic;
1052 hess.hessz[ic][1] += dedphi*dyiczid + d2edphi2*dphidzid*dphidyic;
1053 hess.hessx[ic][2] += dedphi*dzicxid + d2edphi2*dphidxid*dphidzic;
1054 hess.hessy[ic][2] += dedphi*dzicyid + d2edphi2*dphidyid*dphidzic;
1055 hess.hessz[ic][2] += dedphi*dziczid + d2edphi2*dphidzid*dphidzic;
1056 }
1057 }
1058 }
1059 }
1060
1061 // fixed torsion
1062 for (i=0; i < fxtor.nfxtor; i++)
1063 {
1064 ia = fxtor.iatom[i][0];
1065 ib = fxtor.iatom[i][1];
1066 ic = fxtor.iatom[i][2];
1067 id = fxtor.iatom[i][3];
1068 if (ia == iatom || ib == iatom || ic == iatom || id == iatom)
1069 {
1070 xia = atom[ia].x;
1071 yia = atom[ia].y;
1072 zia = atom[ia].z;
1073 xib = atom[ib].x;
1074 yib = atom[ib].y;
1075 zib = atom[ib].z;
1076 xic = atom[ic].x;
1077 yic = atom[ic].y;
1078 zic = atom[ic].z;
1079 xid = atom[id].x;
1080 yid = atom[id].y;
1081 zid = atom[id].z;
1082 xba = xib - xia;
1083 yba = yib - yia;
1084 zba = zib - zia;
1085 xcb = xic - xib;
1086 ycb = yic - yib;
1087 zcb = zic - zib;
1088 xdc = xid - xic;
1089 ydc = yid - yic;
1090 zdc = zid - zic;
1091 xt = yba*zcb - ycb*zba;
1092 yt = zba*xcb - zcb*xba;
1093 zt = xba*ycb - xcb*yba;
1094 xu = ycb*zdc - ydc*zcb;
1095 yu = zcb*xdc - zdc*xcb;
1096 zu = xcb*ydc - xdc*ycb;
1097 xtu = yt*zu - yu*zt;
1098 ytu = zt*xu - zu*xt;
1099 ztu = xt*yu - xu*yt;
1100 rt2 = xt*xt + yt*yt + zt*zt;
1101 ru2 = xu*xu + yu*yu + zu*zu;
1102 rt2ru2 = rt2*ru2;
1103 rtru = sqrt(rt2 * ru2);
1104 if (rtru != 0.0)
1105 {
1106 rcb = sqrt(xcb*xcb + ycb*ycb + zcb*zcb);
1107 cosine = (xt*xu + yt*yu + zt*zu) / rtru;
1108
1109 curang = fxtor.curr_ang[i];
1110 if (curang > 360)
1111 curang %= 360;
1112
1113 if (curang > 180)
1114 agl = -(360.0 - (double)curang -radian*acos(cosine));
1115 else if (fxtor.curr_ang[i] < 0)
1116 agl = -(double)curang -radian*acos(cosine);
1117 else
1118 agl = (double)curang-radian*acos(cosine);
1119
1120 cosm = cos(agl/radian);
1121 sinm = sin(agl/radian);
1122
1123 v1 = 2600.0;
1124 s1 = 1.0;
1125 phi1 = s1*(1.0-cosm);
1126
1127 dedphi = units.torsunit*v1*sinm;
1128 d2edphi2 = units.torsunit*v1*cosm;
1129
1130 dot = xt*xu + yt*yu + zt*zu;
1131 denom2 = 1.0-((dot*dot)/(rt2*ru2));
1132 denom = sqrt(denom2);
1133 // if (denom < 0.00001)
1134 // denom = 0.00001;
1135 denom3 = denom2*denom;
1136
1137 xca = xic - xia;
1138 yca = yic - yia;
1139 zca = zic - zia;
1140 xdb = xid - xib;
1141 ydb = yid - yib;
1142 zdb = zid - zib;
1143
1144 dphidxt = (yt*zcb - ycb*zt);
1145 dphidyt = (zt*xcb - zcb*xt);
1146 dphidzt = (xt*ycb - xcb*yt);
1147 dphidxu = (yu*zcb - ycb*zu);
1148 dphidyu = (zu*xcb - zcb*xu);
1149 dphidzu = (xu*ycb - xcb*yu);
1150
1151 dphidxt1 = (yt*zdc - ydc*zt);
1152 dphidyt1 = (zt*xdc - zdc*xt);
1153 dphidzt1 = (xt*ydc - xdc*yt);
1154 dphidxu1 = (yu*zdc - ydc*zu);
1155 dphidyu1 = (zu*xdc - zdc*xu);
1156 dphidzu1 = (xu*ydc - xdc*yu);
1157
1158 zdcyu = zdc*yu-ydc*zu;
1159 xdczu = xdc*zu-zdc*xu;
1160 ydcxu = ydc*xu-xdc*yu;
1161 ycazt = zt*yca-yt*zca;
1162 zcaxt = xt*zca-zt*xca;
1163 xcayt = yt*xca-xt*yca;
1164 rtru32 = rtru*rt2ru2;
1165 rtru322 = 2.0*rtru*rt2ru2;
1166
1167 // diagonal terms
1168 term1 = dphidxu/rtru - (dphidxt*dot*ru2)/(rtru*rt2ru2);
1169 term2 = (3.0*4.0*dphidxt*dphidxt*dot)/(4.0*rt2*rt2*rtru) - (2.0*dphidxt*dphidxu)/(rt2*rtru)
1170 -( (zcb*zcb+ycb*ycb)*dot)/(rt2*rtru);
1171 term3 = ( (2.0*dphidxt*dot*dot)/(rt2*rt2*ru2) - (2.0*dphidxu*dot)/rt2ru2 )*(term1);
1172 dxiaxia = (d2edphi2*term1*term1)/(denom2) + (dedphi*term2)/denom - (dedphi*term3)/(2.0*denom3);
1173 //
1174 term1 = dphidyu/rtru - (dphidyt*dot*ru2)/(rtru*rt2ru2);
1175
1176 term2 = (3.0*4.0*dphidyt*dphidyt*dot*ru2*ru2)/(4.0*rt2ru2*rt2ru2*rtru) - (2.0*dphidyt*dphidyu*ru2)/(rt2ru2*rtru)
1177 -( (zcb*zcb+xcb*xcb)*dot*ru2)/(rt2ru2*rtru);
1178 term3 = ( (2.0*dphidyt*dot*dot)/(rt2*rt2*ru2) - (2.0*dphidyu*dot)/rt2ru2 )*(term1);
1179 dyiayia = (d2edphi2*term1*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1180 //
1181 term1 = dphidzu/rtru - (dphidzt*dot*ru2)/(rtru*rt2ru2);
1182 term2 = (3.0*4.0*dphidzt*dphidzt*dot*ru2*ru2)/(4.0*rt2ru2*rt2ru2*rtru) - (2.0*dphidzt*dphidzu*ru2)/(rt2ru2*rtru)
1183 -( (ycb*ycb+xcb*xcb)*dot*ru2)/(rt2ru2*rtru);
1184 term3 = ( (2.0*dphidzt*dot*dot)/(rt2*rt2*ru2) - (2.0*dphidzu*dot)/rt2ru2 )*(term1);
1185 dziazia = (d2edphi2*term1*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1186 //
1187 term1 = (yt*zdc-zt*ydc+zu*yca-yu*zca)/rtru -(dot*(rt2*2.0*(zdcyu)+ru2*2.0*(ycazt)))/(rtru322);
1188 term2 = -(2.0*(ydc*yca+zdc*zca))/rtru
1189 -(dot*( 2.0*rt2*(ydc*ydc+zdc*zdc) + (8.0*(ycazt)*(zdcyu))
1190 +(yca*yca+zca*zca)*ru2*2.0) )/(2.0*rt2ru2*rtru)
1191 -( (yt*zdc-zt*ydc+zu*yca-yu*zca)*( rt2*2.0*(zdcyu)+ru2*2.0*(ycazt) ))/(rt2ru2*rtru)
1192 +(3.0*dot*(rt2*2.0*(zdcyu)+ru2*2.0*(ycazt))
1193 *( rt2*2.0*(zdcyu)+ru2*2.0*(ycazt)) )/(4.0*rt2ru2*rt2ru2*rtru);
1194 term3 = ( (2.0*(zdcyu)*dot*dot)/(rt2*ru2*ru2)
1195 -(2.0*(yt*zdc-zt*ydc+zu*yca-yu*zca)*dot)/rt2ru2
1196 +(2.0*(ycazt)*dot*dot)/(rt2*rt2*ru2) )*(term1);
1197 dxibxib = (d2edphi2*term1*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1198 //
1199 term1 = (zt*xdc-xt*zdc+xu*zca-zu*xca)/rtru - (dot*(rt2*2.0*(xdczu)+ru2*2.0*(zcaxt)))/(rtru322);
1200 term2 = -(2.0*(zdc*zca+xdc*xca))/rtru
1201 -( dot*(2.0*rt2*(xdc*xdc+zdc*zdc)+(8.0*(zcaxt)*(xdczu))+2.0*ru2*(xca*xca+zca*zca) ) )/(2.0*rt2ru2*rtru)
1202 -( (zt*xdc-xt*zdc+xu*zca-zu*xca)*(rt2*2.0*(xdczu)+ru2*2.0*(zcaxt)) )/(rt2ru2*rtru)
1203 +3.0*dot*(rt2*2.0*(xdczu)+ru2*2.0*(zcaxt))
1204 *(rt2*2.0*(xdczu)+ru2*2.0*(zcaxt))/(4.0*rt2ru2*rt2ru2*rtru);
1205 term3 = ( (2.0*(xdczu)*dot*dot)/(rt2*ru2*ru2)
1206 -(2.0*(zt*xdc-xt*zdc+xu*zca-zu*xca)*dot)/rt2ru2
1207 +(2.0*(zcaxt)*dot*dot)/(rt2*rt2*ru2) )*(term1);
1208 dyibyib = (d2edphi2*term1*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1209 //
1210 term1 = (xt*ydc-yt*xdc+yu*xca-xu*yca)/rtru -(dot*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt)))/(rtru322);
1211 term2 = -(2.0*(ydc*yca+xdc*xca))/rtru
1212 -(dot*( 2.0*rt2*(ydc*ydc+xdc*xdc) + (2.0*(2.0*yt*xca-2.0*xt*yca)*(2.0*ydc*xu-2.0*xdc*yu))
1213 +(2.0*yca*yca+2.0*xca*xca)*ru2) )/(2.0*rt2ru2*rtru)
1214 -( (xt*ydc - yt*xdc + yu*xca - xu*yca)*( (rt2*(2.0*ydc*xu-2.0*xdc*yu))+(ru2*(2.0*yt*xca-2.0*xt*yca)) ))/
1215 (rt2ru2*rtru)
1216 +(3.0*dot*(rt2*(2.0*ydc*xu-2.0*xdc*yu)+ru2*(2.0*yt*xca-2.0*xt*yca))
1217 *( rt2*(2.0*ydc*xu-2.0*xdc*yu)+ru2*(2.0*yt*xca-2.0*xt*yca)) )/(4.0*rt2ru2*rt2ru2*rtru);
1218 term3 = ( (2.0*(ydcxu)*dot*dot)/(rt2*ru2*ru2)
1219 -(2.0*(xt*ydc-yt*xdc+yu*xca-xu*yca)*dot)/rt2ru2
1220 +(2.0*(xcayt)*dot*dot)/(rt2*rt2*ru2) )*(term1);
1221 dzibzib = (d2edphi2*term1*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1222 //
1223 yuzab = yu*zba - zu*yba;
1224 zuydb = zu*ydb - yu*zdb;
1225 ytzba = yt*zba - yba*zt;
1226
1227 term1 = (zt*ydb-yt*zdb+zba*yu-zu*yba)/rtru - (dot* (rt2*(2.0*zuydb)+ru2*(2.0*ytzba)))/(2.0*rt2ru2*rtru);
1228 term2 = -(2.0*(yba*ydb+zba*zdb))/rtru
1229 -(dot*(rt2*2.0*(ydb*ydb+zdb*zdb) + 2.0*(2.0*ytzba)*(2.0*zuydb) + ru2*2.0*(yba*yba+zba*zba)))/(2.0*rt2ru2*rtru)
1230 -( (zt*ydb-yba*zu-yt*zdb+zba*yu)*(rt2*(2.0*zuydb) + ru2*(2.0*ytzba)))/(rt2ru2*rtru)
1231 +( (3.0*dot*(rt2*(2.0*zuydb) + ru2*(2.0*ytzba)))*
1232 ( rt2*(2.0*zuydb) + ru2*(2.0*ytzba)))/(4.0*rt2ru2*rt2ru2*rtru);
1233
1234 term3 = ( (dot*dot*(2.0*zuydb))/(rt2*ru2*ru2)
1235 -(2.0*dot*(zt*ydb-yba*zu-yt*zdb+zba*yu))/rt2ru2 + ((2.0*ytzba)*dot*dot)/(rt2*rt2*ru2))*( term1);
1236
1237 dxicxic = (d2edphi2*term1*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1238 //
1239 term1 = (xt*zdb-zt*xdb+zu*xba-xu*zba)/rtru - (dot*(rt2*(zdb*xu-zu*xdb)+ru2*(zt*xba-xt*zba)))/(rtru*rt2ru2);
1240 term3 = ( dot*dot*2.0*(zdb*xu-zu*xdb)/(rt2*ru2*ru2) - 2.0*dot*(xt*zdb-zt*xdb+zu*xba-xu*zba)/rt2ru2 +
1241 dot*dot*2.0*(xba*zt-xt*zba)/(rt2*rt2*ru2))*(term1);
1242
1243 term2 = 3.0*dot*(rt2*2.0*(xu*zdb-zu*xdb)+ru2*2.0*(zt*xba-xt*zba))*(rt2*2.0*(xu*zdb-zu*xdb)+ru2*2.0*(zt*xba-xt*zba))/(4.0*rt2ru2*rt2ru2*rtru)
1244 - ( dot*(rt2*2.0*(zdb*zdb+xdb*xdb)+8.0*(xba*zt-xt*zba)*(zdb*xu-zu*xdb)+ru2*2.0*(xba*xba+zba*zba) ))/(2.0*rt2ru2*rtru)
1245 - (xt*zdb-zt*xdb+zu*xba-xu*zba)*(rt2*2.0*(xu*zdb-zu*xdb)+ru2*2.0*(zt*xba-xt*zba))/(rtru*rt2ru2)
1246 - 2.0*(xba*xdb+zba*zdb)/rtru ;
1247 dyicyic = (d2edphi2*term1*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1248 //
1249 term1 = (yt*xdb-xt*ydb+xu*yba-yu*xba)/rtru -(dot*(rt2*2.0*(xdb*yu-ydb*xu)+ru2*2.0*(xt*yba-yt*xba)))/(rtru322);
1250 term2 = -(2.0*(ydb*yba+xdb*xba))/rtru
1251 -(dot*( 2.0*rt2*(ydb*ydb+xdb*xdb) + (2.0*(2.0*xt*yba-2.0*yt*xba)*(2.0*xdb*yu-2.0*ydb*xu))
1252 +(2.0*yba*yba+2.0*xba*xba)*ru2) )/(2.0*rt2ru2*rtru)
1253 -( (yt*xdb - xt*ydb + xu*yba - yu*xba)*( (rt2*(2.0*xdb*yu-2.0*ydb*xu))+(ru2*(2.0*xt*yba-2.0*yt*xba)) ))/
1254 (rt2ru2*rtru)
1255 +(3.0*dot*(rt2*2.0*(xdb*yu-ydb*xu)+ru2*2.0*(xt*yba-yt*xba))
1256 *( rt2*2.0*(xdb*yu-ydb*xu)+ru2*2.0*(xt*yba-yt*xba)) )/(4.0*rt2ru2*rt2ru2*rtru);
1257 term3 = ( (2.0*(xdb*yu-ydb*xu)*dot*dot)/(rt2*ru2*ru2) - (2.0*(yt*xdb - xt*ydb + xu*yba - yu*xba)*dot)/rt2ru2
1258 +(2.0*(xt*yba-yt*xba)*dot*dot)/(rt2*rt2*ru2) )*(term1);
1259 dziczic = (d2edphi2*term1*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1260
1261 //
1262 term1 = ( dphidxt/rtru - (dphidxu*dot*rt2)/(rtru*rt2ru2));
1263 term2 = ( (3.0*4.0*dphidxu*dphidxu*dot*rt2*rt2)/(4.0*rt2ru2*rt2ru2*rtru) - (2.0*dphidxt*dphidxu*rt2)/(rt2ru2*rtru)
1264 -( (zcb*zcb+ycb*ycb)*dot*rt2)/(rt2ru2*rtru));
1265 term3 = ( (2.0*dphidxu*dot*dot)/(rt2*ru2*ru2) - (2.0*dphidxt*dot)/rt2ru2)*(term1);
1266 dxidxid = (d2edphi2*term1*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1267 //
1268 term1 = ( dphidyt/rtru - (dphidyu*dot*rt2)/(rtru*rt2ru2));
1269 term2 = ( (3.0*4.0*dphidyu*dphidyu*dot*rt2*rt2)/(4.0*rt2ru2*rt2ru2*rtru) - (2.0*dphidyt*dphidyu*rt2)/(rt2ru2*rtru)
1270 -( (zcb*zcb+xcb*xcb)*dot*rt2)/(rt2ru2*rtru));
1271 term3 = ( (2.0*dphidyu*dot*dot)/(rt2*ru2*ru2) - (2.0*dphidyt*dot)/rt2ru2)*(term1);
1272 dyidyid = (d2edphi2*term1*term1)/denom2 + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1273 //
1274 term1 = ( dphidzt/rtru - (dphidzu*dot*rt2)/(rtru*rt2ru2));
1275 term2 = ( (3.0*4.0*dphidzu*dphidzu*dot*rt2*rt2)/(4.0*rt2ru2*rt2ru2*rtru) - (2.0*dphidzt*dphidzu*rt2)/(rt2ru2*rtru)
1276 -( (ycb*ycb+xcb*xcb)*dot*rt2)/(rt2ru2*rtru));
1277 term3 = ( (2.0*dphidzu*dot*dot)/(rt2*ru2*ru2) - (2.0*dphidzt*dot)/rt2ru2)*(term1);
1278 dzidzid = (d2edphi2*term1*term1)/denom2 + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1279 // ========================================================
1280 // off diagonal terms
1281 // ========================================================
1282 term1 = ( dphidxu/rtru - (dphidxt*dot*ru2)/(rtru32) )*
1283 ( (yt*zdc-zt*ydc+zu*yca-yu*zca)/rtru - (dot*(rt2*2.0*(zdcyu)+ru2*2.0*(ycazt)))/(rtru322) );
1284 term2 = (3.0*2.0*(zcb*yt-zt*ycb)*dot*ru2*(rt2*2.0*(zdcyu)+ru2*2.0*(ycazt)))/(4.0*rt2ru2*rt2ru2*rtru)
1285 - (dot*4.0*(zcb*yt-zt*ycb)*(zdcyu))/(2.0*rt2ru2*rtru)
1286 - (2.0*(zcb*yt-zt*ycb)*ru2*(yt*zdc-zt*ydc+zu*yca-yu*zca))/(2.0*rt2ru2*rtru)
1287 - (dot*ru2*2.0*(-yca*ycb+zca*(-zcb)))/(rtru322)
1288 - (zcb*yu-zu*ycb)*(rt2*2.0*(zdcyu)+ru2*2.0*(ycazt))/(2.0*rt2ru2*rtru)
1289 + (ycb*ydc + zcb*zdc)/rtru;
1290 term3 = ( 2.0*(zdcyu)*dot*dot/(rt2*ru2*ru2)-2.0*dot*(yt*zdc-zt*ydc+zu*yca-yu*zca)/rt2ru2
1291 + 2.0*dot*dot*(ycazt)/(rt2*rt2*ru2))*
1292 (dphidxu/rtru - (dphidxt*dot*ru2)/(rtru*rt2ru2));
1293 dxiaxib = (d2edphi2*term1)/(denom2) + (dedphi*term2)/denom - (dedphi*term3)/(2.0*denom3);
1294 //
1295 term1 = ( dphidxu/rtru - (dphidxt*dot*ru2)/(rtru*rt2ru2) )*
1296 ( (zt*xdc-xt*zdc+xu*zca-zu*xca)/rtru - (dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(zcaxt)))/(rtru322) );
1297 term3 = ( 2.0*dot*dot*(xdc*zu-xu*zdc)/(rt2*ru2*ru2)-2.0*dot*(zt*xdc-xt*zdc+xu*zca-zu*xca)/rt2ru2
1298 + 2.0*dot*dot*(zcaxt)/(rt2*rt2*ru2))*
1299 ( dphidxu/rtru - (dphidxt*dot*ru2)/(rtru*rt2ru2));
1300 term2 = (3.0*2.0*dphidxt*dot*ru2*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(zcaxt)))/(4.0*rt2ru2*rt2ru2*rtru)
1301 - ( dot*4.0*dphidxt*(xdc*zu-xu*zdc))/rtru322
1302 - ( dphidxt*2.0*ru2*(zt*xdc-xt*zdc+xu*zca-zu*xca))/rtru322
1303 - ( dot*ru2*2.0*(xca*ycb+zt))/rtru322
1304 - ( dphidxu*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(zcaxt)))/rtru322
1305 + ( xcb*ydc - 2.0*ycb*xdc)/rtru;
1306 dxiayib = (d2edphi2*term1)/(denom2) + (dedphi*term2)/denom - (dedphi*term3)/(2.0*denom3);
1307 //
1308 term1 = ( dphidxu/rtru - (dphidxt*dot*ru2)/(rtru*rt2ru2) )*
1309 ( (xt*ydc-yt*xdc+xca*yu-xu*yca)/rtru - (dot*(rt2*2.0*(xu*ydc-yu*xdc)+ru2*2.0*(xcayt)))/(rtru322) );
1310 term3 = ( 2.0*dot*dot*(xu*ydc-yu*xdc)/(rt2*ru2*ru2)-2.0*dot*(xt*ydc-yt*xdc+xca*yu-xu*yca)/rt2ru2
1311 + 2.0*dot*dot*(xcayt)/(rt2*rt2*ru2))*
1312 (dphidxu/rtru - (dphidxt*dot*ru2)/(rtru*rt2ru2));
1313 term2 = (3.0*2.0*dphidxt*dot*ru2*(rt2*2.0*(xu*ydc-yu*xdc)+ru2*2.0*(xcayt)))/(4.0*rt2ru2*rt2ru2*rtru)
1314 - ( dot*4.0*dphidxt*(xu*ydc-yu*xdc))/rtru322
1315 - ( dphidxt*2.0*ru2*(xt*ydc-yt*xdc+xca*yu-xu*yca))/rtru322
1316 - ( dot*ru2*2.0*(xca*zcb-yt))/rtru322
1317 - ( dphidxu*(rt2*2.0*(xu*ydc-yu*xdc)+ru2*2.0*(xcayt)))/rtru322
1318 + ( xcb*zdc - 2.0*zcb*xdc)/rtru;
1319 dxiazib = (d2edphi2*term1)/(denom2) + (dedphi*term2)/denom - (dedphi*term3)/(2.0*denom3);
1320 //
1321 term1 = ( dphidxu/rtru - (ru2*dot*dphidxt)/(rtru*rt2ru2))*
1322 ( (zt*ydb-yt*zdb+zba*yu-zu*yba)/rtru - (dot*(rt2*2.0*(zu*ydb-yu*zdb)+ru2*2.0*(zba*yt-zt*yba)))/(rtru322));
1323 term3 = ( 2.0*dot*dot*(zu*ydb-yu*zdb)/(rt2*ru2*ru2)-2.0*dot*(zt*ydb-yt*zdb+zba*yu-zu*yba)/rt2ru2
1324 + 2.0*dot*dot*(zba*yt-zt*yba)/(rt2*rt2*ru2))*
1325 (dphidxu/rtru - (dphidxt*dot*ru2)/(rtru*rt2ru2));
1326 term2 = (3.0*2.0*dphidxt*dot*ru2*(rt2*2.0*(zu*ydb-yu*zdb)+ru2*2.0*(zba*yt-zt*yba)))/(4.0*rt2ru2*rt2ru2*rtru)
1327 - ( 4.0*dphidxt*dot*(zu*ydb-yu*zdb))/(2.0*rt2ru2*rtru)
1328 - ( 2.0*dphidxt*ru2*(zt*ydb-yt*zdb+zba*yu-zu*yba))/(2.0*rt2ru2*rtru)
1329 - ( dot*ru2*2.0*(zba*zcb+yba*ycb))/(2.0*rt2ru2*rtru)
1330 - ( dphidxu*(rt2*2.0*(zu*ydb-yu*zdb)+ru2*2.0*(zba*yt-zt*yba)))/(rtru322)
1331 + (-ycb*ydb + zcb*(-zdb))/rtru;
1332 dxiaxic = (d2edphi2*term1)/(denom2) + (dedphi*term2)/denom - (dedphi*term3)/(2.0*denom3);
1333 //
1334 term1 = ( dphidxu/rtru - (ru2*dot*dphidxt)/(rtru*rt2ru2))*
1335 ( (xt*zdb-zt*xdb+zu*xba-xu*zba)/rtru - (dot*(rt2*2.0*(xu*zdb-zu*xdb)+ru2*2.0*(xba*zt-xt*zba)))/(rtru322));
1336 term3 = ( 2.0*dot*dot*(xu*zdb-zu*xdb)/(rt2*ru2*ru2)-2.0*dot*(xt*zdb-zt*xdb+zu*xba-xu*zba)/rt2ru2
1337 + 2.0*dot*dot*(xba*zt-xt*zba)/(rt2*rt2*ru2))*
1338 (dphidxu/rtru - (dphidxt*dot*ru2)/(rtru*rt2ru2));
1339 term2 = (3.0*2.0*dphidxt*dot*ru2*(rt2*2.0*(xu*zdb-zu*xdb)+ru2*2.0*(xba*zt-xt*zba)))/(4.0*rt2ru2*rt2ru2*rtru)
1340 - ( 4.0*dphidxt*dot*(xu*zdb-zu*xdb))/(2.0*rt2ru2*rtru)
1341 - ( 2.0*dphidxt*ru2*(xt*zdb-zt*xdb+zu*xba-xu*zba))/(2.0*rt2ru2*rtru)
1342 - ( dot*ru2*2.0*(-xba*ycb-zt))/(2.0*rt2ru2*rtru)
1343 - ( dphidxu*(rt2*2.0*(xu*zdb-zu*xdb)+ru2*2.0*(xba*zt-xt*zba)) )/(rtru322)
1344 + (xdc*ycb-xcb*ydc+xdb*ycb)/rtru;
1345 dxiayic = (d2edphi2*term1)/(denom2) + (dedphi*term2)/denom - (dedphi*term3)/(2.0*denom3);
1346 //
1347 term1 = ( dphidxu/rtru - (ru2*dot*dphidxt)/(rtru*rt2ru2))*
1348 ( (yt*xdb-xt*ydb+xu*yba-yu*xba)/rtru - (dot*(rt2*2.0*(yu*xdb-xu*ydb)+ru2*2.0*(xt*yba-yt*xba)))/(rtru322));
1349 term3 = ( 2.0*dot*dot*(yu*xdb-xu*ydb)/(rt2*ru2*ru2)-2.0*dot*(yt*xdb-xt*ydb+xu*yba-yu*xba)/rt2ru2
1350 + 2.0*dot*dot*(xt*yba-yt*xba)/(rt2*rt2*ru2))*
1351 (dphidxu/rtru - (dphidxt*dot*ru2)/(rtru*rt2ru2));
1352
1353 term2 = (3.0*2.0*dphidxt*dot*ru2*(rt2*2.0*(yu*xdb-xu*ydb)+ru2*2.0*(xt*yba-yt*xba)))/(4.0*rt2ru2*rt2ru2*rtru)
1354 - ( 4.0*dphidxt*dot*(yu*xdb-xu*ydb))/(2.0*rt2ru2*rtru)
1355 - ( 2.0*dphidxt*ru2*(yt*xdb-xt*ydb+xu*yba-yu*xba))/(2.0*rt2ru2*rtru)
1356 - ( dot*ru2*2.0*(yt-xba*zcb))/(2.0*rt2ru2*rtru)
1357 - ( dphidxu*(rt2*2.0*(yu*xdb-xu*ydb)+ru2*2.0*(xt*yba-yt*xba)) )/(rtru322)
1358 + (xdb*zcb+xdc*zcb-xcb*zdc)/rtru;
1359 dxiazic = (d2edphi2*term1)/(denom2) + (dedphi*term2)/denom - (dedphi*term3)/(2.0*denom3);
1360 //
1361 term1 = ( dphidxt/rtru - (rt2*dot*dphidxu)/(rtru*rt2ru2))*( dphidxu/rtru - (ru2*dot*dphidxt)/(rtru*rt2ru2));
1362 term3 = ( 2.0*dot*dot*dphidxu/(rt2*ru2*ru2) - 2.0*dot*dphidxt/rt2ru2)*(dphidxu/rtru - (dphidxt*dot*ru2)/(rtru*rt2ru2));
1363 term2 = (3.0*4.0*rt2*ru2*dot*dphidxt*dphidxu)/(4.0*rt2ru2*rt2ru2*rtru)
1364 - ( rt2*2.0*dphidxu*dphidxu)/(rtru322)
1365 - ( dot*4.0*dphidxt*dphidxu)/(rtru322)
1366 - ( ru2*2.0*dphidxt*dphidxt)/(rtru322)
1367 + (zcb*zcb+ycb*ycb)/rtru;
1368 dxiaxid = (d2edphi2*term1)/(denom2) + (dedphi*term2)/denom - (dedphi*term3)/(2.0*denom3);
1369 //
1370 term1 = ( dphidyt/rtru - (rt2*dot*dphidyu)/(rtru*rt2ru2))*( dphidxu/rtru - (ru2*dot*dphidxt)/(rtru*rt2ru2));
1371 term3 = ( 2.0*dot*dot*dphidyu/(rt2*ru2*ru2) - 2.0*dot*dphidyt/rt2ru2)*(dphidxu/rtru - (dphidxt*dot*ru2)/(rtru*rt2ru2));
1372 term2 = (3.0*4.0*rt2*ru2*dot*dphidxt*dphidyu)/(4.0*rt2ru2*rt2ru2*rtru)
1373 - ( rt2*2.0*dphidxu*dphidyu)/(rtru322)
1374 - ( dot*4.0*dphidxt*dphidyu)/(rtru322)
1375 - ( ru2*2.0*dphidxt*dphidyt)/(rtru322)
1376 - (xcb*ycb)/rtru;
1377 dxiayid = (d2edphi2*term1)/(denom2) + (dedphi*term2)/denom - (dedphi*term3)/(2.0*denom3);
1378 //
1379 term1 = ( dphidzt/rtru - (rt2*dot*dphidzu)/(rtru*rt2ru2))*( dphidxu/rtru - (ru2*dot*dphidxt)/(rtru*rt2ru2));
1380 term3 = ( 2.0*dot*dot*dphidzu/(rt2*ru2*ru2) - 2.0*dot*dphidzt/rt2ru2)*(dphidxu/rtru - (dphidxt*dot*ru2)/(rtru*rt2ru2));
1381 term2 = (3.0*4.0*rt2*ru2*dot*dphidxt*dphidzu)/(4.0*rt2ru2*rt2ru2*rtru)
1382 - ( rt2*2.0*dphidxu*dphidzu)/(rtru322)
1383 - ( dot*4.0*dphidxt*dphidzu)/(rtru322)
1384 - ( ru2*2.0*dphidxt*dphidzt)/(rtru322)
1385 - (xcb*zcb)/rtru;
1386 dxiazid = (d2edphi2*term1)/(denom2) + (dedphi*term2)/denom - (dedphi*term3)/(2.0*denom3);
1387 //
1388 term1 = ( dphidxu/rtru - (dphidxt*dot*ru2)/(rtru*rt2ru2) )*( dphidyu/rtru-(dot*ru2*dphidyt)/(rtru*rt2ru2) );
1389 term3 = ( 2.0*dot*dot*dphidyt/(rt2*rt2*ru2)-2.0*dot*dphidyu/rt2ru2)*(dphidxu/rtru - (dphidxt*dot*ru2)/(rtru*rt2ru2));
1390 term2 = (3.0*4.0*dphidxt*dot*ru2*ru2*dphidyt)/(4.0*rt2ru2*rt2ru2*rtru)
1391 - ( ru2*2.0*dphidyt*dphidxu)/rtru322
1392 - ( ru2*2.0*dphidyu*dphidxt)/rtru322
1393 + ( xcb*ycb*dot*ru2)/rtru32;
1394 dxiayia = (d2edphi2*term1)/(denom2) + (dedphi*term2)/denom - (dedphi*term3)/(2.0*denom3);
1395 //
1396 term1 = ( dphidxu/rtru - (dphidxt*dot*ru2)/(rtru*rt2ru2) )*( dphidzu/rtru-(dot*ru2*dphidzt)/(rtru*rt2ru2) );
1397 term3 = ( 2.0*dot*dot*dphidzt/(rt2*rt2*ru2)-2.0*dot*dphidzu/rt2ru2)*(dphidxu/rtru - (dphidxt*dot*ru2)/(rtru*rt2ru2));
1398 term2 = (3.0*4.0*dphidxt*dot*ru2*ru2*dphidzt)/(4.0*rt2ru2*rt2ru2*rtru)
1399 - ( ru2*2.0*dphidzt*dphidxu)/rtru322
1400 - ( ru2*2.0*dphidzu*dphidxt)/rtru322
1401 + ( xcb*zcb*dot*ru2)/rtru32;
1402 dxiazia = (d2edphi2*term1)/(denom2) + (dedphi*term2)/denom - (dedphi*term3)/(2.0*denom3);
1403 //
1404 term1 = ( (yt*zdc-zt*ydc+zu*yca-yu*zca)/rtru - dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/rtru322)*
1405 ( (zt*xdc-xt*zdc+xu*zca-zu*xca)/rtru - dot*(rt2*2.0*(xdczu)+ru2*2.0*(zcaxt))/rtru322);
1406 term3 = ( dot*dot*2.0*(xdczu)/(rt2*ru2*ru2) - dot*2.0*(zt*xdc-xt*zdc+xu*zca-zu*xca)/rt2ru2
1407 + dot*dot*2.0*(zcaxt)/(rt2*rt2*ru2))*
1408 ((yt*zdc-zt*ydc+zu*yca-yu*zca)/rtru - dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/rtru322);
1409 term2 = 3.0*dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))*(rt2*2.0*(xdczu)+ru2*2.0*(zcaxt))/(4.0*rt2ru2*rt2ru2*rtru)
1410 - ( dot*(-rt2*2.0*xdc*ydc + 4.0*(zcaxt)*(zdcyu) + 4.0*(yca*zt-yt*zca)*(xdczu) - 2.0*ru2*xca*yca) )/rtru322
1411 - ( (zt*xdc-xt*zdc+xu*zca-zu*xca)*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca)) )/rtru322
1412 - ( (yt*zdc-zt*ydc+zu*yca-yu*zca)*(rt2*2.0*(xdczu)+ru2*2.0*(zcaxt)) )/rtru322
1413 + (xdc*yca+xca*ydc)/rtru;
1414 dxibyib = (d2edphi2*term1)/(denom2) + (dedphi*term2)/denom - (dedphi*term3)/(2.0*denom3);
1415 //
1416 term1 = ( (yt*zdc-zt*ydc+zu*yca-yu*zca)/rtru - dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/rtru322)*
1417 ( (xt*ydc-yt*xdc+yu*xca-xu*yca)/rtru - dot*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt))/rtru322);
1418 term3 = ( dot*dot*2.0*(ydcxu)/(rt2*ru2*ru2) - dot*2.0*(xt*ydc-yt*xdc+yu*xca-xu*yca)/rt2ru2
1419 + dot*dot*2.0*(xcayt)/(rt2*rt2*ru2))*
1420 ( (yt*zdc-zt*ydc+zu*yca-yu*zca)/rtru - dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/rtru322);
1421
1422 term2 = 3.0*dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt))/(4.0*rt2ru2*rt2ru2*rtru)
1423 - ( dot*(-rt2*2.0*xdc*zdc + 4.0*(yca*zt-yt*zca)*(ydcxu) + 4.0*(xcayt)*(zdcyu) - 2.0*ru2*xca*zca))/rtru322
1424 - ( (xt*ydc-yt*xdc+yu*xca-xu*yca)*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca)))/rtru322
1425 - ( (yt*zdc-zt*ydc+zu*yca-yu*zca)*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt)))/rtru322
1426 + (xca*zdc+xdc*zca)/rtru;
1427 dxibzib = (d2edphi2*term1)/(denom2) + (dedphi*term2)/denom - (dedphi*term3)/(2.0*denom3);
1428 //
1429 term1 = ( (zt*ydb-yt*zdb+yu*zba-zu*yba)/rtru - dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba))/rtru322)*
1430 ( (yt*zdc-zt*ydc+zu*yca-yu*zca)/rtru - dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/rtru322);
1431 term3 = ( dot*dot*2.0*(ydb*zu-yu*zdb)/(rt2*ru2*ru2) - dot*2.0*(zt*ydb-yt*zdb+yu*zba-zu*yba)/rt2ru2
1432 + dot*dot*2.0*(zba*yt-zt*yba)/(rt2*rt2*ru2))*
1433 ( (yt*zdc-zt*ydc+zu*yca-yu*zca)/rtru - dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/rtru322 );
1434 term2 = 3.0*dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba))*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/(4.0*rt2ru2*rt2ru2*rtru)
1435 - ( dot*(rt2*2.0*(-ydc*ydb-zdb*zdc)+4.0*(yca*zt-yt*zca)*(ydb*zu-yu*zdb)
1436 +4.0*(zba*yt-zt*yba)*(zdcyu)+ru2*2.0*(-yba*yca-zca*zba)))/rtru322
1437 - ( (yt*zdc-zt*ydc+zu*yca-yu*zca)*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba)))/rtru322
1438 - ( (zt*ydb-yt*zdb+yu*zba-zu*yba)*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca)))/rtru322
1439 + (yca*ydb+yba*ydc+zca*zdb+zba*zdc)/rtru;
1440 dxibxic = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1441 //
1442 term1 = ( (xt*zdb-zt*xdb+zu*xba-xu*zba)/rtru - dot*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(xba*zt-xt*zba))/rtru322)*
1443 ( (yt*zdc-zt*ydc+zu*yca-yu*zca)/rtru - dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/rtru322);
1444 term3 = ( dot*dot*2.0*(zdb*xu-zu*xdb)/(rt2*ru2*ru2) - dot*2.0*(xt*zdb-zt*xdb+zu*xba-xu*zba)/rt2ru2
1445 + dot*dot*2.0*(xba*zt-xt*zba)/(rt2*rt2*ru2))*
1446 ( (yt*zdc-zt*ydc+zu*yca-yu*zca)/rtru - dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/rtru322);
1447 term2 = 3.0*dot*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(xba*zt-xt*zba))*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/(4.0*rt2ru2*rt2ru2*rtru)
1448 - ( dot*(rt2*2.0*(xdb*ydc+zu)+4.0*(xba*zt-xt*zba)*(zdcyu)+4.0*(yca*zt-yt*zca)*(zdb*xu-zu*xdb)+ru2*2.0*(xba*yca+zt)))/rtru322
1449 - ( (xt*zdb-zt*xdb+zu*xba-xu*zba)*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca)))/rtru322
1450 - ( (yt*zdc-zt*ydc+zu*yca-yu*zca)*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(xba*zt-xt*zba)))/rtru322
1451 + (xba*ycb-xcb*yba-xdb*yca-xdc*ycb-xba*ydc+xcb*ydc)/rtru;
1452 dxibyic = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1453 //
1454 term1 = ( (yt*xdb-xt*ydb+xu*yba-yu*xba)/rtru - dot*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba))/rtru322)*
1455 ( (yt*zdc-zt*ydc+zu*yca-yu*zca)/rtru - dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/rtru322 );
1456 term3 = ( dot*dot*2.0*(xdb*yu-xu*ydb)/(rt2*ru2*ru2) - dot*2.0*(yt*xdb-xt*ydb+xu*yba-yu*xba)/rt2ru2
1457 + dot*dot*2.0*(yba*xt-yt*xba)/(rt2*rt2*ru2))*
1458 ( (yt*zdc-zt*ydc+zu*yca-yu*zca)/rtru - dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/rtru322);
1459 term2 = 3.0*dot*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba))*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/(4.0*rt2ru2*rt2ru2*rtru)
1460 - ( dot*(rt2*2.0*(xdb*zdc-yu)+4.0*(yba*xt-yt*xba)*(zdcyu)+
1461 4.0*(yca*zt-yt*zca)*(xdb*yu-xu*ydb)+ru2*2.0*(xba*zca-yt)))/rtru322
1462 - ( (yt*xdb-xt*ydb+xu*yba-yu*xba)*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca)))/rtru322
1463 - ( (yt*zdc-zt*ydc+zu*yca-yu*zca)*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba)))/rtru322
1464 + (xba*zcb-xcb*zba-xdb*zca-xdc*zcb-xba*zdc+xcb*zdc)/rtru;
1465 dxibzic = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1466 //
1467 term1 = ( dphidxt/rtru - (dphidxu*dot*rt2)/(rtru*rt2ru2))*
1468 ( (yt*zdc-zt*ydc+yca*zu-yu*zca)/rtru - dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/rtru322);
1469 term3 = ( dot*dot*2.0*dphidxu/(rt2*ru2*ru2) - 2.0*dot*dphidxt/rt2ru2)*
1470 ( (yt*zdc-zt*ydc+yca*zu-yu*zca)/rtru - dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/rtru322);
1471
1472 term2 = 3.0*2.0*dphidxu*rt2*dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/(4.0*rt2ru2*rt2ru2*rtru)
1473 - ( 2.0*dphidxu*rt2*(yt*zdc-zt*ydc+yca*zu-yu*zca))/rtru322
1474 - ( dot*(rt2*2.0*(ycb*ydc+zcb*zdc)+4.0*dphidxu*(yca*zt-yt*zca)))/rtru322
1475 - ( dphidxt*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca)))/rtru322
1476 + (-ycb*yca-zca*zcb)/rtru;
1477 dxibxid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1478 //
1479 term1 = ( dphidyt/rtru - (dphidyu*dot*rt2)/(rtru*rt2ru2))*
1480 ( (yt*zdc-zt*ydc+yca*zu-yu*zca)/rtru - dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/rtru322);
1481 term3 = ( dot*dot*2.0*dphidyu/(rt2*ru2*ru2) - 2.0*dot*dphidyt/rt2ru2)*
1482 ( (yt*zdc-zt*ydc+yca*zu-yu*zca)/rtru - dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/rtru322);
1483 term2 = 3.0*2.0*dphidyu*rt2*dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/(4.0*rt2ru2*rt2ru2*rtru)
1484 - ( 2.0*dphidyu*rt2*(yt*zdc-zt*ydc+yca*zu-yu*zca))/rtru322
1485 - ( dot*(rt2*2.0*(-xcb*ydc-zu)+4.0*dphidyu*(yca*zt-yt*zca)))/rtru322
1486 - ( dphidyt*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca)))/rtru322
1487 + (xcb*yba+xcb*yca-xba*ycb)/rtru;
1488 dxibyid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1489 //
1490 term1 = ( dphidzt/rtru - (dphidzu*dot*rt2)/(rtru*rt2ru2))*
1491 ( (yt*zdc-zt*ydc+yca*zu-yu*zca)/rtru - dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/rtru322);
1492 term3 = ( dot*dot*2.0*dphidzu/(rt2*ru2*ru2) - 2.0*dot*dphidzt/rt2ru2)*
1493 ( (yt*zdc-zt*ydc+yca*zu-yu*zca)/rtru - dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/rtru322);
1494 term2 = 3.0*2.0*dphidzu*rt2*dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/(4.0*rt2ru2*rt2ru2*rtru)
1495 - ( 2.0*dphidzu*rt2*(yt*zdc-zt*ydc+yca*zu-yu*zca))/rtru322
1496 - ( dot*(rt2*2.0*(yu-xcb*zdc)+4.0*dphidzu*(yca*zt-yt*zca)))/rtru322
1497 - ( dphidzt*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca)))/rtru322
1498 + (xcb*zba+xcb*zca-xba*zcb)/rtru;
1499 dxibzid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1500 //
1501 //
1502 term1 = ( dphidzu/rtru - (dphidzt*dot*ru2)/(rtru*rt2ru2))*( dphidyu/rtru - (dphidyt*dot*ru2)/(rtru*rt2ru2));
1503 term3 = ( (2.0*dphidzt*dot*dot)/(rt2*rt2*ru2) - (2.0*dphidzu*dot)/rt2ru2)*
1504 (dphidyu/rtru - (dphidyt*dot*ru2)/(rt2ru2*rtru) );
1505 term2 = ( (3.0*4.0*dphidzt*dphidyt*dot*ru2*ru2)/(4.0*rt2ru2*rt2ru2*rtru)
1506 - ( 2.0*dphidyt*dphidzu*ru2)/rtru322
1507 - ( 2.0*dphidzt*dphidyu*ru2)/rtru322
1508 + ( (ycb*zcb)*dot*ru2)/(rt2ru2*rtru));
1509 dyiazia = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1510 //
1511 term1 = ( dphidyu/rtru - dot*ru2*dphidyt/(rtru*rt2ru2))*( (yt*zdc-zt*ydc+zu*yca-yu*zca)/rtru -
1512 dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/rtru322);
1513 term3 = ( dot*dot*2.0*(zdcyu)/(rt2*ru2*ru2) - dot*2.0*(yt*zdc-zt*ydc+zu*yca-yu*zca)/rt2ru2 +
1514 dot*dot*2.0*(yca*zt-yt*zca)/(rt2*rt2*ru2))*(dphidyu/rtru - dot*ru2*dphidyt/(rtru*rt2ru2));
1515 term2 = 3.0*2.0*dphidyt*dot*ru2*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/(4.0*rt2ru2*rt2ru2*rtru)
1516 - ( 4.0*dot*dphidyt*(zdcyu))/rtru322
1517 - ( 2.0*dphidyt*ru2*(yt*zdc-zt*ydc+zu*yca-yu*zca))/rtru322
1518 - ( dot*ru2*2.0*(xcb*yca-zt))/rtru322
1519 - ( dphidyu*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca)) )/rtru322
1520 + (ycb*xdc-xcb*ydc-xcb*ydc)/rtru;
1521 dyiaxib = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1522 //
1523 term1 = ( dphidyu/rtru - dot*ru2*dphidyt/(rtru*rt2ru2))*( (zt*xdc-xt*zdc+xu*zca-zu*xca)/rtru -
1524 dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(zca*xt-zt*xca))/rtru322);
1525 term3 = ( dot*dot*2.0*(xdc*zu-xu*zdc)/(rt2*ru2*ru2) - dot*2.0*(zt*xdc-xt*zdc+xu*zca-zu*xca)/rt2ru2 +
1526 dot*dot*2.0*(zca*xt-zt*xca)/(rt2*rt2*ru2))*(dphidyu/rtru - dot*ru2*dphidyt/(rtru*rt2ru2));
1527 term2 = 3.0*2.0*dphidyt*dot*ru2*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(zca*xt-zt*xca))/(4.0*rt2ru2*rt2ru2*rtru)
1528 - ( 4.0*dot*dphidyt*(xdc*zu-xu*zdc))/rtru322
1529 - ( 2.0*dphidyt*ru2*(zt*xdc-xt*zdc+xu*zca-zu*xca))/rtru322
1530 + ( dot*ru2*2.0*(xca*xcb+zcb*zca))/rtru322
1531 - ( dphidyu*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(zca*xt-zt*xca)) )/rtru322
1532 + (xcb*xdc+zcb*zdc)/rtru;
1533 dyiayib = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1534 //
1535 term1 = ( dphidyu/rtru - dot*ru2*dphidyt/(rtru*rt2ru2))*( (xt*ydc-yt*xdc+yu*xca-xu*yca)/rtru -
1536 dot*(rt2*2.0*(ydc*xu-yu*xdc)+ru2*2.0*(xca*yt-xt*yca))/rtru322);
1537 term3 = ( dot*dot*2.0*(ydc*xu-yu*xdc)/(rt2*ru2*ru2) - dot*2.0*(xt*ydc-yt*xdc+yu*xca-xu*yca)/rt2ru2 +
1538 dot*dot*2.0*(xca*yt-xt*yca)/(rt2*rt2*ru2))*(dphidyu/rtru - dot*ru2*dphidyt/(rtru*rt2ru2));
1539 term2 = 3.0*2.0*dphidyt*dot*ru2*(rt2*2.0*(ydc*xu-yu*xdc)+ru2*2.0*(xca*yt-xt*yca))/(4.0*rt2ru2*rt2ru2*rtru)
1540 - ( 4.0*dot*dphidyt*(ydc*xu-yu*xdc))/rtru322
1541 - ( 2.0*dphidyt*ru2*(xt*ydc-yt*xdc+yu*xca-xu*yca))/rtru322
1542 - ( dot*ru2*2.0*(yca*zcb+xt))/rtru322
1543 - ( dphidyu*(rt2*2.0*(ydc*xu-yu*xdc)+ru2*2.0*(xca*yt-xt*yca)) )/rtru322
1544 + (ycb*zdc-2.0*ydc*zcb)/rtru;
1545 dyiazib = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1546 //
1547 term1 = ( dphidyu/rtru - dot*ru2*dphidyt/(rtru*rt2ru2))*
1548 ((zt*ydb-yt*zdb+yu*zba-zu*yba)/rtru-dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba))/rtru322);
1549 term3 = ( dot*dot*2.0*(ydb*zu-yu*zdb)/(rt2*ru2*ru2) - dot*2.0*(zt*ydb-yt*zdb+yu*zba-zu*yba)/rt2ru2
1550 + dot*dot*2.0*(zba*yt-zt*yba)/(rt2*rt2*ru2))*(dphidyu/rtru - dot*ru2*dphidyt/(rtru*rt2ru2));
1551 term2 = 3.0*2.0*dphidyt*dot*ru2*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba))/(4.0*rt2ru2*rt2ru2*rtru)
1552 - ( 4.0*dphidyt*dot*(ydb*zu-yu*zdb))/rtru322
1553 - ( 2.0*dphidyt*ru2*(zt*ydb-yt*zdb+yu*zba-zu*yba))/rtru322
1554 - ( dot*ru2*2.0*(zt-xcb*yba))/rtru322
1555 - ( dphidyu*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba)))/rtru322
1556 + (xcb*ydc+xcb*ydb-xdc*ycb)/rtru;
1557 dyiaxic = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1558 //
1559 term1 = ( dphidyu/rtru - dot*ru2*dphidyt/(rtru*rt2ru2))*
1560 ((xt*zdb-zt*xdb+zu*xba-xu*zba)/rtru-dot*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(xba*zt-xt*zba))/rtru322);
1561 term3 = ( dot*dot*2.0*(zdb*xu-zu*xdb)/(rt2*ru2*ru2) - dot*2.0*(xt*zdb-zt*xdb+zu*xba-xu*zba)/rt2ru2
1562 + dot*dot*2.0*(xba*zt-xt*zba)/(rt2*rt2*ru2))*(dphidyu/rtru - dot*ru2*dphidyt/(rtru*rt2ru2));
1563 term2 = 3.0*2.0*dphidyt*dot*ru2*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(xba*zt-xt*zba))/(4.0*rt2ru2*rt2ru2*rtru)
1564 - ( 4.0*dphidyt*dot*(zdb*xu-zu*xdb))/rtru322
1565 - ( 2.0*dphidyt*ru2*(xt*zdb-zt*xdb+zu*xba-xu*zba))/rtru322
1566 - ( dot*ru2*2.0*(xba*xcb+zba*zcb))/rtru322
1567 - ( dphidyu*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(xba*zt-xt*zba)))/rtru322
1568 - (xcb*xdb+zcb*zdb)/rtru;
1569 dyiayic = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1570 //
1571 term1 = ( dphidyu/rtru - dot*ru2*dphidyt/(rtru*rt2ru2))*
1572 ((yt*xdb-xt*ydb+xu*yba-yu*xba)/rtru-dot*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba))/rtru322);
1573 term3 = ( dot*dot*2.0*(xdb*yu-xu*ydb)/(rt2*ru2*ru2) - dot*2.0*(yt*xdb-xt*ydb+xu*yba-yu*xba)/rt2ru2
1574 + dot*dot*2.0*(yba*xt-yt*xba)/(rt2*rt2*ru2))*(dphidyu/rtru - dot*ru2*dphidyt/(rtru*rt2ru2));
1575 term2 = 3.0*2.0*dphidyt*dot*ru2*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba))/(4.0*rt2ru2*rt2ru2*rtru)
1576 - ( 4.0*dphidyt*dot*(xdb*yu-xu*ydb))/rtru322
1577 - ( 2.0*dphidyt*ru2*(yt*xdb-xt*ydb+xu*yba-yu*xba))/rtru322
1578 + ( dot*ru2*2.0*(yba*zcb+xt))/rtru322
1579 - ( dphidyu*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba)))/rtru322
1580 + (ydc*zcb+ydb*zcb-ycb*zdc)/rtru;
1581 dyiazic = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1582 //
1583 term1 = ( dphidxt/rtru - dot*dphidxu*rt2/(rtru*rt2ru2))*(dphidyu/rtru - dot*ru2*dphidyt/(rtru*rt2ru2));
1584 term3 = ( 2.0*dot*dot*dphidxu/(rt2*ru2*ru2) - dot*2.0*dphidxt/rt2ru2)*
1585 ( dphidyu/rtru - dot*ru2*dphidyt/(rtru*rt2ru2));
1586 term2 = 3.0*4.0*dphidyt*rt2*dphidxu*dot*ru2/(4.0*rt2ru2*rt2ru2*rtru)
1587 - (rt2*2.0*dphidxu*dphidyu)/(rtru322)
1588 - (4.0*dphidyt*dphidxu*dot)/(rtru322) - (2.0*dphidxt*dphidyt*ru2)/(rtru322)
1589 - xcb*ycb/rtru;
1590 dyiaxid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1591 //
1592 term1 = ( dphidyt/rtru - dot*dphidyu*rt2/(rtru*rt2ru2))*(dphidyu/rtru - dot*ru2*dphidyt/(rtru*rt2ru2));
1593 term3 = ( 2.0*dot*dot*dphidyu/(rt2*ru2*ru2) - dot*2.0*dphidyt/rt2ru2)*
1594 ( dphidyu/rtru - dot*ru2*dphidyt/(rtru*rt2ru2));
1595 term2 = 3.0*4.0*dphidyt*rt2*dphidyu*dot*ru2/(4.0*rt2ru2*rt2ru2*rtru)
1596 - ( rt2*2.0*dphidyu*dphidyu)/(rtru322)
1597 - (4.0*dphidyt*dphidyu*dot)/(rtru322) - (2.0*dphidyt*dphidyt*ru2)/(rtru322)
1598 + (xcb*xcb+zcb*zcb)/rtru;
1599 dyiayid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1600 //
1601 term1 = ( dphidzt/rtru - dot*dphidzu*rt2/(rtru*rt2ru2))*(dphidyu/rtru - dot*ru2*dphidyt/(rtru*rt2ru2));
1602 term3 = ( 2.0*dot*dot*dphidzu/(rt2*ru2*ru2) - dot*2.0*dphidzt/rt2ru2)*
1603 ( dphidyu/rtru - dot*ru2*dphidyt/(rtru*rt2ru2));
1604 term2 = 3.0*4.0*dphidyt*rt2*dphidzu*dot*ru2/(4.0*rt2ru2*rt2ru2*rtru)
1605 - ( rt2*2.0*dphidzu*dphidyu)/(rtru322)
1606 - (4.0*dphidyt*dphidzu*dot)/(rtru322) - (2.0*dphidzt*dphidyt*ru2)/(rtru322)
1607 - zcb*ycb/rtru;
1608 dyiazid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1609 //
1610 term1 = ( dphidzu/rtru - dot*ru2*dphidzt/(rtru*rt2ru2))*
1611 ( (yt*zdc-zt*ydc+yca*zu-yu*zca)/rtru - dot*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/rtru322);
1612 term3 = ( dot*dot*2.0*(zdcyu)/(rt2*ru2*ru2) - dot*2.0*(yt*zdc-zt*ydc+yca*zu-yu*zca)/rt2ru2 +
1613 dot*dot*2.0*(yca*zt-yt*zca)/(rt2*rt2*ru2))*(dphidzu/rtru - dot*ru2*dphidzt/(rtru*rt2ru2));
1614 term2 = 3.0*2.0*dphidzt*dot*ru2*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca))/(4.0*rt2ru2*rt2ru2*rtru)
1615 - ( 4.0*dphidzt*dot*(zdcyu))/rtru322
1616 - ( 2.0*dphidzt*ru2*(yt*zdc-zt*ydc+yca*zu-yu*zca))/rtru322
1617 - ( 2.0*dot*ru2*(xcb*zca+yt))/rtru322
1618 - ( dphidzu*(rt2*2.0*(zdcyu)+ru2*2.0*(yca*zt-yt*zca)))/rtru322
1619 + (xdc*zcb-xcb*zdc*2.0)/rtru;
1620 dziaxib = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1621 //
1622 term1 = ( dphidzu/rtru - dot*ru2*dphidzt/(rtru*rt2ru2))*
1623 ( (zt*xdc-xt*zdc+zca*xu-zu*xca)/rtru - dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(zca*xt-zt*xca))/rtru322);
1624 term3 = ( dot*dot*2.0*(xdc*zu-xu*zdc)/(rt2*ru2*ru2) - dot*2.0*(zt*xdc-xt*zdc+zca*xu-zu*xca)/rt2ru2 +
1625 dot*dot*2.0*(zca*xt-zt*xca)/(rt2*rt2*ru2))*(dphidzu/rtru - dot*ru2*dphidzt/(rtru*rt2ru2));
1626
1627 term2 = 3.0*2.0*dphidzt*dot*ru2*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(zca*xt-zt*xca))/(4.0*rt2ru2*rt2ru2*rtru)
1628 - ( 4.0*dphidzt*dot*(xdc*zu-xu*zdc))/rtru322
1629 - ( 2.0*dphidzt*ru2*(zt*xdc-xt*zdc+zca*xu-zu*xca))/rtru322
1630 - ( 2.0*dot*ru2*(ycb*zca-xt))/rtru322
1631 - ( dphidzu*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(zca*xt-zt*xca)))/rtru322
1632 + (ydc*zcb-ycb*zdc*2.0)/rtru;
1633 dziayib = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1634 //
1635 term1 = ( dphidzu/rtru - dot*ru2*dphidzt/(rtru*rt2ru2))*
1636 ( (xt*ydc-yt*xdc+xca*yu-xu*yca)/rtru - dot*(rt2*2.0*(ydc*xu-yu*xdc)+ru2*2.0*(xca*yt-xt*yca))/rtru322);
1637 term3 = ( dot*dot*2.0*(ydc*xu-yu*xdc)/(rt2*ru2*ru2) - dot*2.0*(xt*ydc-yt*xdc+xca*yu-xu*yca)/rt2ru2 +
1638 dot*dot*2.0*(xca*yt-xt*yca)/(rt2*rt2*ru2))*(dphidzu/rtru - dot*ru2*dphidzt/(rtru*rt2ru2));
1639 term2 = 3.0*2.0*dphidzt*dot*ru2*(rt2*2.0*(ydc*xu-yu*xdc)+ru2*2.0*(xca*yt-xt*yca))/(4.0*rt2ru2*rt2ru2*rtru)
1640 - ( 4.0*dphidzt*dot*(ydc*xu-yu*xdc))/rtru322
1641 - ( 2.0*dphidzt*ru2*(xt*ydc-yt*xdc+xca*yu-xu*yca))/rtru322
1642 + ( dot*ru2*2.0*(xcb*xca+yca*ycb))/rtru322
1643 - (dphidzu*(rt2*2.0*(ydc*xu-yu*xdc)+ru2*2.0*(xca*yt-xt*yca)))/rtru322
1644 + (ycb*ydc+xcb*xdc)/rtru;
1645 dziazib = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1646 //
1647 term1 = ( dphidzu/rtru - dot*ru2*dphidzt/(rtru*rt2ru2))*
1648 ( (zt*ydb-yt*zdb+zba*yu-zu*yba)/rtru - dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba))/rtru322);
1649 term3 = ( dot*dot*2.0*(ydb*zu-yu*zdb)/(rt2*ru2*ru2) - dot*2.0*(zt*ydb-yt*zdb+zba*yu-zu*yba)/rt2ru2
1650 + dot*dot*2.0*(zba*yt-zt*yba)/(rt2*rt2*ru2))*(dphidzu/rtru - dot*ru2*dphidzt/(rtru*rt2ru2));
1651 term2 = 3.0*2.0*dphidzt*dot*ru2*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba))/(4.0*rt2ru2*rt2ru2*rtru)
1652 - ( 4.0*dphidzt*dot*(ydb*zu-yu*zdb))/rtru322
1653 - ( 2.0*dphidzt*ru2*(zt*ydb-yt*zdb+zba*yu-zu*yba))/rtru322
1654 - ( 2.0*dot*ru2*(-xcb*zba-yt))/rtru322
1655 - ( dphidzu*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba)))/rtru322
1656 + (xcb*zdc+xcb*zdb-xdc*zcb)/rtru;
1657 dziaxic = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1658 //
1659 term1 = ( dphidzu/rtru - dot*ru2*dphidzt/(rtru*rt2ru2))*
1660 ( (xt*zdb-zt*xdb+xba*zu-xu*zba)/rtru - dot*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(xba*zt-xt*zba))/rtru322);
1661 term3 = ( dot*dot*2.0*(zdb*xu-zu*xdb)/(rt2*ru2*ru2) - dot*2.0*(xt*zdb-zt*xdb+xba*zu-xu*zba)/rt2ru2
1662 + dot*dot*2.0*(xba*zt-xt*zba)/(rt2*rt2*ru2))*(dphidzu/rtru - dot*ru2*dphidzt/(rtru*rt2ru2));
1663
1664 term2 = 3.0*2.0*dphidzt*dot*ru2*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(xba*zt-xt*zba))/(4.0*rt2ru2*rt2ru2*rtru)
1665 - ( 4.0*dphidzt*dot*(zdb*xu-zu*xdb))/rtru322
1666 - ( 2.0*dphidzt*ru2*(xt*zdb-zt*xdb+xba*zu-xu*zba))/rtru322
1667 - ( 2.0*dot*ru2*(xt-ycb*zba))/rtru322
1668 - ( dphidzu*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(xba*zt-xt*zba)))/rtru322
1669 + (ycb*zdc+ycb*zdb-ydc*zcb)/rtru;
1670 dziayic = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1671 //
1672 term1 = ( dphidzu/rtru - dot*ru2*dphidzt/(rtru*rt2ru2))*
1673 ( (yt*xdb-xt*ydb+yba*xu-yu*xba)/rtru - dot*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba))/rtru322);
1674 term3 = ( dot*dot*2.0*(xdb*yu-xu*ydb)/(rt2*ru2*ru2) - dot*2.0*(yt*xdb-xt*ydb+yba*xu-yu*xba)/rt2ru2
1675 + dot*dot*2.0*(yba*xt-yt*xba)/(rt2*rt2*ru2))*(dphidzu/rtru - dot*ru2*dphidzt/(rtru*rt2ru2));
1676 term2 = 3.0*2.0*dphidzt*dot*ru2*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba))/(4.0*rt2ru2*rt2ru2*rtru)
1677 - ( 4.0*dphidzt*dot*(xdb*yu-xu*ydb))/rtru322
1678 - ( 2.0*dphidzt*ru2*(yt*xdb-xt*ydb+yba*xu-yu*xba))/rtru322
1679 - ( 2.0*dot*ru2*(yba*ycb+xba*xcb))/rtru322
1680 - ( dphidzu*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba)))/rtru322
1681 - (ycb*ydb+xcb*xdb)/rtru;
1682 dziazic = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1683 //
1684 term1 = (dphidxt/rtru - dot*rt2*dphidxu/(rtru*rt2ru2))*(dphidzu/rtru - dot*ru2*dphidzt/(rtru*rt2ru2));
1685 term3 = ( dot*dot*2.0*dphidxu/(rt2*ru2*ru2) - 2.0*dot*dphidxt/rt2ru2)*(dphidzu/rtru - dot*ru2*dphidzt/(rtru*rt2ru2));
1686
1687 term2 = 3.0*4.0*dphidzt*rt2*dphidxu*dot*ru2/(4.0*rt2ru2*rt2ru2*rtru)
1688 - ( rt2*2.0*dphidxu*dphidzu)/rtru322
1689 - ( 4.0*dphidzt*dphidxu*dot)/rtru322
1690 - ( 2.0*dphidxt*dphidzt*ru2)/rtru322
1691 - xcb*zcb/rtru;
1692 dziaxid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1693 //
1694 term1 = (dphidyt/rtru - dot*rt2*dphidyu/(rtru*rt2ru2))*(dphidzu/rtru - dot*ru2*dphidzt/(rtru*rt2ru2));
1695 term3 = ( dot*dot*2.0*dphidyu/(rt2*ru2*ru2) - 2.0*dot*dphidyt/rt2ru2)*(dphidzu/rtru - dot*ru2*dphidzt/(rtru*rt2ru2));
1696 term2 = 3.0*4.0*dphidzt*rt2*dphidyu*dot*ru2/(4.0*rt2ru2*rt2ru2*rtru)
1697 - ( rt2*2.0*dphidyu*dphidzu)/rtru322
1698 - ( 4.0*dphidzt*dphidyu*dot)/rtru322
1699 - ( 2.0*dphidyt*dphidzt*ru2)/rtru322
1700 - ycb*zcb/rtru;
1701 dziayid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1702 //
1703 term1 = (dphidzt/rtru - dot*rt2*dphidzu/(rtru*rt2ru2))*(dphidzu/rtru - dot*ru2*dphidzt/(rtru*rt2ru2));
1704 term3 = ( dot*dot*2.0*dphidzu/(rt2*ru2*ru2) - 2.0*dot*dphidzt/rt2ru2)*(dphidzu/rtru - dot*ru2*dphidzt/(rtru*rt2ru2));
1705 term2 = 3.0*4.0*dphidzt*rt2*dphidzu*dot*ru2/(4.0*rt2ru2*rt2ru2*rtru)
1706 - ( rt2*2.0*dphidzu*dphidzu)/rtru322
1707 - ( 4.0*dphidzt*dphidzu*dot)/rtru322
1708 - ( 2.0*dphidzt*dphidzt*ru2)/rtru322
1709 + ( xcb*xcb+ycb*ycb)/rtru;
1710 dziazid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1711 //
1712 term1 = ( (xt*ydc-yt*xdc+xca*yu-xu*yca)/rtru - dot*(rt2*2.0*(ydc*xu-yu*xdc)+ru2*2.0*(xca*yt-xt*yca))/rtru322)*
1713 ( (xdc*zt-xt*zdc+zca*xu-zu*xca)/rtru - dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/rtru322);
1714 term3 = ( dot*dot*2.0*(ydc*xu-yu*xdc)/(rt2*ru2*ru2) - dot*2.0*(xt*ydc-yt*xdc+xca*yu-xu*yca)/rt2ru2 +
1715 dot*dot*2.0*(xca*yt-xt*yca)/(rt2*rt2*ru2))*
1716 ( (xdc*zt-xt*zdc+zca*xu-zu*xca)/rtru - dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/rtru322);
1717 term2 = 3.0*dot*(rt2*2.0*(ydc*xu-yu*xdc)+ru2*2.0*(xca*yt-xt*yca))*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/(4.0*rt2ru2*rt2ru2*rtru)
1718 - ( dot*(2.0*rt2*ydc*(-zdc)+4.0*(xt*zca-zt*xca)*(ydc*xu-yu*xdc)+4.0*(xca*yt-xt*yca)*(xdc*zu-xu*zdc)-2.0*yca*zca*ru2))/rtru322
1719 - ( (xdc*zt-xt*zdc+zca*xu-zu*xca)*(rt2*2.0*(ydc*xu-yu*xdc)+ru2*2.0*(xca*yt-xt*yca)))/rtru322
1720 - ( (xt*ydc-yt*xdc+xca*yu-xu*yca)*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca)))/rtru322
1721 + (ydc*zca+yca*zdc)/rtru;
1722 dyibzib = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1723 //
1724 term1 = ( (ydb*zt-yt*zdb+zba*yu-zu*yba)/rtru - dot*(rt2*2.0*(ydb*zu-zdb*yu)+ru2*2.0*(yt*zba-zt*yba))/rtru322)*
1725 ( (xdc*zt-xt*zdc+zca*xu-zu*xca)/rtru - dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/rtru322);
1726 term3 = ( dot*dot*2.0*(ydb*zu-zdb*yu)/(rt2*ru2*ru2) - dot*2.0*(ydb*zt-yt*zdb+zba*yu-zu*yba)/rt2ru2
1727 + dot*dot*2.0*(yt*zba-zt*yba)/(rt2*rt2*ru2))*
1728 ( (xdc*zt-xt*zdc+zca*xu-zu*xca)/rtru - dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/rtru322);
1729 term2 = 3.0*dot*(rt2*2.0*(ydb*zu-zdb*yu)+ru2*2.0*(yt*zba-zt*yba))*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/(4.0*rt2ru2*rt2ru2*rtru)
1730 - ( dot*(rt2*2.0*(xdc*ydb-zu)+4.0*(zca*xt-zt*xca)*(ydb*zu-yu*zdb)
1731 +4.0*(zba*yt-zt*yba)*(xdc*zu-xu*zdc)+ru2*2.0*(xca*yba-zt)))/rtru322
1732 - ( (xdc*zt-xt*zdc+zca*xu-zu*xca)*(rt2*2.0*(ydb*zu-zdb*yu)+ru2*2.0*(yt*zba-zt*yba)))/rtru322
1733 - ( (ydb*zt-yt*zdb+zba*yu-zu*yba)*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca)) )/rtru322
1734 + (xcb*yba-xdc*yba-xba*ycb+xdc*ycb-xca*ydb-xcb*ydc)/rtru;
1735 dyibxic = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1736 //
1737 term1 = ( (zdb*xt-zt*xdb+xba*zu-xu*zba)/rtru - dot*(rt2*2.0*(zdb*xu-xdb*zu)+ru2*2.0*(zt*xba-xt*zba))/rtru322)*
1738 ( (xdc*zt-xt*zdc+zca*xu-zu*xca)/rtru - dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/rtru322);
1739 term3 = ( dot*dot*2.0*(zdb*xu-xdb*zu)/(rt2*ru2*ru2) - dot*2.0*(zdb*xt-zt*xdb+xba*zu-xu*zba)/rt2ru2
1740 + dot*dot*2.0*(zt*xba-xt*zba)/(rt2*rt2*ru2))*
1741 ( (xdc*zt-xt*zdc+zca*xu-zu*xca)/rtru - dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/rtru322);
1742 term2 = 3.0*dot*(rt2*2.0*(zdb*xu-xdb*zu)+ru2*2.0*(zt*xba-xt*zba))*
1743 (rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/(4.0*rt2ru2*rt2ru2*rtru)
1744 - ( dot*(rt2*2.0*(-xdb*xdc-zdc*zdb)+4.0*(zt*xba-xt*zba)*(xdc*zu-xu*zdc)
1745 +4.0*(xt*zca-zt*xca)*(zdb*xu-xdb*zu)+ ru2*2.0*(-xba*xca-zba*zca)))/rtru322
1746 - ( (xdc*zt-xt*zdc+zca*xu-zu*xca)*(rt2*2.0*(zdb*xu-xdb*zu)+ru2*2.0*(zt*xba-xt*zba)))/rtru322
1747 - ( (zdb*xt-zt*xdb+xba*zu-xu*zba)*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca)))/rtru322
1748 + (xba*xdc+xca*xdb+zba*zdc+zca*zdb)/rtru;
1749 dyibyic = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1750 //
1751 term1 = ( (xdb*yt-xt*ydb+yba*xu-yu*xba)/rtru - dot*(rt2*2.0*(xdb*yu-ydb*xu)+ru2*2.0*(xt*yba-yt*xba))/rtru322)*
1752 ( (xdc*zt-xt*zdc+zca*xu-zu*xca)/rtru - dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/rtru322);
1753 term3 = ( dot*dot*2.0*(xdb*yu-ydb*xu)/(rt2*ru2*ru2) - dot*2.0*(xdb*yt-xt*ydb+yba*xu-yu*xba)/rt2ru2
1754 + dot*dot*2.0*(xt*yba-yt*xba)/(rt2*rt2*ru2))*
1755 ( (xdc*zt-xt*zdc+zca*xu-zu*xca)/rtru - dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/rtru322);
1756 term2 = 3.0*dot*(rt2*2.0*(xdb*yu-ydb*xu)+ru2*2.0*(xt*yba-yt*xba))*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/(4.0*rt2ru2*rt2ru2*rtru)
1757 - ( dot*(rt2*2.0*(ydb*zdc+xu) + 4.0*(xt*zca-zt*xca)*(xdb*yu-ydb*xu)
1758 + 4.0*(xt*yba-yt*xba)*(xdc*zu-xu*zdc) + ru2*2.0*(yba*zca+xt)))/rtru322
1759 - ( (xdc*zt-xt*zdc+zca*xu-zu*xca)*(rt2*2.0*(xdb*yu-ydb*xu)+ru2*2.0*(xt*yba-yt*xba)))/rtru322
1760 - ( (xdb*yt-xt*ydb+yba*xu-yu*xba)*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca)))/rtru322
1761 + (yba*zcb-ycb*zba-ydb*zca-ydc*zcb-yba*zdc+ycb*zdc)/rtru;
1762 dyibzic = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1763 //
1764 term1 = ( dphidxt/rtru - dot*rt2*dphidxu/(rtru*rt2ru2))*
1765 ( (xdc*zt-xt*zdc+zca*xu-zu*xca)/rtru - dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/rtru322);
1766 term3 = ( dot*dot*2.0*(zcb*yu-zu*ycb)/(rt2*ru2*ru2) - 2.0*dphidxt*dot/rt2ru2)*
1767 ( (xdc*zt-xt*zdc+zca*xu-zu*xca)/rtru - dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/rtru322);
1768
1769 term2 = 3.0*2.0*rt2*(zcb*yu-zu*ycb)*dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/(4.0*rt2ru2*rt2ru2*rtru)
1770 - ( 2.0*rt2*(zcb*yu-zu*ycb)*(xdc*zt-xt*zdc+zca*xu-zu*xca))/rtru322
1771 - ( dot*(rt2*2.0*(zu-xdc*ycb)+4.0*(zcb*yu-zu*ycb)*(zca*xt-zt*xca)))/rtru322
1772 - ( dphidxt*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca)))/rtru322
1773 + (xba*ycb+xca*ycb-xcb*yba)/rtru;
1774 dyibxid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1775 //
1776 term1 = ( dphidyt/rtru - dot*rt2*dphidyu/(rtru*rt2ru2))*
1777 ( (xdc*zt-xt*zdc+zca*xu-zu*xca)/rtru - dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/rtru322);
1778 term3 = ( dot*dot*2.0*dphidyu/(rt2*ru2*ru2) - 2.0*dphidyt*dot/rt2ru2)*
1779 ( (xdc*zt-xt*zdc+zca*xu-zu*xca)/rtru - dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/rtru322);
1780 term2 = 3.0*2.0*rt2*dphidyu*dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/(4.0*rt2ru2*rt2ru2*rtru)
1781 - ( 2.0*rt2*dphidyu*(xdc*zt-xt*zdc+zca*xu-zu*xca))/rtru322
1782 - ( dot*(rt2*2.0*(xcb*xdc+zcb*zdc)+4.0*dphidyu*(zca*xt-zt*xca)))/rtru322
1783 - ( dphidyt*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca)))/rtru322
1784 + (-xca*xcb-zcb*zca)/rtru;
1785 dyibyid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1786 //
1787 term1 = ( dphidzt/rtru - dot*rt2*dphidzu/(rtru*rt2ru2))*
1788 ( (xdc*zt-xt*zdc+zca*xu-zu*xca)/rtru - dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/rtru322);
1789 term3 = ( dot*dot*2.0*dphidzu/(rt2*ru2*ru2) - 2.0*dphidzt*dot/rt2ru2)*
1790 ( (xdc*zt-xt*zdc+zca*xu-zu*xca)/rtru - dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/rtru322);
1791 term2 = 3.0*2.0*rt2*dphidzu*dot*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca))/(4.0*rt2ru2*rt2ru2*rtru)
1792 - ( 2.0*rt2*dphidzu*(xdc*zt-xt*zdc+zca*xu-zu*xca))/rtru322
1793 - ( dot*(rt2*2.0*(-ycb*zdc-xu)+4.0*dphidzu*(zca*xt-zt*xca)))/rtru322
1794 - ( dphidzt*(rt2*2.0*(xdc*zu-xu*zdc)+ru2*2.0*(xt*zca-zt*xca)))/rtru322
1795 + (ycb*zba+ycb*zca-yba*zcb)/rtru;
1796 dyibzid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1797 //
1798 term1 = ( (zt*ydb-yt*zdb+zba*yu-zu*yba)/rtru - dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba))/rtru322)*
1799 ( (xt*ydc-yt*xdc+yu*xca-xu*yca)/rtru - dot*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt) )/rtru322);
1800 term3 = ( dot*dot*2.0*(ydb*zu-yu*zdb)/(rt2*ru2*ru2) - dot*2.0*(zt*ydb-yt*zdb+zba*yu-zu*yba)/rt2ru2
1801 + dot*dot*2.0*(yt*zba-zt*yba)/(rt2*rt2*ru2))*
1802 ( (xt*ydc-yt*xdc+yu*xca-xu*yca)/rtru - dot*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt) )/rtru322);
1803 term2 = 3.0*dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba))*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt))/(4.0*rt2ru2*rt2ru2*rtru)
1804 - ( dot*(rt2*2.0*(xdc*zdb+yu) + 4.0*(xca*yt-xt*yca)*(ydb*zu-yu*zdb)
1805 + 4.0*(zba*yt-zt*yba)*(ydc*xu-yu*xdc) + ru2*2.0*(xca*zba+yt)))/rtru322
1806 - ( (xt*ydc-yt*xdc+yu*xca-xu*yca)*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba)))/rtru322
1807 - ( (zt*ydb-yt*zdb+zba*yu-zu*yba)*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt))) /rtru322
1808 + (xcb*zba-xdc*zba-xba*zcb+xdc*zcb-xca*zdb-xcb*zdc)/rtru;
1809 dzibxic = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1810 //
1811 term1 = ( (xt*zdb-zt*xdb+xba*zu-xu*zba)/rtru - dot*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(xba*zt-xt*zba))/rtru322)*
1812 ( (xt*ydc-yt*xdc+yu*xca-xu*yca)/rtru - dot*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt) )/rtru322);
1813 term3 = ( dot*dot*2.0*(zdb*xu-zu*xdb)/(rt2*ru2*ru2) - dot*2.0*(xt*zdb-zt*xdb+xba*zu-xu*zba)/rt2ru2
1814 + dot*dot*2.0*(zt*xba-xt*zba)/(rt2*rt2*ru2))*
1815 ( (xt*ydc-yt*xdc+yu*xca-xu*yca)/rtru - dot*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt) )/rtru322);
1816 term2 = 3.0*dot*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt))*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(xba*zt-xt*zba))/(4.0*rt2ru2*rt2ru2*rtru)
1817 - ( dot*(rt2*2.0*(ydc*zdb-xu) + 4.0*(xba*zt-xt*zba)*(ydcxu)
1818 + 4.0*(xcayt)*(zdb*xu-zu*xdb) + ru2*2.0*(yca*zba-xt)))/rtru322
1819 - ( (xt*zdb-zt*xdb+xba*zu-xu*zba)*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt)))/rtru322
1820 - ( (xt*ydc-yt*xdc+yu*xca-xu*yca)*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(xba*zt-xt*zba))) /rtru322
1821 + (ycb*zba-ydc*zba-yba*zcb+ydc*zcb-yca*zdb-ycb*zdc)/rtru;
1822 dzibyic = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1823 //
1824 term1 = ( (yt*xdb-xt*ydb+yba*xu-yu*xba)/rtru - dot*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba))/rtru322)*
1825 ( (xt*ydc-yt*xdc+yu*xca-xu*yca)/rtru - dot*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt) )/rtru322);
1826 term3 = ( dot*dot*2.0*(xdb*yu-xu*ydb)/(rt2*ru2*ru2) - dot*2.0*(yt*xdb-xt*ydb+yba*xu-yu*xba)/rt2ru2
1827 + dot*dot*2.0*(xt*yba-yt*xba)/(rt2*rt2*ru2))*
1828 ( (xt*ydc-yt*xdc+yu*xca-xu*yca)/rtru - dot*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt) )/rtru322);
1829 term2 = 3.0*dot*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba))*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt))/(4.0*rt2ru2*rt2ru2*rtru)
1830 - ( dot*(rt2*2.0*(-xdc*xdb-ydb*ydc) + 4.0*(xcayt)*(xdb*yu-xu*ydb)
1831 + 4.0*(yba*xt-yt*xba)*(ydcxu) - ru2*2.0*(xca*xba+yba*yca)))/rtru322
1832 - ( (yt*xdb-xt*ydb+yba*xu-yu*xba)*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt)))/rtru322
1833 - ( (xt*ydc-yt*xdc+yu*xca-xu*yca)*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba)))/rtru322
1834 + (xca*xdb+xba*xdc+yca*ydb+yba*ydc)/rtru;
1835 dzibzic = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1836 //
1837 term1 = ( dphidxt/rtru - dot*rt2*dphidxu/(rtru*rt2ru2))*
1838 ( (xt*ydc-yt*xdc+yu*xca-xu*yca)/rtru - dot*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt) )/rtru322);
1839 term3 = (dphidxu*2.0*dot*dot/(rt2*ru2*ru2) - 2.0*dphidxt*dot/rt2ru2)*
1840 ( (xt*ydc-yt*xdc+yu*xca-xu*yca)/rtru - dot*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt) )/rtru322);
1841 term2 = 3.0*2.0*rt2*dphidxu*dot*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt))/(4.0*rt2ru2*rt2ru2*rtru)
1842 - ( rt2*2.0*dphidxu*(xt*ydc-yt*xdc+yu*xca-xu*yca))/rtru322
1843 - ( dot*(rt2*(2.0*(-xdc*zcb)-2.0*yu)+4.0*dphidxu*(xca*yt-xt*yca)))/rtru322
1844 - ( dphidxt*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt)))/rtru322
1845 + (xca*zcb + xba*zcb-xcb*zba)/rtru;
1846 dzibxid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1847 //
1848 term1 = ( dphidyt/rtru - dot*rt2*dphidyu/(rtru*rt2ru2))*
1849 ( (xt*ydc-yt*xdc+yu*xca-xu*yca)/rtru - dot*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt) )/rtru322);
1850 term3 = (dphidyu*2.0*dot*dot/(rt2*ru2*ru2) - 2.0*dphidyt*dot/rt2ru2)*
1851 ( (xt*ydc-yt*xdc+yu*xca-xu*yca)/rtru - dot*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt) )/rtru322);
1852
1853 term2 = 3.0*2.0*rt2*dphidyu*dot*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt))/(4.0*rt2ru2*rt2ru2*rtru)
1854 - ( rt2*2.0*dphidyu*(xt*ydc-yt*xdc+yu*xca-xu*yca))/rtru322
1855 - ( dot*(rt2*2.0*(-ydc*zcb+xu)+4.0*dphidyu*(xca*yt-xt*yca)))/rtru322
1856 - ( dphidyt*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt)))/rtru322
1857 + (yba*zcb + yca*zcb-ycb*zba)/rtru;
1858 dzibyid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1859 //
1860 term1 = ( dphidzt/rtru - dot*rt2*dphidzu/(rtru*rt2ru2))*
1861 ( (xt*ydc-yt*xdc+yu*xca-xu*yca)/rtru - dot*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt) )/rtru322);
1862 term3 = (dphidzu*2.0*dot*dot/(rt2*ru2*ru2) - 2.0*dphidzt*dot/rt2ru2)*
1863 ( (xt*ydc-yt*xdc+yu*xca-xu*yca)/rtru - dot*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt) )/rtru322);
1864 term2 = 3.0*2.0*rt2*dphidzu*dot*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt))/(4.0*rt2ru2*rt2ru2*rtru)
1865 - ( rt2*2.0*dphidzu*(xt*ydc-yt*xdc+yu*xca-xu*yca))/rtru322
1866 - ( dot*(rt2*2.0*(xdc*xcb+ycb*ydc)+4.0*dphidzu*(xca*yt-xt*yca)))/rtru322
1867 - ( dphidzt*(rt2*2.0*(ydcxu)+ru2*2.0*(xcayt)))/rtru322
1868 - (xca*xcb+yca*ycb)/rtru;
1869 dzibzid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1870 //
1871 term1 = ( (zt*ydb-yt*zdb+zba*yu-zu*yba)/rtru - dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba))/rtru322)*
1872 ( (xt*zdb-zt*xdb+xba*zu-xu*zba)/rtru - dot*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(xba*zt-xt*zba))/rtru322);
1873 term3 = ( dot*dot*2.0*(zdb*xu-zu*xdb)/(rt2*ru2*ru2) - dot*2.0*(xt*zdb-zt*xdb+xba*zu-xu*zba)/rt2ru2
1874 + dot*dot*2.0*(xba*zt-xt*zba)/(rt2*rt2*ru2))*
1875 ((zt*ydb-yt*zdb+zba*yu-zu*yba)/rtru - dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba))/rtru322);
1876 term2 = 3.0*dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba))*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(xba*zt-xt*zba))/(4.0*rt2ru2*rt2ru2*rtru)
1877 - ( dot*(4.0*(xba*zt-xt*zba)*(ydb*zu-yu*zdb)-rt2*2.0*ydb*xdb+4.0*(zba*yt-zt*yba)*(zdb*xu-zu*xdb)-ru2*2.0*xba*yba))/rtru322
1878 - ( (xt*zdb-zt*xdb+xba*zu-xu*zba)*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba)))/rtru322
1879 - ( (zt*ydb-yt*zdb+zba*yu-zu*yba)*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(xba*zt-xt*zba)))/rtru322
1880 + (xba*ydb+yba*xdb)/rtru;
1881 dxicyic = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1882 //
1883 term1 = ( (zt*ydb-yt*zdb+zba*yu-zu*yba)/rtru - dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba))/rtru322)*
1884 ( (yt*xdb-xt*ydb+yba*xu-yu*xba)/rtru - dot*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba))/rtru322);
1885 term3 = ( dot*dot*2.0*(xdb*yu-xu*ydb)/(rt2*ru2*ru2) - dot*2.0*(yt*xdb-xt*ydb+yba*xu-yu*xba)/rt2ru2
1886 + dot*dot*2.0*(yba*xt-yt*xba)/(rt2*rt2*ru2))*
1887 ((zt*ydb-yt*zdb+zba*yu-zu*yba)/rtru - dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba))/rtru322);
1888 term2 = 3.0*dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba))*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba))/(4.0*rt2ru2*rt2ru2*rtru)
1889 - ( dot*(4.0*(yba*xt-yt*xba)*(ydb*zu-yu*zdb)-rt2*2.0*zdb*xdb+4.0*(zba*yt-zt*yba)*(xdb*yu-xu*ydb)-ru2*2.0*xba*zba))/rtru322
1890 - ( (yt*xdb-xt*ydb+yba*xu-yu*xba)*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(zba*yt-zt*yba)))/rtru322
1891 - ( (zt*ydb-yt*zdb+zba*yu-zu*yba)*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba)))/rtru322
1892 + (xba*zdb+zba*xdb)/rtru;
1893 dxiczic = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1894 //
1895 term1 = (dphidxt/rtru - rt2*dot*dphidxu/(rtru*rt2ru2))*
1896 ( (zt*ydb-yt*zdb+yu*zba-zu*yba)/rtru - dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(yt*zba-zt*yba))/rtru322);
1897 term3 = ( 2.0*dphidxu*dot*dot/(rt2*ru2*ru2) - 2.0*dphidxt*dot/rt2ru2)*
1898 ( (zt*ydb-yt*zdb+yu*zba-zu*yba)/rtru - dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(yt*zba-zt*yba))/rtru322);
1899 term2 = 3.0*2.0*rt2*dphidxu*dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(yt*zba-zt*yba))/(4.0*rt2ru2*rt2ru2*rtru)
1900 - ( rt2*2.0*dphidxu*(zt*ydb-yt*zdb+yu*zba-zu*yba))/rtru322
1901 - ( dot*(rt2*2.0*(-ydb*ycb-zdb*zcb)+4.0*dphidxu*(zba*yt-zt*yba)))/rtru322
1902 - ( dphidxt*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(yt*zba-zt*yba)))/rtru322
1903 + (zba*zcb+yba*ycb)/rtru;
1904 dxicxid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1905 //
1906 term1 = (dphidyt/rtru - rt2*dot*dphidyu/(rtru*rt2ru2))*
1907 ( (zt*ydb-yt*zdb+yu*zba-zu*yba)/rtru - dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(yt*zba-zt*yba))/rtru322);
1908 term3 = ( 2.0*dphidyu*dot*dot/(rt2*ru2*ru2) - 2.0*dphidyt*dot/rt2ru2)*
1909 ( (zt*ydb-yt*zdb+yu*zba-zu*yba)/rtru - dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(yt*zba-zt*yba))/rtru322);
1910 term2 = 3.0*2.0*rt2*dphidyu*dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(yt*zba-zt*yba))/(4.0*rt2ru2*rt2ru2*rtru)
1911 - ( rt2*2.0*dphidyu*(zt*ydb-yt*zdb+yu*zba-zu*yba))/rtru322
1912 - ( dot*(rt2*2.0*(xcb*ydb+zu)+4.0*dphidyu*(zba*yt-zt*yba)))/rtru322
1913 - ( dphidyt*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(yt*zba-zt*yba)))/rtru322
1914 + (xba*ycb-2.0*yba*xcb)/rtru;
1915 dxicyid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1916 //
1917 term1 = (dphidzt/rtru - rt2*dot*dphidzu/(rtru*rt2ru2))*
1918 ( (zt*ydb-yt*zdb+yu*zba-zu*yba)/rtru - dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(yt*zba-zt*yba))/rtru322);
1919 term3 = ( 2.0*dphidzu*dot*dot/(rt2*ru2*ru2) - 2.0*dphidzt*dot/rt2ru2)*
1920 ( (zt*ydb-yt*zdb+yu*zba-zu*yba)/rtru - dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(yt*zba-zt*yba))/rtru322);
1921 term2 = 3.0*2.0*rt2*dphidzu*dot*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(yt*zba-zt*yba))/(4.0*rt2ru2*rt2ru2*rtru)
1922 - ( rt2*2.0*dphidzu*(zt*ydb-yt*zdb+yu*zba-zu*yba))/rtru322
1923 - ( dot*(rt2*2.0*(zdb*xcb-yu)+4.0*dphidzu*(zba*yt-zt*yba)))/rtru322
1924 - ( dphidzt*(rt2*2.0*(ydb*zu-yu*zdb)+ru2*2.0*(yt*zba-zt*yba)))/rtru322
1925 + (xba*zcb-2.0*zba*xcb)/rtru;
1926 dxiczid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1927 //
1928 term1 = ((xt*zdb-zt*xdb+zu*xba-xu*zba)/rtru - (dot*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(zt*xba-xt*zba)))/rtru322)*
1929 ((yt*xdb-xt*ydb+xu*yba-yu*xba)/rtru - (dot*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(xt*yba-yt*xba)))/rtru322 );
1930 term3 = ( dot*dot*2.0*(xdb*yu-xu*ydb)/(rt2*ru2*ru2) - dot*2.0*(yt*xdb-xt*ydb+xu*yba-yu*xba)/rt2ru2
1931 + dot*dot*2.0*(yba*xt-yt*xba)/(rt2*rt2*ru2))*
1932 ((xt*zdb-zt*xdb+zu*xba-xu*zba)/rtru - (dot*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(zt*xba-xt*zba)))/rtru322);
1933 term2 = 3.0*dot*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(xt*yba-yt*xba))*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(zt*xba-xt*zba))/(4.0*rt2ru2*rt2ru2*rtru)
1934 - ( dot*(-rt2*2.0*zdb*ydb+4.0*(xba*zt-xt*zba)*(xdb*yu-xu*ydb)-ru2*2.0*yba*zba
1935 + 4.0*(yba*xt-yt*xba)*(zdb*xu-zu*xdb)))/rtru322
1936 - ( (xt*zdb-zt*xdb+zu*xba-xu*zba)*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(xt*yba-yt*xba)) )/rtru322
1937 - ( (xdb*yt-xt*ydb+yba*xu-yu*xba)*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(zt*xba-xt*zba)) )/rtru322
1938 + (yba*zdb+zba*ydb)/rtru;
1939 dyiczic = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1940 //
1941 term1 = ( dphidxt/rtru - rt2*dot*dphidxu/(rtru*rt2ru2))*
1942 ((xt*zdb-zt*xdb+zu*xba-xu*zba)/rtru - (dot*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(zt*xba-xt*zba)))/rtru322);
1943 term3 = ( 2.0*dot*dot*dphidxu/(rt2*ru2*ru2) - 2.0*dphidxt*dot/rt2ru2)*
1944 ((xt*zdb-zt*xdb+zu*xba-xu*zba)/rtru - (dot*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(zt*xba-xt*zba)))/rtru322);
1945 term2 = ( 3.0*2.0*rt2*dphidxu*dot*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(zt*xba-xt*zba)) )/(4.0*rt2ru2*rt2ru2*rtru)
1946 - ( rt2*2.0*(zcb*yu-zu*ycb)*(xt*zdb-zt*xdb+xba*zu-zba*xu))/rtru322
1947 - ( dot*(rt2*2.0*(xdb*ycb-zu)+4.0*(xba*zt-xt*zba)*(zcb*yu-zu*ycb)))/rtru322
1948 - ( dphidxt*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(zt*xba-xt*zba)))/rtru322
1949 + (xcb*yba-2.0*xba*ycb)/rtru ;
1950 dyicxid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1951 //
1952 term1 = ( dphidyt/rtru - rt2*dot*dphidyu/(rtru*rt2ru2))*
1953 ((xt*zdb-zt*xdb+zu*xba-xu*zba)/rtru - (dot*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(zt*xba-xt*zba)))/rtru322);
1954 term3 = ( 2.0*dot*dot*dphidyu/(rt2*ru2*ru2) - 2.0*dphidyt*dot/rt2ru2)*
1955 ((xt*zdb-zt*xdb+zu*xba-xu*zba)/rtru - (dot*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(zt*xba-xt*zba)))/rtru322);
1956
1957 term2 = ( 3.0*2.0*rt2*dphidyu*dot*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(zt*xba-xt*zba)) )/(4.0*rt2ru2*rt2ru2*rtru)
1958 - ( rt2*2.0*dphidyu*(xt*zdb-zt*xdb+xba*zu-zba*xu))/rtru322
1959 - ( dot*(rt2*2.0*(-xdb*xcb-zdb*zcb)+4.0*(xba*zt-xt*zba)*(xcb*zu-xu*zcb)))/rtru322
1960 - ( dphidyt*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(zt*xba-xt*zba)))/rtru322
1961 + (xcb*xba+zba*zcb)/rtru ;
1962 dyicyid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1963 //
1964 term1 = ( dphidzt/rtru - rt2*dot*dphidzu/(rtru*rt2ru2))*
1965 ((xt*zdb-zt*xdb+zu*xba-xu*zba)/rtru - (dot*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(zt*xba-xt*zba)))/rtru322);
1966 term3 = ( 2.0*dot*dot*dphidzu/(rt2*ru2*ru2) - 2.0*dphidzt*dot/rt2ru2)*
1967 ((xt*zdb-zt*xdb+zu*xba-xu*zba)/rtru - (dot*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(zt*xba-xt*zba)))/rtru322);
1968 term2 = ( 3.0*2.0*rt2*dphidzu*dot*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(zt*xba-xt*zba)) )/(4.0*rt2ru2*rt2ru2*rtru)
1969 - ( rt2*2.0*(ycb*xu-yu*xcb)*(xt*zdb-zt*xdb+xba*zu-zba*xu))/rtru322
1970 - ( dot*(rt2*2.0*(zdb*ycb+xu)+4.0*(xba*zt-xt*zba)*(ycb*xu-yu*xcb)))/rtru322
1971 - ( dphidzt*(rt2*2.0*(zdb*xu-zu*xdb)+ru2*2.0*(zt*xba-xt*zba)))/rtru322
1972 + (zcb*yba-2.0*zba*ycb)/rtru ;
1973 dyiczid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1974 //
1975 term1 = ( dphidxt/rtru - rt2*dphidxu*dot/(rtru*rt2ru2))*(dphidyt/rtru - rt2*dphidyu*dot/(rtru*rt2ru2));
1976 term3 = ( 2.0*dphidyu*dot*dot/(rt2*ru2*ru2) - 2.0*dphidyt*dot/rt2ru2)*
1977 ( dphidxt/rtru - rt2*dphidxu*dot/(rtru*rt2ru2));
1978 term2 = 3.0*4.0*rt2*rt2*dphidxu*dphidyu*dot/(4.0*rt2ru2*rt2ru2*rtru)
1979 - ( 2.0*dphidyt*rt2*dphidxu)/rtru322
1980 - ( 2.0*dphidxt*rt2*dphidyu)/rtru322
1981 - ( -xcb*ycb*rt2*dot)/rtru32;
1982 dxidyid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1983 //
1984 term1 = ( dphidxt/rtru - rt2*dphidxu*dot/(rtru*rt2ru2))*(dphidzt/rtru - rt2*dphidzu*dot/(rtru*rt2ru2));
1985 term3 = ( 2.0*dphidzu*dot*dot/(rt2*ru2*ru2) - 2.0*dphidzt*dot/rt2ru2)*(dphidxt/rtru - rt2*dphidxu*dot/(rtru*rt2ru2));
1986 term2 = 3.0*4.0*rt2*rt2*dphidxu*dphidzu*dot/(4.0*rt2ru2*rt2ru2*rtru)
1987 - ( 2.0*dphidzt*rt2*dphidxu)/rtru322
1988 - ( 2.0*dphidxt*rt2*dphidzu)/rtru322
1989 - ( -xcb*zcb*rt2*dot)/(rtru*rt2ru2);
1990 dxidzid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
1991 //
1992 term1 = ( dphidzt/rtru - rt2*dphidzu*dot/(rtru*rt2ru2))*(dphidyt/rtru - rt2*dphidyu*dot/(rtru*rt2ru2));
1993 term3 = ( 2.0*dphidzu*dot*dot/(rt2*ru2*ru2) - 2.0*dphidzt*dot/rt2ru2)*(dphidyt/rtru - rt2*dphidyu*dot/(rtru*rt2ru2));
1994
1995 term2 = 3.0*4.0*rt2*rt2*dphidzu*dphidyu*dot/(4.0*rt2ru2*rt2ru2*rtru)
1996 - ( 2.0*dphidyt*rt2*dphidzu)/rtru322
1997 - ( 2.0*dphidzt*rt2*dphidyu)/rtru322
1998 - ( -dot*rt2*ycb*zcb)/(rt2ru2*rtru);
1999 dyidzid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
2000 //
2001 term1 = ( dphidxt/rtru - rt2*dot*dphidxu/(rtru*rt2ru2))*
2002 ( (xdb*yt-xt*ydb+yba*xu-yu*xba)/rtru - dot*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba))/rtru322);
2003
2004 term3 = ( (2.0*dphidxu*dot*dot)/(rt2*ru2*ru2) - (2.0*dphidxt*dot)/rt2ru2)*
2005 ( (xdb*yt-xt*ydb+yba*xu-yu*xba)/rtru - dot*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba))/rtru322);
2006
2007 term2 = ( (3.0*2.0*dphidxu*dot*rt2*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba)))/(4.0*rt2ru2*rt2ru2*rtru)
2008 - ( rt2*2.0*dphidxu*(xdb*yt-xt*ydb+yba*xu-yu*xba))/rtru322
2009 - ( dot*(rt2*2.0*(xdb*zcb+yu)+4.0*dphidxu*(yba*xt-yt*xba)))/rtru322
2010 - ( dphidxt*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba)))/rtru322
2011 + (xcb*zba-2.0*xba*zcb)/(rtru));
2012 dzicxid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
2013 //
2014 term1 = ( dphidyt/rtru - rt2*dot*dphidyu/(rtru*rt2ru2))*
2015 ( (xdb*yt-xt*ydb+yba*xu-yu*xba)/rtru - dot*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba))/rtru322);
2016
2017 term3 = ( (2.0*dphidyu*dot*dot)/(rt2*ru2*ru2) - (2.0*dphidyt*dot)/rt2ru2)*
2018 ( (xdb*yt-xt*ydb+yba*xu-yu*xba)/rtru - dot*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba))/rtru322);
2019
2020 term2 = ( (3.0*2.0*dphidyu*dot*rt2*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba)))/(4.0*rt2ru2*rt2ru2*rtru)
2021 - ( rt2*2.0*(xdb*yt-xt*ydb+yba*xu-yu*xba)*dphidyu)/rtru322
2022 - ( dot*(rt2*2.0*(ydb*zcb-xu)+4.0*(yba*xt-yt*xba)*dphidyu))/rtru322
2023 - ( (xcb*zt-xt*zcb)*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba)))/rtru322
2024 + (ycb*zba-2.0*yba*zcb)/(rtru));
2025 dzicyid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
2026 //
2027 term1 = ( dphidzt/rtru - rt2*dot*dphidzu/(rtru*rt2ru2))*
2028 ( (xdb*yt-xt*ydb+yba*xu-yu*xba)/rtru - dot*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba))/rtru322);
2029
2030 term3 = ( (2.0*dphidzu*dot*dot)/(rt2*ru2*ru2) - (2.0*dphidzt*dot)/rt2ru2)*
2031 ( (xdb*yt-xt*ydb+yba*xu-yu*xba)/rtru - dot*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba))/rtru322);
2032
2033 term2 = ( (3.0*2.0*dphidzu*dot*rt2*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba)))/(4.0*rt2ru2*rt2ru2*rtru)
2034 - ( rt2*2.0*(xdb*yt-xt*ydb+yba*xu-yu*xba)*dphidzu)/rtru322
2035 - ( dot*(rt2*2.0*(-xcb*xdb-ycb*ydb)+4.0*(yba*xt-yt*xba)*dphidzu))/rtru322
2036 - ( dphidzt*(rt2*2.0*(xdb*yu-xu*ydb)+ru2*2.0*(yba*xt-yt*xba)))/rtru322
2037 + (xba*xcb+yba*ycb)/(rtru));
2038 dziczid = (d2edphi2*term1)/(denom2) + dedphi*term2/denom - dedphi*term3/(2.0*denom3);
2039
2040
2041
2042 if (iatom == ia)
2043 {
2044 hess.hessx[ia][0] += dxiaxia ;
2045 hess.hessy[ia][0] += dxiayia ;
2046 hess.hessz[ia][0] += dxiazia ;
2047 hess.hessx[ia][1] += dxiayia ;
2048 hess.hessy[ia][1] += dyiayia ;
2049 hess.hessz[ia][1] += dyiazia ;
2050 hess.hessx[ia][2] += dxiazia ;
2051 hess.hessy[ia][2] += dyiazia ;
2052 hess.hessz[ia][2] += dziazia ;
2053 hess.hessx[ib][0] += dxiaxib ;
2054 hess.hessy[ib][0] += dyiaxib ;
2055 hess.hessz[ib][0] += dziaxib ;
2056 hess.hessx[ib][1] += dxiayib ;
2057 hess.hessy[ib][1] += dyiayib ;
2058 hess.hessz[ib][1] += dziayib ;
2059 hess.hessx[ib][2] += dxiazib ;
2060 hess.hessy[ib][2] += dyiazib ;
2061 hess.hessz[ib][2] += dziazib ;
2062 hess.hessx[ic][0] += dxiaxic ;
2063 hess.hessy[ic][0] += dyiaxic ;
2064 hess.hessz[ic][0] += dziaxic ;
2065 hess.hessx[ic][1] += dxiayic ;
2066 hess.hessy[ic][1] += dyiayic ;
2067 hess.hessz[ic][1] += dziayic ;
2068 hess.hessx[ic][2] += dxiazic ;
2069 hess.hessy[ic][2] += dyiazic ;
2070 hess.hessz[ic][2] += dziazic ;
2071 hess.hessx[id][0] += dxiaxid ;
2072 hess.hessy[id][0] += dyiaxid ;
2073 hess.hessz[id][0] += dziaxid ;
2074 hess.hessx[id][1] += dxiayid ;
2075 hess.hessy[id][1] += dyiayid ;
2076 hess.hessz[id][1] += dziayid ;
2077 hess.hessx[id][2] += dxiazid ;
2078 hess.hessy[id][2] += dyiazid ;
2079 hess.hessz[id][2] += dziazid ;
2080 }else if (iatom == ib)
2081 {
2082 hess.hessx[ib][0] += dxibxib ;
2083 hess.hessy[ib][0] += dxibyib ;
2084 hess.hessz[ib][0] += dxibzib ;
2085 hess.hessx[ib][1] += dxibyib ;
2086 hess.hessy[ib][1] += dyibyib ;
2087 hess.hessz[ib][1] += dyibzib ;
2088 hess.hessx[ib][2] += dxibzib ;
2089 hess.hessy[ib][2] += dyibzib ;
2090 hess.hessz[ib][2] += dzibzib ;
2091 hess.hessx[ia][0] += dxiaxib ;
2092 hess.hessy[ia][0] += dxiayib ;
2093 hess.hessz[ia][0] += dxiazib ;
2094 hess.hessx[ia][1] += dyiaxib ;
2095 hess.hessy[ia][1] += dyiayib ;
2096 hess.hessz[ia][1] += dyiazib ;
2097 hess.hessx[ia][2] += dziaxib ;
2098 hess.hessy[ia][2] += dziayib ;
2099 hess.hessz[ia][2] += dziazib ;
2100 hess.hessx[ic][0] += dxibxic ;
2101 hess.hessy[ic][0] += dyibxic ;
2102 hess.hessz[ic][0] += dzibxic ;
2103 hess.hessx[ic][1] += dxibyic ;
2104 hess.hessy[ic][1] += dyibyic ;
2105 hess.hessz[ic][1] += dzibyic ;
2106 hess.hessx[ic][2] += dxibzic ;
2107 hess.hessy[ic][2] += dyibzic ;
2108 hess.hessz[ic][2] += dzibzic ;
2109 hess.hessx[id][0] += dxibxid ;
2110 hess.hessy[id][0] += dyibxid ;
2111 hess.hessz[id][0] += dzibxid ;
2112 hess.hessx[id][1] += dxibyid ;
2113 hess.hessy[id][1] += dyibyid ;
2114 hess.hessz[id][1] += dzibyid ;
2115 hess.hessx[id][2] += dxibzid ;
2116 hess.hessy[id][2] += dyibzid ;
2117 hess.hessz[id][2] += dzibzid ;
2118 }else if (iatom == ic)
2119 {
2120 hess.hessx[ic][0] += dxicxic ;
2121 hess.hessy[ic][0] += dxicyic ;
2122 hess.hessz[ic][0] += dxiczic ;
2123 hess.hessx[ic][1] += dxicyic ;
2124 hess.hessy[ic][1] += dyicyic ;
2125 hess.hessz[ic][1] += dyiczic ;
2126 hess.hessx[ic][2] += dxiczic ;
2127 hess.hessy[ic][2] += dyiczic ;
2128 hess.hessz[ic][2] += dziczic ;
2129 hess.hessx[ia][0] += dxiaxic ;
2130 hess.hessy[ia][0] += dxiayic ;
2131 hess.hessz[ia][0] += dxiazic ;
2132 hess.hessx[ia][1] += dyiaxic ;
2133 hess.hessy[ia][1] += dyiayic ;
2134 hess.hessz[ia][1] += dyiazic ;
2135 hess.hessx[ia][2] += dziaxic ;
2136 hess.hessy[ia][2] += dziayic ;
2137 hess.hessz[ia][2] += dziazic ;
2138 hess.hessx[ib][0] += dxibxic ;
2139 hess.hessy[ib][0] += dxibyic ;
2140 hess.hessz[ib][0] += dxibzic ;
2141 hess.hessx[ib][1] += dyibxic ;
2142 hess.hessy[ib][1] += dyibyic ;
2143 hess.hessz[ib][1] += dyibzic ;
2144 hess.hessx[ib][2] += dzibxic ;
2145 hess.hessy[ib][2] += dzibyic ;
2146 hess.hessz[ib][2] += dzibzic ;
2147 hess.hessx[id][0] += dxicxid ;
2148 hess.hessy[id][0] += dyicxid ;
2149 hess.hessz[id][0] += dzicxid ;
2150 hess.hessx[id][1] += dxicyid ;
2151 hess.hessy[id][1] += dyicyid ;
2152 hess.hessz[id][1] += dzicyid ;
2153 hess.hessx[id][2] += dxiczid ;
2154 hess.hessy[id][2] += dyiczid ;
2155 hess.hessz[id][2] += dziczid ;
2156 }else if (iatom == id)
2157 {
2158 hess.hessx[id][0] += dxidxid ;
2159 hess.hessy[id][0] += dxidyid ;
2160 hess.hessz[id][0] += dxidzid ;
2161 hess.hessx[id][1] += dxidyid ;
2162 hess.hessy[id][1] += dyidyid ;
2163 hess.hessz[id][1] += dyidzid ;
2164 hess.hessx[id][2] += dxidzid ;
2165 hess.hessy[id][2] += dyidzid ;
2166 hess.hessz[id][2] += dzidzid ;
2167 hess.hessx[ia][0] += dxiaxid ;
2168 hess.hessy[ia][0] += dxiayid ;
2169 hess.hessz[ia][0] += dxiazid ;
2170 hess.hessx[ia][1] += dyiaxid ;
2171 hess.hessy[ia][1] += dyiayid ;
2172 hess.hessz[ia][1] += dyiazid ;
2173 hess.hessx[ia][2] += dziaxid ;
2174 hess.hessy[ia][2] += dziayid ;
2175 hess.hessz[ia][2] += dziazid ;
2176 hess.hessx[ib][0] += dxibxid ;
2177 hess.hessy[ib][0] += dxibyid ;
2178 hess.hessz[ib][0] += dxibzid ;
2179 hess.hessx[ib][1] += dyibxid ;
2180 hess.hessy[ib][1] += dyibyid ;
2181 hess.hessz[ib][1] += dyibzid ;
2182 hess.hessx[ib][2] += dzibxid ;
2183 hess.hessy[ib][2] += dzibyid ;
2184 hess.hessz[ib][2] += dzibzid ;
2185 hess.hessx[ic][0] += dxicxid ;
2186 hess.hessy[ic][0] += dxicyid ;
2187 hess.hessz[ic][0] += dxiczid ;
2188 hess.hessx[ic][1] += dyicxid ;
2189 hess.hessy[ic][1] += dyicyid ;
2190 hess.hessz[ic][1] += dyiczid ;
2191 }
2192 }
2193 }
2194 }
2195 }