1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595
|
/// **************************************************************************
// tersoff_extra.h
// -------------------
// Trung Dac Nguyen
//
// Device code for Tersoff math routines
//
// __________________________________________________________________________
// This file is part of the LAMMPS Accelerator Library (LAMMPS_AL)
// __________________________________________________________________________
//
// begin :
// email : ndactrung@gmail.com
// ***************************************************************************/*
#ifndef LAL_TERSOFF_EXTRA_H
#define LAL_TERSOFF_EXTRA_H
#if defined(NV_KERNEL) || defined(USE_HIP)
#include "lal_aux_fun1.h"
#else
#endif
#define MY_PI2 (numtyp)1.57079632679489661923
#define MY_PI4 (numtyp)0.78539816339744830962
/* ---------------------------------------------------------------------- */
ucl_inline numtyp vec3_dot(const numtyp x[3], const numtyp y[3])
{
return (x[0]*y[0] + x[1]*y[1] + x[2]*y[2]);
}
ucl_inline void vec3_add(const numtyp x[3], const numtyp y[3], numtyp z[3])
{
z[0] = x[0]+y[0]; z[1] = x[1]+y[1]; z[2] = x[2]+y[2];
}
ucl_inline void vec3_scale(const numtyp k, const numtyp x[3], numtyp y[3])
{
y[0] = k*x[0]; y[1] = k*x[1]; y[2] = k*x[2];
}
ucl_inline void vec3_scaleadd(const numtyp k, const numtyp x[3],
const numtyp y[3], numtyp z[3])
{
z[0] = k*x[0]+y[0]; z[1] = k*x[1]+y[1]; z[2] = k*x[2]+y[2];
}
/* ---------------------------------------------------------------------- */
ucl_inline numtyp ters_gijk(const numtyp costheta,
const numtyp param_c,
const numtyp param_d,
const numtyp param_h,
const numtyp param_gamma)
{
const numtyp hcth = param_h - costheta;
return param_gamma*((numtyp)1.0 + param_c*ucl_recip(param_d) -
param_c *ucl_recip(param_d + hcth*hcth));
}
/* ---------------------------------------------------------------------- */
ucl_inline numtyp ters_gijk_d(const numtyp costheta,
const numtyp param_c,
const numtyp param_d,
const numtyp param_h,
const numtyp param_gamma,
numtyp *ans_d)
{
const numtyp hcth = param_h - costheta;
const numtyp idhh=ucl_recip(param_d + hcth*hcth);
const numtyp numerator = (numtyp)-2.0 * param_c * hcth;
*ans_d=param_gamma*numerator*idhh*idhh;
return param_gamma*((numtyp)1.0+param_c*ucl_recip(param_d)-param_c*idhh);
}
/* ---------------------------------------------------------------------- */
ucl_inline void costheta_d(const numtyp cos_theta,
const numtyp rij_hat[3],
const numtyp rij,
const numtyp rik_hat[3],
const numtyp rik,
numtyp *dri,
numtyp *drj,
numtyp *drk)
{
// first element is derivative wrt Ri, second wrt Rj, third wrt Rk
vec3_scaleadd(-cos_theta,rij_hat,rik_hat,drj);
vec3_scale(ucl_recip(rij),drj,drj);
vec3_scaleadd(-cos_theta,rik_hat,rij_hat,drk);
vec3_scale(ucl_recip(rik),drk,drk);
vec3_add(drj,drk,dri);
vec3_scale((numtyp)-1.0,dri,dri);
}
/* ---------------------------------------------------------------------- */
ucl_inline numtyp ters_fc(const numtyp r,
const numtyp param_bigr,
const numtyp param_bigd)
{
if (r < param_bigr-param_bigd) return (numtyp)1.0;
#ifndef ONETYPE
if (r > param_bigr+param_bigd) return (numtyp)0.0;
#endif
return (numtyp)0.5*((numtyp)1.0 - sin(MY_PI2*(r - param_bigr)/param_bigd));
}
/* ---------------------------------------------------------------------- */
ucl_inline numtyp ters_fc_d(const numtyp r,
const numtyp param_bigr,
const numtyp param_bigd,
numtyp *ans_d)
{
if (r < param_bigr-param_bigd) {
*ans_d=(numtyp)0.0;
return (numtyp)1.0;
}
#ifndef ONETYPE
if (r > param_bigr+param_bigd) {
*ans_d=(numtyp)0.0;
return (numtyp)0.0;
}
#endif
const numtyp ibigd = ucl_recip(param_bigd);
const numtyp angle = MY_PI2*(r - param_bigr)*ibigd;
*ans_d=-(MY_PI4*ibigd) * cos(angle);
return (numtyp)0.5*((numtyp)1.0 - sin(angle));
}
/* ---------------------------------------------------------------------- */
ucl_inline numtyp ters_fa_d(const numtyp r,
const numtyp param_bigb,
const numtyp param_bigr,
const numtyp param_bigd,
const numtyp param_lam2,
numtyp *ans_d)
{
#ifndef ONETYPE
if (r > param_bigr + param_bigd) {
*ans_d = (numtyp)0.0;
return (numtyp)0.0;
}
#endif
numtyp dfc;
const numtyp fc=ters_fc_d(r,param_bigr,param_bigd,&dfc);
const numtyp blr = param_bigb * ucl_exp(-param_lam2 * r);
*ans_d = blr * (param_lam2 * fc - dfc);
return -blr * fc;
}
/* ---------------------------------------------------------------------- */
ucl_inline numtyp ters_bij_d(const numtyp zeta,
const numtyp param_beta,
const numtyp param_powern,
const numtyp param_c1,
const numtyp param_c2,
const numtyp param_c3,
const numtyp param_c4,
numtyp *ans_d)
{
const numtyp tmp = param_beta * zeta;
if (tmp > param_c1) {
*ans_d = param_beta * (numtyp)-0.5*ucl_powr(tmp,(numtyp)-1.5);
return ucl_rsqrt(tmp);
}
if (tmp > param_c2) {
const numtyp ptmp = ucl_powr(tmp,-param_powern);
const numtyp i2n = ucl_recip((numtyp)2.0 * param_powern);
*ans_d = param_beta * ((numtyp)-0.5*ucl_powr(tmp,(numtyp)-1.5) *
((numtyp)1.0 - ((numtyp)1.0 + (numtyp)1.0 * i2n) *
ptmp));
return ((numtyp)1.0 - ptmp * i2n)*ucl_rsqrt(tmp);
}
if (tmp < param_c4) {
*ans_d = (numtyp)0.0;
return (numtyp)1.0;
}
if (tmp < param_c3) {
*ans_d = (numtyp)-0.5*param_beta * ucl_powr(tmp,param_powern-(numtyp)1.0);
return (numtyp)1.0 - ucl_powr(tmp,param_powern)/((numtyp)2.0*param_powern);
}
const numtyp tmp_n = (numtyp)1.0+ucl_powr(tmp,param_powern);
const numtyp i2n = -ucl_recip((numtyp)2.0*param_powern);
*ans_d = (numtyp)-0.5*ucl_powr(tmp_n,(numtyp)-1.0+i2n)*(tmp_n-(numtyp)1.0)/
zeta;
return ucl_powr(tmp_n, i2n);
}
/* ---------------------------------------------------------------------- */
ucl_inline void ters_zetaterm_d(const numtyp prefactor,
const numtyp rij_hat[3],
const numtyp rij,
const numtyp rik_hat[3],
const numtyp rik,
const numtyp param_bigr,
const numtyp param_bigd,
const int param_powermint,
const numtyp param_lam3,
const numtyp param_c,
const numtyp param_d,
const numtyp param_h,
const numtyp param_gamma,
numtyp dri[3],
numtyp drj[3],
numtyp drk[3])
{
numtyp gijk,gijk_d,ex_delr,ex_delr_d,fc,dfc,cos_theta,tmp;
numtyp dcosdri[3],dcosdrj[3],dcosdrk[3];
fc = ters_fc_d(rik,param_bigr,param_bigd,&dfc);
numtyp t = param_lam3*(rij-rik);
if (param_powermint == 3) tmp = t*t*t;
else tmp = t;
if (tmp > (numtyp)69.0776) ex_delr = (numtyp)1.e30;
else if (tmp < (numtyp)-69.0776) ex_delr = (numtyp)0.0;
else ex_delr = ucl_exp(tmp);
if (param_powermint == 3)
ex_delr_d = (numtyp)3.0*param_lam3*t*t*ex_delr;
else ex_delr_d = param_lam3 * ex_delr;
cos_theta = vec3_dot(rij_hat,rik_hat);
gijk = ters_gijk_d(cos_theta,param_c,param_d,param_h,param_gamma,&gijk_d);
costheta_d(cos_theta,rij_hat,rij,rik_hat,rik,dcosdri,dcosdrj,dcosdrk);
// compute the derivative wrt Ri
// dri = -dfc*gijk*ex_delr*rik_hat;
// dri += fc*gijk_d*ex_delr*dcosdri;
// dri += fc*gijk*ex_delr_d*(rik_hat - rij_hat);
vec3_scale(-dfc*gijk*ex_delr,rik_hat,dri);
vec3_scaleadd(fc*gijk_d*ex_delr,dcosdri,dri,dri);
vec3_scaleadd(fc*gijk*ex_delr_d,rik_hat,dri,dri);
vec3_scaleadd(-fc*gijk*ex_delr_d,rij_hat,dri,dri);
vec3_scale(prefactor,dri,dri);
// compute the derivative wrt Rj
// drj = fc*gijk_d*ex_delr*dcosdrj;
// drj += fc*gijk*ex_delr_d*rij_hat;
vec3_scale(fc*gijk_d*ex_delr,dcosdrj,drj);
vec3_scaleadd(fc*gijk*ex_delr_d,rij_hat,drj,drj);
vec3_scale(prefactor,drj,drj);
// compute the derivative wrt Rk
// drk = dfc*gijk*ex_delr*rik_hat;
// drk += fc*gijk_d*ex_delr*dcosdrk;
// drk += -fc*gijk*ex_delr_d*rik_hat;
vec3_scale(dfc*gijk*ex_delr,rik_hat,drk);
vec3_scaleadd(fc*gijk_d*ex_delr,dcosdrk,drk,drk);
vec3_scaleadd(-fc*gijk*ex_delr_d,rik_hat,drk,drk);
vec3_scale(prefactor,drk,drk);
}
ucl_inline void ters_zetaterm_d_fi(const numtyp prefactor,
const numtyp rij_hat[3],
const numtyp rij,
const numtyp rik_hat[3],
const numtyp rik,
const numtyp param_bigr,
const numtyp param_bigd,
const int param_powermint,
const numtyp param_lam3,
const numtyp param_c,
const numtyp param_d,
const numtyp param_h,
const numtyp param_gamma,
numtyp dri[3])
{
numtyp gijk,gijk_d,ex_delr,ex_delr_d,fc,dfc,cos_theta,tmp;
numtyp dcosdri[3],dcosdrj[3],dcosdrk[3];
fc = ters_fc_d(rik,param_bigr,param_bigd,&dfc);
numtyp t = param_lam3*(rij-rik);
if (param_powermint == 3) tmp = t*t*t;
else tmp = t;
if (tmp > (numtyp)69.0776) ex_delr = (numtyp)1.e30;
else if (tmp < (numtyp)-69.0776) ex_delr = (numtyp)0.0;
else ex_delr = ucl_exp(tmp);
if (param_powermint == 3)
ex_delr_d = (numtyp)3.0*param_lam3*t*t*ex_delr;
else ex_delr_d = param_lam3 * ex_delr;
cos_theta = vec3_dot(rij_hat,rik_hat);
gijk = ters_gijk_d(cos_theta,param_c,param_d,param_h,param_gamma,&gijk_d);
costheta_d(cos_theta,rij_hat,rij,rik_hat,rik,dcosdri,dcosdrj,dcosdrk);
// compute the derivative wrt Ri
// dri = -dfc*gijk*ex_delr*rik_hat;
// dri += fc*gijk_d*ex_delr*dcosdri;
// dri += fc*gijk*ex_delr_d*(rik_hat - rij_hat);
vec3_scale(-dfc*gijk*ex_delr,rik_hat,dri);
vec3_scaleadd(fc*gijk_d*ex_delr,dcosdri,dri,dri);
vec3_scaleadd(fc*gijk*ex_delr_d,rik_hat,dri,dri);
vec3_scaleadd(-fc*gijk*ex_delr_d,rij_hat,dri,dri);
vec3_scale(prefactor,dri,dri);
}
ucl_inline void ters_zetaterm_d_fj(const numtyp prefactor,
const numtyp rij_hat[3],
const numtyp rij,
const numtyp rik_hat[3],
const numtyp rik,
const numtyp param_bigr,
const numtyp param_bigd,
const int param_powermint,
const numtyp param_lam3,
const numtyp param_c,
const numtyp param_d,
const numtyp param_h,
const numtyp param_gamma,
numtyp drj[3])
{
numtyp gijk,gijk_d,ex_delr,ex_delr_d,fc,cos_theta,tmp;
numtyp dcosdri[3],dcosdrj[3],dcosdrk[3];
fc = ters_fc(rik,param_bigr,param_bigd);
numtyp t = param_lam3*(rij-rik);
if (param_powermint == 3) tmp = t*t*t;
else tmp = t;
if (tmp > (numtyp)69.0776) ex_delr = (numtyp)1.e30;
else if (tmp < (numtyp)-69.0776) ex_delr = (numtyp)0.0;
else ex_delr = ucl_exp(tmp);
if (param_powermint == 3)
ex_delr_d = (numtyp)3.0*param_lam3*t*t*ex_delr;
else ex_delr_d = param_lam3 * ex_delr;
cos_theta = vec3_dot(rij_hat,rik_hat);
gijk = ters_gijk_d(cos_theta,param_c,param_d,param_h,param_gamma,&gijk_d);
costheta_d(cos_theta,rij_hat,rij,rik_hat,rik,dcosdri,dcosdrj,dcosdrk);
// compute the derivative wrt Rj
// drj = fc*gijk_d*ex_delr*dcosdrj;
// drj += fc*gijk*ex_delr_d*rij_hat;
vec3_scale(fc*gijk_d*ex_delr,dcosdrj,drj);
vec3_scaleadd(fc*gijk*ex_delr_d,rij_hat,drj,drj);
vec3_scale(prefactor,drj,drj);
}
ucl_inline void ters_zetaterm_d_fk(const numtyp prefactor,
const numtyp rij_hat[3],
const numtyp rij,
const numtyp rik_hat[3],
const numtyp rik,
const numtyp param_bigr,
const numtyp param_bigd,
const int param_powermint,
const numtyp param_lam3,
const numtyp param_c,
const numtyp param_d,
const numtyp param_h,
const numtyp param_gamma,
numtyp drk[3])
{
numtyp gijk,gijk_d,ex_delr,ex_delr_d,fc,dfc,cos_theta,tmp;
numtyp dcosdri[3],dcosdrj[3],dcosdrk[3];
fc = ters_fc_d(rik,param_bigr,param_bigd,&dfc);
numtyp t = param_lam3*(rij-rik);
if (param_powermint == 3) tmp = t*t*t;
else tmp = t;
if (tmp > (numtyp)69.0776) ex_delr = (numtyp)1.e30;
else if (tmp < (numtyp)-69.0776) ex_delr = (numtyp)0.0;
else ex_delr = ucl_exp(tmp);
if (param_powermint == 3)
ex_delr_d = (numtyp)3.0*param_lam3*t*t*ex_delr;
else ex_delr_d = param_lam3 * ex_delr;
cos_theta = vec3_dot(rij_hat,rik_hat);
gijk = ters_gijk_d(cos_theta,param_c,param_d,param_h,param_gamma,&gijk_d);
costheta_d(cos_theta,rij_hat,rij,rik_hat,rik,dcosdri,dcosdrj,dcosdrk);
// compute the derivative wrt Rk
// drk = dfc*gijk*ex_delr*rik_hat;
// drk += fc*gijk_d*ex_delr*dcosdrk;
// drk += -fc*gijk*ex_delr_d*rik_hat;
vec3_scale(dfc*gijk*ex_delr,rik_hat,drk);
vec3_scaleadd(fc*gijk_d*ex_delr,dcosdrk,drk,drk);
vec3_scaleadd(-fc*gijk*ex_delr_d,rik_hat,drk,drk);
vec3_scale(prefactor,drk,drk);
}
/* ---------------------------------------------------------------------- */
ucl_inline void repulsive(const numtyp param_bigr,
const numtyp param_bigd,
const numtyp param_lam1,
const numtyp param_biga,
const numtyp rsq,
const int eflag,
numtyp *ans)
{
numtyp r,tmp_fc,tmp_fc_d,tmp_exp;
r = ucl_sqrt(rsq);
tmp_fc = ters_fc_d(r,param_bigr,param_bigd,&tmp_fc_d);
tmp_exp = param_biga * ucl_exp(-param_lam1 * r);
// fforce
ans[0] = -tmp_exp*(tmp_fc_d - tmp_fc*param_lam1)*ucl_recip(r);
// eng
if (EVFLAG && eflag) ans[1] = tmp_fc * tmp_exp;
}
/* ---------------------------------------------------------------------- */
ucl_inline numtyp zeta(const int param_powermint,
const numtyp param_lam3,
const numtyp param_bigr,
const numtyp param_bigd,
const numtyp param_c,
const numtyp param_d,
const numtyp param_h,
const numtyp param_gamma,
const numtyp rij,
const numtyp rsqik,
const numtyp4 delrij,
const numtyp4 delrik)
{
numtyp rik,costheta,arg,ex_delr;
rik = ucl_sqrt(rsqik);
costheta = (delrij.x*delrik.x + delrij.y*delrik.y +
delrij.z*delrik.z) / (rij*rik);
numtyp t = param_lam3*(rij-rik);
if (param_powermint == 3) arg = t*t*t;
else arg = t;
if (arg > (numtyp)69.0776) ex_delr = (numtyp)1.e30;
else if (arg < (numtyp)-69.0776) ex_delr = (numtyp)0.0;
else ex_delr = ucl_exp(arg);
return ters_fc(rik,param_bigr,param_bigd) *
ters_gijk(costheta,param_c, param_d, param_h, param_gamma) * ex_delr;
}
/* ---------------------------------------------------------------------- */
ucl_inline void force_zeta(const numtyp param_bigb,
const numtyp param_bigr,
const numtyp param_bigd,
const numtyp param_lam2,
const numtyp param_beta,
const numtyp param_powern,
const numtyp param_c1,
const numtyp param_c2,
const numtyp param_c3,
const numtyp param_c4,
const numtyp r,
const numtyp zeta_ij,
const int eflag,
numtyp fpfeng[4])
{
numtyp fa,fa_d,bij,bij_d;
fa = ters_fa_d(r,param_bigb,param_bigr,param_bigd,param_lam2,&fa_d);
bij = ters_bij_d(zeta_ij,param_beta,param_powern,
param_c1,param_c2, param_c3, param_c4, &bij_d);
fpfeng[0] = (numtyp)0.5*bij*fa_d*ucl_recip(r); // fforce
fpfeng[1] = (numtyp)-0.5*fa*bij_d; // prefactor
if (EVFLAG && eflag) fpfeng[2] = (numtyp)0.5*bij*fa; // eng
}
/* ----------------------------------------------------------------------
attractive term
use param_ij cutoff for rij test
use param_ijk cutoff for rik test
------------------------------------------------------------------------- */
ucl_inline void attractive(const numtyp param_bigr,
const numtyp param_bigd,
const int param_powermint,
const numtyp param_lam3,
const numtyp param_c,
const numtyp param_d,
const numtyp param_h,
const numtyp param_gamma,
const numtyp prefactor,
const numtyp rij,
const numtyp rijinv,
const numtyp rik,
const numtyp rikinv,
const numtyp delrij[3],
const numtyp delrik[3],
numtyp fi[3],
numtyp fj[3],
numtyp fk[3])
{
numtyp rij_hat[3],rik_hat[3];
vec3_scale(rijinv,delrij,rij_hat);
vec3_scale(rikinv,delrik,rik_hat);
ters_zetaterm_d(prefactor,rij_hat,rij,rik_hat,rik,
param_bigr, param_bigd, param_powermint, param_lam3,
param_c, param_d, param_h, param_gamma, fi, fj, fk);
}
ucl_inline void attractive_fi(const numtyp param_bigr,
const numtyp param_bigd,
const int param_powermint,
const numtyp param_lam3,
const numtyp param_c,
const numtyp param_d,
const numtyp param_h,
const numtyp param_gamma,
const numtyp prefactor,
const numtyp rij,
const numtyp rijinv,
const numtyp rik,
const numtyp rikinv,
const numtyp delrij[3],
const numtyp delrik[3],
numtyp fi[3])
{
numtyp rij_hat[3],rik_hat[3];
vec3_scale(rijinv,delrij,rij_hat);
vec3_scale(rikinv,delrik,rik_hat);
ters_zetaterm_d_fi(prefactor,rij_hat,rij,rik_hat,rik,
param_bigr, param_bigd, param_powermint, param_lam3,
param_c, param_d, param_h, param_gamma, fi);
}
ucl_inline void attractive_fj(const numtyp param_bigr,
const numtyp param_bigd,
const int param_powermint,
const numtyp param_lam3,
const numtyp param_c,
const numtyp param_d,
const numtyp param_h,
const numtyp param_gamma,
const numtyp prefactor,
const numtyp rij,
const numtyp rijinv,
const numtyp rik,
const numtyp rikinv,
const numtyp delrij[3],
const numtyp delrik[3],
numtyp fj[3])
{
numtyp rij_hat[3],rik_hat[3];
vec3_scale(rijinv,delrij,rij_hat);
vec3_scale(rikinv,delrik,rik_hat);
ters_zetaterm_d_fj(prefactor,rij_hat,rij,rik_hat,rik,
param_bigr, param_bigd, param_powermint, param_lam3,
param_c, param_d, param_h, param_gamma, fj);
}
ucl_inline void attractive_fk(const numtyp param_bigr,
const numtyp param_bigd,
const int param_powermint,
const numtyp param_lam3,
const numtyp param_c,
const numtyp param_d,
const numtyp param_h,
const numtyp param_gamma,
const numtyp prefactor,
const numtyp rij,
const numtyp rijinv,
const numtyp rik,
const numtyp rikinv,
const numtyp delrij[3],
const numtyp delrik[3],
numtyp fk[3])
{
numtyp rij_hat[3],rik_hat[3];
vec3_scale(rijinv,delrij,rij_hat);
vec3_scale(rikinv,delrik,rik_hat);
ters_zetaterm_d_fk(prefactor,rij_hat,rij,rik_hat,rik,
param_bigr, param_bigd, param_powermint, param_lam3,
param_c, param_d, param_h, param_gamma, fk);
}
#endif
|