Port changes to other flavors of Tersoff
This commit is contained in:
@ -686,7 +686,7 @@ double PairTersoffKokkos<DeviceType>::ters_dbij(const Param& param, const F_FLOA
|
|||||||
return param.beta * (factor *
|
return param.beta * (factor *
|
||||||
// error in negligible 2nd term fixed 2/21/2022
|
// error in negligible 2nd term fixed 2/21/2022
|
||||||
// (1.0 - 0.5*(1.0 + 1.0/(2.0*param.powern)) *
|
// (1.0 - 0.5*(1.0 + 1.0/(2.0*param.powern)) *
|
||||||
(1.0 - (1.0 + 1.0/(2.0*param.powern)) *
|
(1.0 - (1.0 + 1.0/(2.0*param.powern)) *
|
||||||
pow(tmp,-param.powern)));
|
pow(tmp,-param.powern)));
|
||||||
if (tmp < param.c4) return 0.0;
|
if (tmp < param.c4) return 0.0;
|
||||||
if (tmp < param.c3)
|
if (tmp < param.c3)
|
||||||
@ -936,8 +936,6 @@ void PairTersoffKokkos<DeviceType>::ev_tally(EV_FLOAT &ev, const int &i, const i
|
|||||||
const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx,
|
const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx,
|
||||||
const F_FLOAT &dely, const F_FLOAT &delz) const
|
const F_FLOAT &dely, const F_FLOAT &delz) const
|
||||||
{
|
{
|
||||||
const int VFLAG = vflag_either;
|
|
||||||
|
|
||||||
// The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial
|
// The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial
|
||||||
|
|
||||||
auto v_eatom = ScatterViewHelper<NeedDup_v<NEIGHFLAG,DeviceType>,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom);
|
auto v_eatom = ScatterViewHelper<NeedDup_v<NEIGHFLAG,DeviceType>,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom);
|
||||||
@ -952,7 +950,7 @@ void PairTersoffKokkos<DeviceType>::ev_tally(EV_FLOAT &ev, const int &i, const i
|
|||||||
a_eatom[j] += epairhalf;
|
a_eatom[j] += epairhalf;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (VFLAG) {
|
if (vflag_either) {
|
||||||
const E_FLOAT v0 = delx*delx*fpair;
|
const E_FLOAT v0 = delx*delx*fpair;
|
||||||
const E_FLOAT v1 = dely*dely*fpair;
|
const E_FLOAT v1 = dely*dely*fpair;
|
||||||
const E_FLOAT v2 = delz*delz*fpair;
|
const E_FLOAT v2 = delz*delz*fpair;
|
||||||
@ -1043,7 +1041,8 @@ void PairTersoffKokkos<DeviceType>::v_tally3(EV_FLOAT &ev,
|
|||||||
template<class DeviceType>
|
template<class DeviceType>
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void PairTersoffKokkos<DeviceType>::v_tally3_atom(EV_FLOAT &ev, const int &i, const int & /*j*/,
|
void PairTersoffKokkos<DeviceType>::v_tally3_atom(EV_FLOAT &ev, const int &i, const int & /*j*/,
|
||||||
const int & /*k*/, F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const
|
const int & /*k*/, F_FLOAT *fj, F_FLOAT *fk,
|
||||||
|
F_FLOAT *drji, F_FLOAT *drjk) const
|
||||||
{
|
{
|
||||||
F_FLOAT v[6];
|
F_FLOAT v[6];
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -30,20 +30,14 @@ PairStyle(tersoff/mod/kk/host,PairTersoffMODKokkos<LMPHostType>);
|
|||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
template<int NEIGHFLAG, int EVFLAG>
|
template<int NEIGHFLAG, int EVFLAG>
|
||||||
struct TagPairTersoffMODComputeHalf{};
|
struct TagPairTersoffMODCompute{};
|
||||||
|
|
||||||
template<int NEIGHFLAG, int EVFLAG>
|
|
||||||
struct TagPairTersoffMODComputeFullA{};
|
|
||||||
|
|
||||||
template<int NEIGHFLAG, int EVFLAG>
|
|
||||||
struct TagPairTersoffMODComputeFullB{};
|
|
||||||
|
|
||||||
struct TagPairTersoffMODComputeShortNeigh{};
|
struct TagPairTersoffMODComputeShortNeigh{};
|
||||||
|
|
||||||
template<class DeviceType>
|
template<class DeviceType>
|
||||||
class PairTersoffMODKokkos : public PairTersoffMOD {
|
class PairTersoffMODKokkos : public PairTersoffMOD {
|
||||||
public:
|
public:
|
||||||
enum {EnabledNeighFlags=FULL};
|
enum {EnabledNeighFlags=HALF|HALFTHREAD};
|
||||||
enum {COUL_FLAG=0};
|
enum {COUL_FLAG=0};
|
||||||
typedef DeviceType device_type;
|
typedef DeviceType device_type;
|
||||||
typedef ArrayTypes<DeviceType> AT;
|
typedef ArrayTypes<DeviceType> AT;
|
||||||
@ -52,81 +46,66 @@ class PairTersoffMODKokkos : public PairTersoffMOD {
|
|||||||
PairTersoffMODKokkos(class LAMMPS *);
|
PairTersoffMODKokkos(class LAMMPS *);
|
||||||
~PairTersoffMODKokkos() override;
|
~PairTersoffMODKokkos() override;
|
||||||
void compute(int, int) override;
|
void compute(int, int) override;
|
||||||
|
void coeff(int, char **) override;
|
||||||
void init_style() override;
|
void init_style() override;
|
||||||
|
|
||||||
template<int NEIGHFLAG, int EVFLAG>
|
template<int NEIGHFLAG, int EVFLAG>
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void operator()(TagPairTersoffMODComputeHalf<NEIGHFLAG,EVFLAG>, const int&, EV_FLOAT&) const;
|
void operator()(TagPairTersoffMODCompute<NEIGHFLAG,EVFLAG>, const int&, EV_FLOAT&) const;
|
||||||
|
|
||||||
template<int NEIGHFLAG, int EVFLAG>
|
template<int NEIGHFLAG, int EVFLAG>
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void operator()(TagPairTersoffMODComputeHalf<NEIGHFLAG,EVFLAG>, const int&) const;
|
void operator()(TagPairTersoffMODCompute<NEIGHFLAG,EVFLAG>, const int&) const;
|
||||||
|
|
||||||
template<int NEIGHFLAG, int EVFLAG>
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
|
||||||
void operator()(TagPairTersoffMODComputeFullA<NEIGHFLAG,EVFLAG>, const int&, EV_FLOAT&) const;
|
|
||||||
|
|
||||||
template<int NEIGHFLAG, int EVFLAG>
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
|
||||||
void operator()(TagPairTersoffMODComputeFullA<NEIGHFLAG,EVFLAG>, const int&) const;
|
|
||||||
|
|
||||||
template<int NEIGHFLAG, int EVFLAG>
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
|
||||||
void operator()(TagPairTersoffMODComputeFullB<NEIGHFLAG,EVFLAG>, const int&, EV_FLOAT&) const;
|
|
||||||
|
|
||||||
template<int NEIGHFLAG, int EVFLAG>
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
|
||||||
void operator()(TagPairTersoffMODComputeFullB<NEIGHFLAG,EVFLAG>, const int&) const;
|
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void operator()(TagPairTersoffMODComputeShortNeigh, const int&) const;
|
void operator()(TagPairTersoffMODComputeShortNeigh, const int&) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double ters_fc_k(const int &i, const int &j, const int &k, const F_FLOAT &r) const;
|
double ters_fc_k(const Param& param, const F_FLOAT &r) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double ters_dfc(const int &i, const int &j, const int &k, const F_FLOAT &r) const;
|
double ters_dfc(const Param& param, const F_FLOAT &r) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double ters_fa_k(const int &i, const int &j, const int &k, const F_FLOAT &r) const;
|
double ters_fa_k(const Param& param, const F_FLOAT &r) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double ters_dfa(const int &i, const int &j, const int &k, const F_FLOAT &r) const;
|
double ters_dfa(const Param& param, const F_FLOAT &r) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double ters_bij_k(const int &i, const int &j, const int &k, const F_FLOAT &bo) const;
|
double ters_bij_k(const Param& param, const F_FLOAT &bo) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double ters_dbij(const int &i, const int &j, const int &k, const F_FLOAT &bo) const;
|
double ters_dbij(const Param& param, const F_FLOAT &bo) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double bondorder(const int &i, const int &j, const int &k,
|
double bondorder(const Param& param,
|
||||||
const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1,
|
const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1,
|
||||||
const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2) const;
|
const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double ters_gijk(const int &i, const int &j, const int &k, const F_FLOAT &cos) const;
|
double ters_gijk(const Param& param, const F_FLOAT &cos) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double ters_dgijk(const int &i, const int &j, const int &k, const F_FLOAT &cos) const;
|
double ters_dgijk(const Param& param, const F_FLOAT &cos) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void ters_dthb(const int &i, const int &j, const int &k, const F_FLOAT &prefactor,
|
void ters_dthb(const Param& param, const F_FLOAT &prefactor,
|
||||||
const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1,
|
const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1,
|
||||||
const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2,
|
const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2,
|
||||||
F_FLOAT *fi, F_FLOAT *fj, F_FLOAT *fk) const;
|
F_FLOAT *fi, F_FLOAT *fj, F_FLOAT *fk) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void ters_dthbj(const int &i, const int &j, const int &k, const F_FLOAT &prefactor,
|
void ters_dthbj(const Param& param, const F_FLOAT &prefactor,
|
||||||
const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1,
|
const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1,
|
||||||
const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2,
|
const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2,
|
||||||
F_FLOAT *fj, F_FLOAT *fk) const;
|
F_FLOAT *fj, F_FLOAT *fk) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void ters_dthbk(const int &i, const int &j, const int &k, const F_FLOAT &prefactor,
|
void ters_dthbk(const Param& param, const F_FLOAT &prefactor,
|
||||||
const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1,
|
const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1,
|
||||||
const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2,
|
const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2,
|
||||||
F_FLOAT *fk) const;
|
F_FLOAT *fk) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double vec3_dot(const F_FLOAT x[3], const double y[3]) const {
|
double vec3_dot(const F_FLOAT x[3], const double y[3]) const {
|
||||||
@ -151,17 +130,6 @@ class PairTersoffMODKokkos : public PairTersoffMOD {
|
|||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
int sbmask(const int& j) const;
|
int sbmask(const int& j) const;
|
||||||
|
|
||||||
struct params_ters {
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
|
||||||
params_ters() {powerm=0;lam3=0;h=0;powern=0;beta=0;lam2=0;bigb=0;bigr=0;bigd=0;
|
|
||||||
lam1=0;biga=0;powern_del=0;cutsq=0;c1=0;c2=0;c3=0;c4=0;c5=0;ca1=0;ca4=0;};
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
|
||||||
params_ters(int /*i*/) {powerm=0;lam3=0;h=0;powern=0;beta=0;lam2=0;bigb=0;bigr=0;bigd=0;
|
|
||||||
lam1=0;biga=0;powern_del=0;cutsq=0;c1=0;c2=0;c3=0;c4=0;c5=0;ca1=0;ca4=0;};
|
|
||||||
F_FLOAT powerm, lam3, h, powern, beta, lam2, bigb, bigr, bigd,
|
|
||||||
lam1, biga, powern_del, cutsq, c1, c2, c3, c4, c5, ca1, ca4;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<int NEIGHFLAG>
|
template<int NEIGHFLAG>
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void ev_tally(EV_FLOAT &ev, const int &i, const int &j,
|
void ev_tally(EV_FLOAT &ev, const int &i, const int &j,
|
||||||
@ -171,24 +139,27 @@ class PairTersoffMODKokkos : public PairTersoffMOD {
|
|||||||
template<int NEIGHFLAG>
|
template<int NEIGHFLAG>
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void v_tally3(EV_FLOAT &ev, const int &i, const int &j, const int &k,
|
void v_tally3(EV_FLOAT &ev, const int &i, const int &j, const int &k,
|
||||||
F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drij, F_FLOAT *drik) const;
|
F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drij, F_FLOAT *drik) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void v_tally3_atom(EV_FLOAT &ev, const int &i, const int &j, const int &k,
|
void v_tally3_atom(EV_FLOAT &ev, const int &i, const int &j, const int &k,
|
||||||
F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const;
|
F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const;
|
||||||
|
|
||||||
void allocate() override;
|
|
||||||
void setup_params() override;
|
void setup_params() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
using KKDeviceType = typename KKDevice<DeviceType>::value;
|
|
||||||
|
|
||||||
typedef Kokkos::DualView<int***,DeviceType> tdual_int_3d;
|
typedef Kokkos::DualView<int***,DeviceType> tdual_int_3d;
|
||||||
Kokkos::DualView<params_ters***,Kokkos::LayoutRight,DeviceType> k_params;
|
typedef typename tdual_int_3d::t_dev_const_randomread t_int_3d_randomread;
|
||||||
typename Kokkos::DualView<params_ters***,
|
typedef typename tdual_int_3d::t_host t_host_int_3d;
|
||||||
Kokkos::LayoutRight,DeviceType>::t_dev_const_um paramskk;
|
|
||||||
// hardwired to space for 12 atom types
|
t_int_3d_randomread d_elem3param;
|
||||||
//params_ters m_params[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1];
|
typename AT::t_int_1d_randomread d_map;
|
||||||
|
|
||||||
|
typedef Kokkos::DualView<Param*,DeviceType> tdual_param_1d;
|
||||||
|
typedef typename tdual_param_1d::t_dev t_param_1d;
|
||||||
|
typedef typename tdual_param_1d::t_host t_host_param_1d;
|
||||||
|
|
||||||
|
t_param_1d d_params;
|
||||||
|
|
||||||
int inum;
|
int inum;
|
||||||
typename AT::t_x_array_randomread x;
|
typename AT::t_x_array_randomread x;
|
||||||
@ -203,6 +174,7 @@ class PairTersoffMODKokkos : public PairTersoffMOD {
|
|||||||
|
|
||||||
int need_dup;
|
int need_dup;
|
||||||
|
|
||||||
|
using KKDeviceType = typename KKDevice<DeviceType>::value;
|
||||||
|
|
||||||
template<typename DataType, typename Layout>
|
template<typename DataType, typename Layout>
|
||||||
using DupScatterView = KKScatterView<DataType, Layout, KKDeviceType, KKScatterSum, KKScatterDuplicated>;
|
using DupScatterView = KKScatterView<DataType, Layout, KKDeviceType, KKScatterSum, KKScatterDuplicated>;
|
||||||
@ -213,6 +185,7 @@ class PairTersoffMODKokkos : public PairTersoffMOD {
|
|||||||
DupScatterView<F_FLOAT*[3], typename DAT::t_f_array::array_layout> dup_f;
|
DupScatterView<F_FLOAT*[3], typename DAT::t_f_array::array_layout> dup_f;
|
||||||
DupScatterView<E_FLOAT*, typename DAT::t_efloat_1d::array_layout> dup_eatom;
|
DupScatterView<E_FLOAT*, typename DAT::t_efloat_1d::array_layout> dup_eatom;
|
||||||
DupScatterView<F_FLOAT*[6], typename DAT::t_virial_array::array_layout> dup_vatom;
|
DupScatterView<F_FLOAT*[6], typename DAT::t_virial_array::array_layout> dup_vatom;
|
||||||
|
|
||||||
NonDupScatterView<F_FLOAT*[3], typename DAT::t_f_array::array_layout> ndup_f;
|
NonDupScatterView<F_FLOAT*[3], typename DAT::t_f_array::array_layout> ndup_f;
|
||||||
NonDupScatterView<E_FLOAT*, typename DAT::t_efloat_1d::array_layout> ndup_eatom;
|
NonDupScatterView<E_FLOAT*, typename DAT::t_efloat_1d::array_layout> ndup_eatom;
|
||||||
NonDupScatterView<F_FLOAT*[6], typename DAT::t_virial_array::array_layout> ndup_vatom;
|
NonDupScatterView<F_FLOAT*[6], typename DAT::t_virial_array::array_layout> ndup_vatom;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -30,20 +30,14 @@ PairStyle(tersoff/zbl/kk/host,PairTersoffZBLKokkos<LMPHostType>);
|
|||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
template<int NEIGHFLAG, int EVFLAG>
|
template<int NEIGHFLAG, int EVFLAG>
|
||||||
struct TagPairTersoffZBLComputeHalf{};
|
struct TagPairTersoffZBLCompute{};
|
||||||
|
|
||||||
template<int NEIGHFLAG, int EVFLAG>
|
|
||||||
struct TagPairTersoffZBLComputeFullA{};
|
|
||||||
|
|
||||||
template<int NEIGHFLAG, int EVFLAG>
|
|
||||||
struct TagPairTersoffZBLComputeFullB{};
|
|
||||||
|
|
||||||
struct TagPairTersoffZBLComputeShortNeigh{};
|
struct TagPairTersoffZBLComputeShortNeigh{};
|
||||||
|
|
||||||
template<class DeviceType>
|
template<class DeviceType>
|
||||||
class PairTersoffZBLKokkos : public PairTersoffZBL {
|
class PairTersoffZBLKokkos : public PairTersoffZBL {
|
||||||
public:
|
public:
|
||||||
enum {EnabledNeighFlags=FULL};
|
enum {EnabledNeighFlags=HALF|HALFTHREAD};
|
||||||
enum {COUL_FLAG=0};
|
enum {COUL_FLAG=0};
|
||||||
typedef DeviceType device_type;
|
typedef DeviceType device_type;
|
||||||
typedef ArrayTypes<DeviceType> AT;
|
typedef ArrayTypes<DeviceType> AT;
|
||||||
@ -52,80 +46,66 @@ class PairTersoffZBLKokkos : public PairTersoffZBL {
|
|||||||
PairTersoffZBLKokkos(class LAMMPS *);
|
PairTersoffZBLKokkos(class LAMMPS *);
|
||||||
~PairTersoffZBLKokkos() override;
|
~PairTersoffZBLKokkos() override;
|
||||||
void compute(int, int) override;
|
void compute(int, int) override;
|
||||||
|
void coeff(int, char **) override;
|
||||||
void init_style() override;
|
void init_style() override;
|
||||||
|
|
||||||
template<int NEIGHFLAG, int EVFLAG>
|
template<int NEIGHFLAG, int EVFLAG>
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void operator()(TagPairTersoffZBLComputeHalf<NEIGHFLAG,EVFLAG>, const int&, EV_FLOAT&) const;
|
void operator()(TagPairTersoffZBLCompute<NEIGHFLAG,EVFLAG>, const int&, EV_FLOAT&) const;
|
||||||
|
|
||||||
template<int NEIGHFLAG, int EVFLAG>
|
template<int NEIGHFLAG, int EVFLAG>
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void operator()(TagPairTersoffZBLComputeHalf<NEIGHFLAG,EVFLAG>, const int&) const;
|
void operator()(TagPairTersoffZBLCompute<NEIGHFLAG,EVFLAG>, const int&) const;
|
||||||
|
|
||||||
template<int NEIGHFLAG, int EVFLAG>
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
|
||||||
void operator()(TagPairTersoffZBLComputeFullA<NEIGHFLAG,EVFLAG>, const int&, EV_FLOAT&) const;
|
|
||||||
|
|
||||||
template<int NEIGHFLAG, int EVFLAG>
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
|
||||||
void operator()(TagPairTersoffZBLComputeFullA<NEIGHFLAG,EVFLAG>, const int&) const;
|
|
||||||
|
|
||||||
template<int NEIGHFLAG, int EVFLAG>
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
|
||||||
void operator()(TagPairTersoffZBLComputeFullB<NEIGHFLAG,EVFLAG>, const int&, EV_FLOAT&) const;
|
|
||||||
|
|
||||||
template<int NEIGHFLAG, int EVFLAG>
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
|
||||||
void operator()(TagPairTersoffZBLComputeFullB<NEIGHFLAG,EVFLAG>, const int&) const;
|
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void operator()(TagPairTersoffZBLComputeShortNeigh, const int&) const;
|
void operator()(TagPairTersoffZBLComputeShortNeigh, const int&) const;
|
||||||
KOKKOS_INLINE_FUNCTION
|
|
||||||
double ters_fc_k(const int &i, const int &j, const int &k, const F_FLOAT &r) const;
|
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double ters_dfc(const int &i, const int &j, const int &k, const F_FLOAT &r) const;
|
double ters_fc_k(const Param& param, const F_FLOAT &r) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double ters_fa_k(const int &i, const int &j, const int &k, const F_FLOAT &r) const;
|
double ters_dfc(const Param& param, const F_FLOAT &r) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double ters_dfa(const int &i, const int &j, const int &k, const F_FLOAT &r) const;
|
double ters_fa_k(const Param& param, const F_FLOAT &r) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double ters_bij_k(const int &i, const int &j, const int &k, const F_FLOAT &bo) const;
|
double ters_dfa(const Param& param, const F_FLOAT &r) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double ters_dbij(const int &i, const int &j, const int &k, const F_FLOAT &bo) const;
|
double ters_bij_k(const Param& param, const F_FLOAT &bo) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double bondorder(const int &i, const int &j, const int &k,
|
double ters_dbij(const Param& param, const F_FLOAT &bo) const;
|
||||||
const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1,
|
|
||||||
const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2) const;
|
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double ters_gijk(const int &i, const int &j, const int &k, const F_FLOAT &cos) const;
|
double bondorder(const Param& param,
|
||||||
|
const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1,
|
||||||
|
const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double ters_dgijk(const int &i, const int &j, const int &k, const F_FLOAT &cos) const;
|
double ters_gijk(const Param& param, const F_FLOAT &cos) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void ters_dthb(const int &i, const int &j, const int &k, const F_FLOAT &prefactor,
|
double ters_dgijk(const Param& param, const F_FLOAT &cos) const;
|
||||||
const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1,
|
|
||||||
const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2,
|
|
||||||
F_FLOAT *fi, F_FLOAT *fj, F_FLOAT *fk) const;
|
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void ters_dthbj(const int &i, const int &j, const int &k, const F_FLOAT &prefactor,
|
void ters_dthb(const Param& param, const F_FLOAT &prefactor,
|
||||||
const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1,
|
const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1,
|
||||||
const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2,
|
const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2,
|
||||||
F_FLOAT *fj, F_FLOAT *fk) const;
|
F_FLOAT *fi, F_FLOAT *fj, F_FLOAT *fk) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void ters_dthbk(const int &i, const int &j, const int &k, const F_FLOAT &prefactor,
|
void ters_dthbj(const Param& param, const F_FLOAT &prefactor,
|
||||||
const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1,
|
const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1,
|
||||||
const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2,
|
const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2,
|
||||||
F_FLOAT *fk) const;
|
F_FLOAT *fj, F_FLOAT *fk) const;
|
||||||
|
|
||||||
|
KOKKOS_INLINE_FUNCTION
|
||||||
|
void ters_dthbk(const Param& param, const F_FLOAT &prefactor,
|
||||||
|
const F_FLOAT &rij, const F_FLOAT &dx1, const F_FLOAT &dy1, const F_FLOAT &dz1,
|
||||||
|
const F_FLOAT &rik, const F_FLOAT &dx2, const F_FLOAT &dy2, const F_FLOAT &dz2,
|
||||||
|
F_FLOAT *fk) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double vec3_dot(const F_FLOAT x[3], const double y[3]) const {
|
double vec3_dot(const F_FLOAT x[3], const double y[3]) const {
|
||||||
@ -150,17 +130,6 @@ class PairTersoffZBLKokkos : public PairTersoffZBL {
|
|||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
int sbmask(const int& j) const;
|
int sbmask(const int& j) const;
|
||||||
|
|
||||||
struct params_ters {
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
|
||||||
params_ters() {powerm=0;gamma=0;lam3=0;c=0;d=0;h=0;powern=0;beta=0;lam2=0;bigb=0;
|
|
||||||
bigr=0;bigd=0;lam1=0;biga=0;cutsq=0;c1=0;c2=0;c3=0;c4=0;Z_i=0;Z_j=0;ZBLcut=0;ZBLexpscale=0;};
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
|
||||||
params_ters(int /*i*/) {powerm=0;gamma=0;lam3=0;c=0;d=0;h=0;powern=0;beta=0;lam2=0;bigb=0;
|
|
||||||
bigr=0;bigd=0;lam1=0;biga=0;cutsq=0;c1=0;c2=0;c3=0;c4=0;Z_i=0;Z_j=0;ZBLcut=0;ZBLexpscale=0;};
|
|
||||||
F_FLOAT powerm, gamma, lam3, c, d, h, powern, beta, lam2, bigb, bigr,
|
|
||||||
bigd, lam1, biga, cutsq, c1, c2, c3, c4, Z_i, Z_j, ZBLcut, ZBLexpscale;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<int NEIGHFLAG>
|
template<int NEIGHFLAG>
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void ev_tally(EV_FLOAT &ev, const int &i, const int &j,
|
void ev_tally(EV_FLOAT &ev, const int &i, const int &j,
|
||||||
@ -170,28 +139,33 @@ class PairTersoffZBLKokkos : public PairTersoffZBL {
|
|||||||
template<int NEIGHFLAG>
|
template<int NEIGHFLAG>
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void v_tally3(EV_FLOAT &ev, const int &i, const int &j, const int &k,
|
void v_tally3(EV_FLOAT &ev, const int &i, const int &j, const int &k,
|
||||||
F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drij, F_FLOAT *drik) const;
|
F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drij, F_FLOAT *drik) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
void v_tally3_atom(EV_FLOAT &ev, const int &i, const int &j, const int &k,
|
void v_tally3_atom(EV_FLOAT &ev, const int &i, const int &j, const int &k,
|
||||||
F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const;
|
F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const;
|
||||||
|
|
||||||
void allocate() override;
|
|
||||||
void setup_params() override;
|
void setup_params() override;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double fermi_k(const int &i, const int &j, const int &k, const F_FLOAT &r) const;
|
double fermi_k(const Param& param, const F_FLOAT &r) const;
|
||||||
|
|
||||||
KOKKOS_INLINE_FUNCTION
|
KOKKOS_INLINE_FUNCTION
|
||||||
double fermi_d_k(const int &i, const int &j, const int &k, const F_FLOAT &r) const;
|
double fermi_d_k(const Param& param, const F_FLOAT &r) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef Kokkos::DualView<int***,DeviceType> tdual_int_3d;
|
typedef Kokkos::DualView<int***,DeviceType> tdual_int_3d;
|
||||||
Kokkos::DualView<params_ters***,Kokkos::LayoutRight,DeviceType> k_params;
|
typedef typename tdual_int_3d::t_dev_const_randomread t_int_3d_randomread;
|
||||||
typename Kokkos::DualView<params_ters***,
|
typedef typename tdual_int_3d::t_host t_host_int_3d;
|
||||||
Kokkos::LayoutRight,DeviceType>::t_dev_const_um paramskk;
|
|
||||||
// hardwired to space for 12 atom types
|
t_int_3d_randomread d_elem3param;
|
||||||
//params_ters m_params[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1];
|
typename AT::t_int_1d_randomread d_map;
|
||||||
|
|
||||||
|
typedef Kokkos::DualView<Param*,DeviceType> tdual_param_1d;
|
||||||
|
typedef typename tdual_param_1d::t_dev t_param_1d;
|
||||||
|
typedef typename tdual_param_1d::t_host t_host_param_1d;
|
||||||
|
|
||||||
|
t_param_1d d_params;
|
||||||
|
|
||||||
int inum;
|
int inum;
|
||||||
typename AT::t_x_array_randomread x;
|
typename AT::t_x_array_randomread x;
|
||||||
@ -238,7 +212,7 @@ class PairTersoffZBLKokkos : public PairTersoffZBL {
|
|||||||
Kokkos::View<int*,DeviceType> d_numneigh_short;
|
Kokkos::View<int*,DeviceType> d_numneigh_short;
|
||||||
|
|
||||||
// ZBL
|
// ZBL
|
||||||
F_FLOAT global_a_0; // Bohr radius for Coulomb repulsion
|
F_FLOAT global_a_0; // Bohr radius for Coulomb repulsion
|
||||||
F_FLOAT global_epsilon_0; // permittivity of vacuum for Coulomb repulsion
|
F_FLOAT global_epsilon_0; // permittivity of vacuum for Coulomb repulsion
|
||||||
F_FLOAT global_e; // proton charge (negative of electron charge)
|
F_FLOAT global_e; // proton charge (negative of electron charge)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user