From 7ba8d96ddb2d464b7610051a23084af921f6f9ad Mon Sep 17 00:00:00 2001
From: sjplimp
Date: Fri, 27 Mar 2015 13:37:06 +0000
Subject: [PATCH 01/22] git-svn-id:
svn://svn.icms.temple.edu/lammps-ro/trunk@13302
f3b2605a-c512-4ea7-a41b-209d697bcdaa
---
doc/fix_balance.html | 2 +-
doc/fix_balance.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/doc/fix_balance.html b/doc/fix_balance.html
index 22543741c9..3d84dede62 100644
--- a/doc/fix_balance.html
+++ b/doc/fix_balance.html
@@ -203,7 +203,7 @@ tallied. If the counts do not match the target value for the plane,
the position of the cut is adjusted based on the local density. The
low and high bounds are adjusted on each iteration, using new count
information, so that they become closer together over time. Thus as
-the recustion progresses, the count of particles on either side of the
+the recursion progresses, the count of particles on either side of the
plane gets closer to the target value.
The density-dependent part of this algorithm is often an advantage
diff --git a/doc/fix_balance.txt b/doc/fix_balance.txt
index 6c214a2041..7b6f523048 100644
--- a/doc/fix_balance.txt
+++ b/doc/fix_balance.txt
@@ -191,7 +191,7 @@ tallied. If the counts do not match the target value for the plane,
the position of the cut is adjusted based on the local density. The
low and high bounds are adjusted on each iteration, using new count
information, so that they become closer together over time. Thus as
-the recustion progresses, the count of particles on either side of the
+the recursion progresses, the count of particles on either side of the
plane gets closer to the target value.
The density-dependent part of this algorithm is often an advantage
From d72fcf5acca3b8dd94017e4986e4fe42abc91d4c Mon Sep 17 00:00:00 2001
From: sjplimp
Date: Fri, 27 Mar 2015 13:41:29 +0000
Subject: [PATCH 02/22] git-svn-id:
svn://svn.icms.temple.edu/lammps-ro/trunk@13303
f3b2605a-c512-4ea7-a41b-209d697bcdaa
---
src/CLASS2/pair_lj_class2.cpp | 24 +++++++-------
src/CLASS2/pair_lj_class2.h | 6 ++--
src/CLASS2/pair_lj_class2_coul_cut.cpp | 30 +++++++++--------
src/CLASS2/pair_lj_class2_coul_cut.h | 8 ++---
src/CLASS2/pair_lj_class2_coul_long.cpp | 26 ++++++++-------
src/CLASS2/pair_lj_class2_coul_long.h | 8 ++---
src/KOKKOS/pair_kokkos.h | 4 +--
src/KSPACE/pair_buck_coul_long.cpp | 28 ++++++++--------
src/KSPACE/pair_buck_coul_long.h | 2 +-
src/KSPACE/pair_coul_long.cpp | 12 ++++---
src/KSPACE/pair_coul_long.h | 4 +--
src/KSPACE/pair_lj_charmm_coul_long.cpp | 36 ++++++++++++---------
src/KSPACE/pair_lj_charmm_coul_long.h | 8 ++---
src/MOLECULE/pair_lj_charmm_coul_charmm.cpp | 4 ++-
src/MOLECULE/pair_lj_charmm_coul_charmm.h | 8 ++---
src/pair_buck_coul_cut.cpp | 2 +-
src/pair_buck_coul_cut.h | 2 +-
src/pair_lj_cut_coul_dsf.cpp | 26 ++++++++-------
src/pair_lj_cut_coul_dsf.h | 6 ++--
src/pair_lj_expand.cpp | 4 ++-
src/pair_lj_expand.h | 6 ++--
src/pair_lj_gromacs.cpp | 4 ++-
src/pair_lj_gromacs.h | 4 +--
src/pair_lj_gromacs_coul_gromacs.cpp | 4 ++-
src/pair_lj_gromacs_coul_gromacs.h | 6 ++--
25 files changed, 148 insertions(+), 124 deletions(-)
diff --git a/src/CLASS2/pair_lj_class2.cpp b/src/CLASS2/pair_lj_class2.cpp
index 90f5881ffd..9ae9613a74 100644
--- a/src/CLASS2/pair_lj_class2.cpp
+++ b/src/CLASS2/pair_lj_class2.cpp
@@ -37,18 +37,20 @@ PairLJClass2::PairLJClass2(LAMMPS *lmp) : Pair(lmp)
PairLJClass2::~PairLJClass2()
{
- if (allocated) {
- memory->destroy(setflag);
- memory->destroy(cutsq);
+ if (!copymode) {
+ if (allocated) {
+ memory->destroy(setflag);
+ memory->destroy(cutsq);
- memory->destroy(cut);
- memory->destroy(epsilon);
- memory->destroy(sigma);
- memory->destroy(lj1);
- memory->destroy(lj2);
- memory->destroy(lj3);
- memory->destroy(lj4);
- memory->destroy(offset);
+ memory->destroy(cut);
+ memory->destroy(epsilon);
+ memory->destroy(sigma);
+ memory->destroy(lj1);
+ memory->destroy(lj2);
+ memory->destroy(lj3);
+ memory->destroy(lj4);
+ memory->destroy(offset);
+ }
}
}
diff --git a/src/CLASS2/pair_lj_class2.h b/src/CLASS2/pair_lj_class2.h
index b6b604cbca..4a89ce2a3f 100644
--- a/src/CLASS2/pair_lj_class2.h
+++ b/src/CLASS2/pair_lj_class2.h
@@ -29,9 +29,9 @@ class PairLJClass2 : public Pair {
PairLJClass2(class LAMMPS *);
virtual ~PairLJClass2();
virtual void compute(int, int);
- void settings(int, char **);
+ virtual void settings(int, char **);
void coeff(int, char **);
- double init_one(int, int);
+ virtual double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
void write_restart_settings(FILE *);
@@ -46,7 +46,7 @@ class PairLJClass2 : public Pair {
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4,**offset;
- void allocate();
+ virtual void allocate();
};
}
diff --git a/src/CLASS2/pair_lj_class2_coul_cut.cpp b/src/CLASS2/pair_lj_class2_coul_cut.cpp
index 7f851fd239..23f4d36141 100644
--- a/src/CLASS2/pair_lj_class2_coul_cut.cpp
+++ b/src/CLASS2/pair_lj_class2_coul_cut.cpp
@@ -38,21 +38,23 @@ PairLJClass2CoulCut::PairLJClass2CoulCut(LAMMPS *lmp) : Pair(lmp)
PairLJClass2CoulCut::~PairLJClass2CoulCut()
{
- if (allocated) {
- memory->destroy(setflag);
- memory->destroy(cutsq);
+ if (!copymode) {
+ if (allocated) {
+ memory->destroy(setflag);
+ memory->destroy(cutsq);
- memory->destroy(cut_lj);
- memory->destroy(cut_ljsq);
- memory->destroy(cut_coul);
- memory->destroy(cut_coulsq);
- memory->destroy(epsilon);
- memory->destroy(sigma);
- memory->destroy(lj1);
- memory->destroy(lj2);
- memory->destroy(lj3);
- memory->destroy(lj4);
- memory->destroy(offset);
+ memory->destroy(cut_lj);
+ memory->destroy(cut_ljsq);
+ memory->destroy(cut_coul);
+ memory->destroy(cut_coulsq);
+ memory->destroy(epsilon);
+ memory->destroy(sigma);
+ memory->destroy(lj1);
+ memory->destroy(lj2);
+ memory->destroy(lj3);
+ memory->destroy(lj4);
+ memory->destroy(offset);
+ }
}
}
diff --git a/src/CLASS2/pair_lj_class2_coul_cut.h b/src/CLASS2/pair_lj_class2_coul_cut.h
index cea218f759..9b9c654ec6 100644
--- a/src/CLASS2/pair_lj_class2_coul_cut.h
+++ b/src/CLASS2/pair_lj_class2_coul_cut.h
@@ -29,10 +29,10 @@ class PairLJClass2CoulCut : public Pair {
PairLJClass2CoulCut(class LAMMPS *);
virtual ~PairLJClass2CoulCut();
virtual void compute(int, int);
- void settings(int, char **);
+ virtual void settings(int, char **);
void coeff(int, char **);
- void init_style();
- double init_one(int, int);
+ virtual void init_style();
+ virtual double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
void write_restart_settings(FILE *);
@@ -48,7 +48,7 @@ class PairLJClass2CoulCut : public Pair {
double **epsilon,**sigma;
double **lj1,**lj2,**lj3,**lj4,**offset;
- void allocate();
+ virtual void allocate();
};
}
diff --git a/src/CLASS2/pair_lj_class2_coul_long.cpp b/src/CLASS2/pair_lj_class2_coul_long.cpp
index 2460515b98..7801e1687f 100644
--- a/src/CLASS2/pair_lj_class2_coul_long.cpp
+++ b/src/CLASS2/pair_lj_class2_coul_long.cpp
@@ -50,19 +50,21 @@ PairLJClass2CoulLong::PairLJClass2CoulLong(LAMMPS *lmp) : Pair(lmp)
PairLJClass2CoulLong::~PairLJClass2CoulLong()
{
- if (allocated) {
- memory->destroy(setflag);
- memory->destroy(cutsq);
+ if (!copymode) {
+ if (allocated) {
+ memory->destroy(setflag);
+ memory->destroy(cutsq);
- memory->destroy(cut_lj);
- memory->destroy(cut_ljsq);
- memory->destroy(epsilon);
- memory->destroy(sigma);
- memory->destroy(lj1);
- memory->destroy(lj2);
- memory->destroy(lj3);
- memory->destroy(lj4);
- memory->destroy(offset);
+ memory->destroy(cut_lj);
+ memory->destroy(cut_ljsq);
+ memory->destroy(epsilon);
+ memory->destroy(sigma);
+ memory->destroy(lj1);
+ memory->destroy(lj2);
+ memory->destroy(lj3);
+ memory->destroy(lj4);
+ memory->destroy(offset);
+ }
}
}
diff --git a/src/CLASS2/pair_lj_class2_coul_long.h b/src/CLASS2/pair_lj_class2_coul_long.h
index 829c4f23e0..202aaaaa43 100644
--- a/src/CLASS2/pair_lj_class2_coul_long.h
+++ b/src/CLASS2/pair_lj_class2_coul_long.h
@@ -29,10 +29,10 @@ class PairLJClass2CoulLong : public Pair {
PairLJClass2CoulLong(class LAMMPS *);
virtual ~PairLJClass2CoulLong();
virtual void compute(int, int);
- void settings(int, char **);
+ virtual void settings(int, char **);
void coeff(int, char **);
- void init_style();
- double init_one(int, int);
+ virtual void init_style();
+ virtual double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
void write_restart_settings(FILE *);
@@ -50,7 +50,7 @@ class PairLJClass2CoulLong : public Pair {
double **lj1,**lj2,**lj3,**lj4,**offset;
double g_ewald;
- void allocate();
+ virtual void allocate();
};
}
diff --git a/src/KOKKOS/pair_kokkos.h b/src/KOKKOS/pair_kokkos.h
index 288f338c17..f3bef77b86 100644
--- a/src/KOKKOS/pair_kokkos.h
+++ b/src/KOKKOS/pair_kokkos.h
@@ -621,7 +621,7 @@ EV_FLOAT pair_compute_neighlist (PairStyle* fpair, typename Kokkos::Impl::enable
EV_FLOAT ev;
(void) fpair;
(void) list;
- printf("ERROR: calling pair_compute with invalid neighbor list style: requested %i available %i",NEIGHFLAG,PairStyle::EnabledNeighFlags);
+ printf("ERROR: calling pair_compute with invalid neighbor list style: requested %i available %i \n",NEIGHFLAG,PairStyle::EnabledNeighFlags);
return ev;
}
@@ -630,7 +630,7 @@ EV_FLOAT pair_compute_fullcluster (PairStyle* fpair, typename Kokkos::Impl::enab
EV_FLOAT ev;
(void) fpair;
(void) list;
- printf("ERROR: calling pair_compute with invalid neighbor list style: requested %i available %i",FULLCLUSTER,PairStyle::EnabledNeighFlags);
+ printf("ERROR: calling pair_compute with invalid neighbor list style: requested %i available %i \n",FULLCLUSTER,PairStyle::EnabledNeighFlags);
return ev;
}
diff --git a/src/KSPACE/pair_buck_coul_long.cpp b/src/KSPACE/pair_buck_coul_long.cpp
index 7db7211908..08d3ebf3d7 100644
--- a/src/KSPACE/pair_buck_coul_long.cpp
+++ b/src/KSPACE/pair_buck_coul_long.cpp
@@ -50,21 +50,23 @@ PairBuckCoulLong::PairBuckCoulLong(LAMMPS *lmp) : Pair(lmp)
PairBuckCoulLong::~PairBuckCoulLong()
{
- if (allocated) {
- memory->destroy(setflag);
- memory->destroy(cutsq);
+ if (!copymode) {
+ if (allocated) {
+ memory->destroy(setflag);
+ memory->destroy(cutsq);
- memory->destroy(cut_lj);
- memory->destroy(cut_ljsq);
- memory->destroy(a);
- memory->destroy(rho);
- memory->destroy(c);
- memory->destroy(rhoinv);
- memory->destroy(buck1);
- memory->destroy(buck2);
- memory->destroy(offset);
+ memory->destroy(cut_lj);
+ memory->destroy(cut_ljsq);
+ memory->destroy(a);
+ memory->destroy(rho);
+ memory->destroy(c);
+ memory->destroy(rhoinv);
+ memory->destroy(buck1);
+ memory->destroy(buck2);
+ memory->destroy(offset);
+ }
+ if (ftable) free_tables();
}
- if (ftable) free_tables();
}
/* ---------------------------------------------------------------------- */
diff --git a/src/KSPACE/pair_buck_coul_long.h b/src/KSPACE/pair_buck_coul_long.h
index 48bd707941..c19c2d8a5a 100644
--- a/src/KSPACE/pair_buck_coul_long.h
+++ b/src/KSPACE/pair_buck_coul_long.h
@@ -52,7 +52,7 @@ class PairBuckCoulLong : public Pair {
double *cut_respa;
double g_ewald;
- void allocate();
+ virtual void allocate();
};
}
diff --git a/src/KSPACE/pair_coul_long.cpp b/src/KSPACE/pair_coul_long.cpp
index 84c4854deb..8d9347be7b 100644
--- a/src/KSPACE/pair_coul_long.cpp
+++ b/src/KSPACE/pair_coul_long.cpp
@@ -55,13 +55,15 @@ PairCoulLong::PairCoulLong(LAMMPS *lmp) : Pair(lmp)
PairCoulLong::~PairCoulLong()
{
- if (allocated) {
- memory->destroy(setflag);
- memory->destroy(cutsq);
+ if (!copymode) {
+ if (allocated) {
+ memory->destroy(setflag);
+ memory->destroy(cutsq);
- memory->destroy(scale);
+ memory->destroy(scale);
+ }
+ if (ftable) free_tables();
}
- if (ftable) free_tables();
}
/* ---------------------------------------------------------------------- */
diff --git a/src/KSPACE/pair_coul_long.h b/src/KSPACE/pair_coul_long.h
index 0629dfedaa..a231127381 100644
--- a/src/KSPACE/pair_coul_long.h
+++ b/src/KSPACE/pair_coul_long.h
@@ -32,7 +32,7 @@ class PairCoulLong : public Pair {
virtual void settings(int, char **);
void coeff(int, char **);
virtual void init_style();
- double init_one(int, int);
+ virtual double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
virtual void write_restart_settings(FILE *);
@@ -46,7 +46,7 @@ class PairCoulLong : public Pair {
double g_ewald;
double **scale;
- void allocate();
+ virtual void allocate();
};
}
diff --git a/src/KSPACE/pair_lj_charmm_coul_long.cpp b/src/KSPACE/pair_lj_charmm_coul_long.cpp
index a92d175cc2..1fbacdee77 100644
--- a/src/KSPACE/pair_lj_charmm_coul_long.cpp
+++ b/src/KSPACE/pair_lj_charmm_coul_long.cpp
@@ -59,24 +59,27 @@ PairLJCharmmCoulLong::PairLJCharmmCoulLong(LAMMPS *lmp) : Pair(lmp)
PairLJCharmmCoulLong::~PairLJCharmmCoulLong()
{
- if (allocated) {
- memory->destroy(setflag);
- memory->destroy(cutsq);
+ if (!copymode) {
+ if (allocated) {
+ memory->destroy(setflag);
+ memory->destroy(cutsq);
- memory->destroy(epsilon);
- memory->destroy(sigma);
- memory->destroy(eps14);
- memory->destroy(sigma14);
- memory->destroy(lj1);
- memory->destroy(lj2);
- memory->destroy(lj3);
- memory->destroy(lj4);
- memory->destroy(lj14_1);
- memory->destroy(lj14_2);
- memory->destroy(lj14_3);
- memory->destroy(lj14_4);
+ memory->destroy(epsilon);
+ memory->destroy(sigma);
+ memory->destroy(eps14);
+ memory->destroy(sigma14);
+ memory->destroy(lj1);
+ memory->destroy(lj2);
+ memory->destroy(lj3);
+ memory->destroy(lj4);
+ memory->destroy(lj14_1);
+ memory->destroy(lj14_2);
+ memory->destroy(lj14_3);
+ memory->destroy(lj14_4);
+ memory->destroy(offset);
+ }
+ if (ftable) free_tables();
}
- if (ftable) free_tables();
}
/* ---------------------------------------------------------------------- */
@@ -643,6 +646,7 @@ void PairLJCharmmCoulLong::allocate()
memory->create(lj14_2,n+1,n+1,"pair:lj14_2");
memory->create(lj14_3,n+1,n+1,"pair:lj14_3");
memory->create(lj14_4,n+1,n+1,"pair:lj14_4");
+ memory->create(offset,n+1,n+1,"pair:offset");
}
/* ----------------------------------------------------------------------
diff --git a/src/KSPACE/pair_lj_charmm_coul_long.h b/src/KSPACE/pair_lj_charmm_coul_long.h
index 09cf57fffd..8e2c049088 100644
--- a/src/KSPACE/pair_lj_charmm_coul_long.h
+++ b/src/KSPACE/pair_lj_charmm_coul_long.h
@@ -30,11 +30,11 @@ class PairLJCharmmCoulLong : public Pair {
virtual ~PairLJCharmmCoulLong();
virtual void compute(int, int);
- void settings(int, char **);
+ virtual void settings(int, char **);
void coeff(int, char **);
- void init_style();
+ virtual void init_style();
void init_list(int, class NeighList *);
- double init_one(int, int);
+ virtual double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
void write_restart_settings(FILE *);
@@ -61,7 +61,7 @@ class PairLJCharmmCoulLong : public Pair {
double *cut_respa;
double g_ewald;
- void allocate();
+ virtual void allocate();
};
}
diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp
index 430b805f0f..89f4350335 100644
--- a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp
+++ b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp
@@ -43,7 +43,8 @@ PairLJCharmmCoulCharmm::PairLJCharmmCoulCharmm(LAMMPS *lmp) : Pair(lmp)
PairLJCharmmCoulCharmm::~PairLJCharmmCoulCharmm()
{
- if (allocated) {
+ if (!copymode) {
+ if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
@@ -59,6 +60,7 @@ PairLJCharmmCoulCharmm::~PairLJCharmmCoulCharmm()
memory->destroy(lj14_2);
memory->destroy(lj14_3);
memory->destroy(lj14_4);
+ }
}
}
diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm.h b/src/MOLECULE/pair_lj_charmm_coul_charmm.h
index 3f59953b93..1c4ef00fc5 100644
--- a/src/MOLECULE/pair_lj_charmm_coul_charmm.h
+++ b/src/MOLECULE/pair_lj_charmm_coul_charmm.h
@@ -29,10 +29,10 @@ class PairLJCharmmCoulCharmm : public Pair {
PairLJCharmmCoulCharmm(class LAMMPS *);
virtual ~PairLJCharmmCoulCharmm();
virtual void compute(int, int);
- void settings(int, char **);
+ virtual void settings(int, char **);
void coeff(int, char **);
- void init_style();
- double init_one(int, int);
+ virtual void init_style();
+ virtual double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
void write_restart_settings(FILE *);
@@ -51,7 +51,7 @@ class PairLJCharmmCoulCharmm : public Pair {
double **lj1,**lj2,**lj3,**lj4;
double **lj14_1,**lj14_2,**lj14_3,**lj14_4;
- void allocate();
+ virtual void allocate();
};
}
diff --git a/src/pair_buck_coul_cut.cpp b/src/pair_buck_coul_cut.cpp
index 0faf6a6f42..1021bd1e4d 100644
--- a/src/pair_buck_coul_cut.cpp
+++ b/src/pair_buck_coul_cut.cpp
@@ -42,7 +42,7 @@ PairBuckCoulCut::PairBuckCoulCut(LAMMPS *lmp) : Pair(lmp)
PairBuckCoulCut::~PairBuckCoulCut()
{
- if (allocated) {
+ if (!copymode) {
memory->destroy(setflag);
memory->destroy(cutsq);
diff --git a/src/pair_buck_coul_cut.h b/src/pair_buck_coul_cut.h
index cefcc0a701..b400ca3152 100644
--- a/src/pair_buck_coul_cut.h
+++ b/src/pair_buck_coul_cut.h
@@ -48,7 +48,7 @@ class PairBuckCoulCut : public Pair {
double **a,**rho,**c;
double **rhoinv,**buck1,**buck2,**offset;
- void allocate();
+ virtual void allocate();
};
}
diff --git a/src/pair_lj_cut_coul_dsf.cpp b/src/pair_lj_cut_coul_dsf.cpp
index 4d3cbd9a45..0cebb4a845 100644
--- a/src/pair_lj_cut_coul_dsf.cpp
+++ b/src/pair_lj_cut_coul_dsf.cpp
@@ -52,19 +52,21 @@ PairLJCutCoulDSF::PairLJCutCoulDSF(LAMMPS *lmp) : Pair(lmp)
PairLJCutCoulDSF::~PairLJCutCoulDSF()
{
- if (allocated) {
- memory->destroy(setflag);
- memory->destroy(cutsq);
+ if (!copymode) {
+ if (allocated) {
+ memory->destroy(setflag);
+ memory->destroy(cutsq);
- memory->destroy(cut_lj);
- memory->destroy(cut_ljsq);
- memory->destroy(epsilon);
- memory->destroy(sigma);
- memory->destroy(lj1);
- memory->destroy(lj2);
- memory->destroy(lj3);
- memory->destroy(lj4);
- memory->destroy(offset);
+ memory->destroy(cut_lj);
+ memory->destroy(cut_ljsq);
+ memory->destroy(epsilon);
+ memory->destroy(sigma);
+ memory->destroy(lj1);
+ memory->destroy(lj2);
+ memory->destroy(lj3);
+ memory->destroy(lj4);
+ memory->destroy(offset);
+ }
}
}
diff --git a/src/pair_lj_cut_coul_dsf.h b/src/pair_lj_cut_coul_dsf.h
index 7cbc2ad4ff..5a0a6b553d 100644
--- a/src/pair_lj_cut_coul_dsf.h
+++ b/src/pair_lj_cut_coul_dsf.h
@@ -31,8 +31,8 @@ class PairLJCutCoulDSF : public Pair {
void compute(int, int);
void settings(int, char **);
void coeff(int, char **);
- void init_style();
- double init_one(int, int);
+ virtual void init_style();
+ virtual double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
void write_restart_settings(FILE *);
@@ -50,7 +50,7 @@ class PairLJCutCoulDSF : public Pair {
double alpha;
double f_shift,e_shift;
- void allocate();
+ virtual void allocate();
};
}
diff --git a/src/pair_lj_expand.cpp b/src/pair_lj_expand.cpp
index 02e148fe4e..0085a4acd5 100644
--- a/src/pair_lj_expand.cpp
+++ b/src/pair_lj_expand.cpp
@@ -38,7 +38,8 @@ PairLJExpand::PairLJExpand(LAMMPS *lmp) : Pair(lmp)
PairLJExpand::~PairLJExpand()
{
- if (allocated) {
+ if (!copymode) {
+ if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
@@ -51,6 +52,7 @@ PairLJExpand::~PairLJExpand()
memory->destroy(lj3);
memory->destroy(lj4);
memory->destroy(offset);
+ }
}
}
diff --git a/src/pair_lj_expand.h b/src/pair_lj_expand.h
index 05ef3d26e9..3a32716003 100644
--- a/src/pair_lj_expand.h
+++ b/src/pair_lj_expand.h
@@ -30,9 +30,9 @@ class PairLJExpand : public Pair {
virtual ~PairLJExpand();
virtual void compute(int, int);
- void settings(int, char **);
+ virtual void settings(int, char **);
void coeff(int, char **);
- double init_one(int, int);
+ virtual double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
void write_restart_settings(FILE *);
@@ -48,7 +48,7 @@ class PairLJExpand : public Pair {
double **epsilon,**sigma,**shift;
double **lj1,**lj2,**lj3,**lj4,**offset;
- void allocate();
+ virtual void allocate();
};
}
diff --git a/src/pair_lj_gromacs.cpp b/src/pair_lj_gromacs.cpp
index 5b4bb35089..d81be7e83d 100644
--- a/src/pair_lj_gromacs.cpp
+++ b/src/pair_lj_gromacs.cpp
@@ -41,7 +41,8 @@ PairLJGromacs::PairLJGromacs(LAMMPS *lmp) : Pair(lmp)
PairLJGromacs::~PairLJGromacs()
{
- if (allocated) {
+ if (!copymode) {
+ if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
@@ -59,6 +60,7 @@ PairLJGromacs::~PairLJGromacs()
memory->destroy(ljsw3);
memory->destroy(ljsw4);
memory->destroy(ljsw5);
+ }
}
}
diff --git a/src/pair_lj_gromacs.h b/src/pair_lj_gromacs.h
index f02db18c03..c58de220f8 100644
--- a/src/pair_lj_gromacs.h
+++ b/src/pair_lj_gromacs.h
@@ -31,7 +31,7 @@ class PairLJGromacs : public Pair {
virtual void compute(int, int);
virtual void settings(int, char **);
void coeff(int, char **);
- double init_one(int, int);
+ virtual double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
virtual void write_restart_settings(FILE *);
@@ -47,7 +47,7 @@ class PairLJGromacs : public Pair {
double **lj1,**lj2,**lj3,**lj4;
double **ljsw1,**ljsw2,**ljsw3,**ljsw4,**ljsw5;
- void allocate();
+ virtual void allocate();
};
}
diff --git a/src/pair_lj_gromacs_coul_gromacs.cpp b/src/pair_lj_gromacs_coul_gromacs.cpp
index 5a78c4e140..bd9bb56c7e 100644
--- a/src/pair_lj_gromacs_coul_gromacs.cpp
+++ b/src/pair_lj_gromacs_coul_gromacs.cpp
@@ -41,7 +41,8 @@ PairLJGromacsCoulGromacs::PairLJGromacsCoulGromacs(LAMMPS *lmp) : Pair(lmp)
PairLJGromacsCoulGromacs::~PairLJGromacsCoulGromacs()
{
- if (allocated) {
+ if (!copymode) {
+ if (allocated) {
memory->destroy(setflag);
memory->destroy(cutsq);
@@ -56,6 +57,7 @@ PairLJGromacsCoulGromacs::~PairLJGromacsCoulGromacs()
memory->destroy(ljsw3);
memory->destroy(ljsw4);
memory->destroy(ljsw5);
+ }
}
}
diff --git a/src/pair_lj_gromacs_coul_gromacs.h b/src/pair_lj_gromacs_coul_gromacs.h
index 378a51a98c..85b3051b25 100644
--- a/src/pair_lj_gromacs_coul_gromacs.h
+++ b/src/pair_lj_gromacs_coul_gromacs.h
@@ -31,8 +31,8 @@ class PairLJGromacsCoulGromacs : public Pair {
virtual void compute(int, int);
virtual void settings(int, char **);
void coeff(int, char **);
- void init_style();
- double init_one(int, int);
+ virtual void init_style();
+ virtual double init_one(int, int);
void write_restart(FILE *);
void read_restart(FILE *);
virtual void write_restart_settings(FILE *);
@@ -49,7 +49,7 @@ class PairLJGromacsCoulGromacs : public Pair {
double **ljsw1,**ljsw2,**ljsw3,**ljsw4,**ljsw5;
double coulsw1,coulsw2,coulsw3,coulsw4,coulsw5;
- void allocate();
+ virtual void allocate();
};
}
From 185b8197d5cc32d28bfe80c7d2ccd87db49dddf0 Mon Sep 17 00:00:00 2001
From: sjplimp
Date: Fri, 27 Mar 2015 13:48:30 +0000
Subject: [PATCH 03/22] git-svn-id:
svn://svn.icms.temple.edu/lammps-ro/trunk@13304
f3b2605a-c512-4ea7-a41b-209d697bcdaa
---
src/KOKKOS/Install.sh | 34 ++++++++++++++++++++++++++++++++--
1 file changed, 32 insertions(+), 2 deletions(-)
diff --git a/src/KOKKOS/Install.sh b/src/KOKKOS/Install.sh
index 91dd935da6..c28f68280e 100644
--- a/src/KOKKOS/Install.sh
+++ b/src/KOKKOS/Install.sh
@@ -81,23 +81,53 @@ action neigh_list_kokkos.cpp
action neigh_list_kokkos.h
action neighbor_kokkos.cpp
action neighbor_kokkos.h
+action pair_buck_coul_cut_kokkos.cpp
+action pair_buck_coul_cut_kokkos.h
+action pair_buck_coul_long_kokkos.cpp
+action pair_buck_coul_long_kokkos.h
action pair_buck_kokkos.cpp
action pair_buck_kokkos.h
action pair_coul_cut_kokkos.cpp
action pair_coul_cut_kokkos.h
+action pair_coul_debye_kokkos.cpp
+action pair_coul_debye_kokkos.h
action pair_coul_dsf_kokkos.cpp
action pair_coul_dsf_kokkos.h
+action pair_coul_long_kokkos.cpp
+action pair_coul_long_kokkos.h
action pair_coul_wolf_kokkos.cpp
action pair_coul_wolf_kokkos.h
action pair_eam_kokkos.cpp pair_eam.cpp
action pair_eam_kokkos.h pair_eam.h
action pair_kokkos.h
+action pair_lj_charmm_coul_charmm_implicit_kokkos.cpp pair_lj_charmm_coul_charmm_implicit.cpp
+action pair_lj_charmm_coul_charmm_implicit_kokkos.h pair_lj_charmm_coul_charmm_implicit.h
+action pair_lj_charmm_coul_charmm_kokkos.cpp pair_lj_charmm_coul_charmm.cpp
+action pair_lj_charmm_coul_charmm_kokkos.h pair_lj_charmm_coul_charmm.h
+action pair_lj_charmm_coul_long_kokkos.cpp pair_lj_charmm_coul_long.cpp
+action pair_lj_charmm_coul_long_kokkos.h pair_lj_charmm_coul_long.h
+action pair_lj_class2_coul_cut_kokkos.cpp pair_lj_class2_coul_cut.cpp
+action pair_lj_class2_coul_cut_kokkos.h pair_lj_class2_coul_cut.h
+action pair_lj_class2_coul_long_kokkos.cpp pair_lj_class2_coul_long.cpp
+action pair_lj_class2_coul_long_kokkos.h pair_lj_class2_coul_long.h
+action pair_lj_class2_kokkos.cpp pair_lj_class2.cpp
+action pair_lj_class2_kokkos.h pair_lj_class2.h
action pair_lj_cut_coul_cut_kokkos.cpp
action pair_lj_cut_coul_cut_kokkos.h
-action pair_lj_cut_coul_long_kokkos.cpp pair_lj_cut_coul_long.cpp
-action pair_lj_cut_coul_long_kokkos.h pair_lj_cut_coul_long.h
+action pair_lj_cut_coul_debye_kokkos.cpp
+action pair_lj_cut_coul_debye_kokkos.h
+action pair_lj_cut_coul_dsf_kokkos.cpp
+action pair_lj_cut_coul_dsf_kokkos.h
+action pair_lj_cut_coul_long_kokkos.cpp pair_lj_cut_coul_long.cpp pair_lj_cut_coul_long_kokkos.cpp pair_lj_cut_co.cpp
+action pair_lj_cut_coul_long_kokkos.h pair_lj_cut_coul_long.h pair_lj_cut_coul_long_kokkos.h pair_lj_cut_co.h
action pair_lj_cut_kokkos.cpp
action pair_lj_cut_kokkos.h
+action pair_lj_expand_kokkos.cpp
+action pair_lj_expand_kokkos.h
+action pair_lj_gromacs_coul_gromacs_kokkos.cp
+action pair_lj_gromacs_coul_gromacs_kokkos.h
+action pair_lj_gromacs_kokkos.cpp
+action pair_lj_gromacs_kokkos.h
action pair_table_kokkos.cpp
action pair_table_kokkos.h
action verlet_kokkos.cpp
From f1acd4762f16f736916e0b7de991af54cda69cb5 Mon Sep 17 00:00:00 2001
From: sjplimp
Date: Fri, 27 Mar 2015 13:48:47 +0000
Subject: [PATCH 04/22] git-svn-id:
svn://svn.icms.temple.edu/lammps-ro/trunk@13305
f3b2605a-c512-4ea7-a41b-209d697bcdaa
---
src/KOKKOS/pair_buck_coul_cut_kokkos.cpp | 373 ++++++++++++
src/KOKKOS/pair_buck_coul_cut_kokkos.h | 134 +++++
src/KOKKOS/pair_buck_coul_long_kokkos.cpp | 517 +++++++++++++++++
src/KOKKOS/pair_buck_coul_long_kokkos.h | 150 +++++
src/KOKKOS/pair_coul_debye_kokkos.cpp | 313 ++++++++++
src/KOKKOS/pair_coul_debye_kokkos.h | 135 +++++
src/KOKKOS/pair_coul_long_kokkos.cpp | 456 +++++++++++++++
src/KOKKOS/pair_coul_long_kokkos.h | 154 +++++
..._lj_charmm_coul_charmm_implicit_kokkos.cpp | 513 +++++++++++++++++
...ir_lj_charmm_coul_charmm_implicit_kokkos.h | 151 +++++
.../pair_lj_charmm_coul_charmm_kokkos.cpp | 515 +++++++++++++++++
.../pair_lj_charmm_coul_charmm_kokkos.h | 151 +++++
.../pair_lj_charmm_coul_long_kokkos.cpp | 534 ++++++++++++++++++
src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h | 151 +++++
src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp | 354 ++++++++++++
src/KOKKOS/pair_lj_class2_coul_cut_kokkos.h | 131 +++++
.../pair_lj_class2_coul_long_kokkos.cpp | 503 +++++++++++++++++
src/KOKKOS/pair_lj_class2_coul_long_kokkos.h | 147 +++++
src/KOKKOS/pair_lj_class2_kokkos.cpp | 281 +++++++++
src/KOKKOS/pair_lj_class2_kokkos.h | 125 ++++
src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp | 375 ++++++++++++
src/KOKKOS/pair_lj_cut_coul_debye_kokkos.h | 131 +++++
src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp | 366 ++++++++++++
src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.h | 130 +++++
src/KOKKOS/pair_lj_expand_kokkos.cpp | 285 ++++++++++
src/KOKKOS/pair_lj_expand_kokkos.h | 125 ++++
.../pair_lj_gromacs_coul_gromacs_kokkos.cpp | 501 ++++++++++++++++
.../pair_lj_gromacs_coul_gromacs_kokkos.h | 151 +++++
src/KOKKOS/pair_lj_gromacs_kokkos.cpp | 333 +++++++++++
src/KOKKOS/pair_lj_gromacs_kokkos.h | 153 +++++
30 files changed, 8338 insertions(+)
create mode 100644 src/KOKKOS/pair_buck_coul_cut_kokkos.cpp
create mode 100644 src/KOKKOS/pair_buck_coul_cut_kokkos.h
create mode 100644 src/KOKKOS/pair_buck_coul_long_kokkos.cpp
create mode 100644 src/KOKKOS/pair_buck_coul_long_kokkos.h
create mode 100644 src/KOKKOS/pair_coul_debye_kokkos.cpp
create mode 100644 src/KOKKOS/pair_coul_debye_kokkos.h
create mode 100644 src/KOKKOS/pair_coul_long_kokkos.cpp
create mode 100644 src/KOKKOS/pair_coul_long_kokkos.h
create mode 100644 src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp
create mode 100644 src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.h
create mode 100644 src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp
create mode 100644 src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.h
create mode 100644 src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp
create mode 100644 src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h
create mode 100644 src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp
create mode 100644 src/KOKKOS/pair_lj_class2_coul_cut_kokkos.h
create mode 100644 src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp
create mode 100644 src/KOKKOS/pair_lj_class2_coul_long_kokkos.h
create mode 100644 src/KOKKOS/pair_lj_class2_kokkos.cpp
create mode 100644 src/KOKKOS/pair_lj_class2_kokkos.h
create mode 100644 src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp
create mode 100644 src/KOKKOS/pair_lj_cut_coul_debye_kokkos.h
create mode 100644 src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp
create mode 100644 src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.h
create mode 100644 src/KOKKOS/pair_lj_expand_kokkos.cpp
create mode 100644 src/KOKKOS/pair_lj_expand_kokkos.h
create mode 100644 src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp
create mode 100644 src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.h
create mode 100644 src/KOKKOS/pair_lj_gromacs_kokkos.cpp
create mode 100644 src/KOKKOS/pair_lj_gromacs_kokkos.h
diff --git a/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp b/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp
new file mode 100644
index 0000000000..7ffdf903f3
--- /dev/null
+++ b/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp
@@ -0,0 +1,373 @@
+/* ----------------------------------------------------------------------
+ LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
+ http://lammps.sandia.gov, Sandia National Laboratories
+ Steve Plimpton, sjplimp@sandia.gov
+
+ Copyright (2003) Sandia Corporation. Under the terms of Contract
+ DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
+ certain rights in this software. This software is distributed under
+ the GNU General Public License.
+
+ See the README file in the top-level LAMMPS directory.
+------------------------------------------------------------------------- */
+
+/* ----------------------------------------------------------------------
+ Contributing author: Ray Shan (SNL)
+------------------------------------------------------------------------- */
+
+#include "math.h"
+#include "stdio.h"
+#include "stdlib.h"
+#include "string.h"
+#include "pair_buck_coul_cut_kokkos.h"
+#include "kokkos.h"
+#include "atom_kokkos.h"
+#include "comm.h"
+#include "force.h"
+#include "neighbor.h"
+#include "neigh_list.h"
+#include "neigh_request.h"
+#include "update.h"
+#include "integrate.h"
+#include "respa.h"
+#include "math_const.h"
+#include "memory.h"
+#include "error.h"
+#include "atom_masks.h"
+
+using namespace LAMMPS_NS;
+using namespace MathConst;
+
+#define KOKKOS_CUDA_MAX_THREADS 256
+#define KOKKOS_CUDA_MIN_BLOCKS 8
+
+/* ---------------------------------------------------------------------- */
+
+template
+PairBuckCoulCutKokkos::PairBuckCoulCutKokkos(LAMMPS *lmp):PairBuckCoulCut(lmp)
+{
+ respa_enable = 0;
+
+ atomKK = (AtomKokkos *) atom;
+ execution_space = ExecutionSpaceFromDevice::space;
+ datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK;
+ datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK;
+ cutsq = NULL;
+ cut_ljsq = NULL;
+ cut_coulsq = NULL;
+
+}
+
+/* ---------------------------------------------------------------------- */
+
+template
+PairBuckCoulCutKokkos::~PairBuckCoulCutKokkos()
+{
+
+ if (!copymode) {
+ memory->destroy_kokkos(k_eatom,eatom);
+ memory->destroy_kokkos(k_vatom,vatom);
+ k_cutsq = DAT::tdual_ffloat_2d();
+ k_cut_ljsq = DAT::tdual_ffloat_2d();
+ k_cut_coulsq = DAT::tdual_ffloat_2d();
+ memory->sfree(cutsq);
+ memory->sfree(cut_ljsq);
+ memory->sfree(cut_coulsq);
+ eatom = NULL;
+ vatom = NULL;
+ cutsq = NULL;
+ cut_ljsq = NULL;
+ cut_coulsq = NULL;
+ }
+
+}
+
+/* ---------------------------------------------------------------------- */
+
+template
+void PairBuckCoulCutKokkos::compute(int eflag_in, int vflag_in)
+{
+ eflag = eflag_in;
+ vflag = vflag_in;
+
+ if (neighflag == FULL || neighflag == FULLCLUSTER) no_virial_fdotr_compute = 1;
+
+ if (eflag || vflag) ev_setup(eflag,vflag);
+ else evflag = vflag_fdotr = 0;
+
+ // reallocate per-atom arrays if necessary
+
+ if (eflag_atom) {
+ memory->destroy_kokkos(k_eatom,eatom);
+ memory->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom");
+ d_eatom = k_eatom.view();
+ }
+ if (vflag_atom) {
+ memory->destroy_kokkos(k_vatom,vatom);
+ memory->create_kokkos(k_vatom,vatom,maxvatom,6,"pair:vatom");
+ d_vatom = k_vatom.view();
+ }
+
+ atomKK->sync(execution_space,datamask_read);
+ k_cutsq.template sync();
+ k_cut_ljsq.template sync();
+ k_cut_coulsq.template sync();
+ k_params.template sync();
+ if (eflag || vflag) atomKK->modified(execution_space,datamask_modify);
+ else atomKK->modified(execution_space,F_MASK);
+
+ x = atomKK->k_x.view();
+ c_x = atomKK->k_x.view();
+ f = atomKK->k_f.view();
+ q = atomKK->k_q.view();
+ type = atomKK->k_type.view();
+ nlocal = atom->nlocal;
+ nall = atom->nlocal + atom->nghost;
+ qqrd2e = force->qqrd2e;
+ newton_pair = force->newton_pair;
+ special_lj[0] = force->special_lj[0];
+ special_lj[1] = force->special_lj[1];
+ special_lj[2] = force->special_lj[2];
+ special_lj[3] = force->special_lj[3];
+ special_coul[0] = force->special_coul[0];
+ special_coul[1] = force->special_coul[1];
+ special_coul[2] = force->special_coul[2];
+ special_coul[3] = force->special_coul[3];
+
+ // loop over neighbors of my atoms
+
+ copymode = 1;
+
+ EV_FLOAT ev = pair_compute,void >
+ (this,(NeighListKokkos*)list);
+
+ DeviceType::fence();
+
+ if (eflag) {
+ eng_vdwl += ev.evdwl;
+ eng_coul += ev.ecoul;
+ }
+ if (vflag_global) {
+ virial[0] += ev.v[0];
+ virial[1] += ev.v[1];
+ virial[2] += ev.v[2];
+ virial[3] += ev.v[3];
+ virial[4] += ev.v[4];
+ virial[5] += ev.v[5];
+ }
+
+ if (vflag_fdotr) virial_fdotr_compute();
+
+ if (eflag_atom) {
+ k_eatom.template modify();
+ k_eatom.template sync();
+ }
+
+ if (vflag_atom) {
+ k_vatom.template modify();
+ k_vatom.template sync();
+ }
+
+ copymode = 0;
+}
+
+/* ----------------------------------------------------------------------
+ compute Buckingham pair force between atoms i and j
+ ---------------------------------------------------------------------- */
+template
+template
+KOKKOS_INLINE_FUNCTION
+F_FLOAT PairBuckCoulCutKokkos::
+compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const {
+ const F_FLOAT r2inv = 1.0/rsq;
+ const F_FLOAT r6inv = r2inv*r2inv*r2inv;
+ const F_FLOAT r = sqrt(rsq);
+ const F_FLOAT rexp = exp(-r*(STACKPARAMS?m_params[itype][jtype].rhoinv:params(itype,jtype).rhoinv));
+
+ const F_FLOAT forcebuck =
+ (STACKPARAMS?m_params[itype][jtype].buck1:params(itype,jtype).buck1)*r*rexp -
+ (STACKPARAMS?m_params[itype][jtype].buck2:params(itype,jtype).buck2)*r6inv;
+
+ return forcebuck*r2inv;
+}
+
+/* ----------------------------------------------------------------------
+ compute Buckingham pair potential energy between atoms i and j
+ ---------------------------------------------------------------------- */
+template
+template
+KOKKOS_INLINE_FUNCTION
+F_FLOAT PairBuckCoulCutKokkos::
+compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const {
+ const F_FLOAT r2inv = 1.0/rsq;
+ const F_FLOAT r6inv = r2inv*r2inv*r2inv;
+ const F_FLOAT r = sqrt(rsq);
+ const F_FLOAT rexp = exp(-r*(STACKPARAMS?m_params[itype][jtype].rhoinv:params(itype,jtype).rhoinv));
+
+ return (STACKPARAMS?m_params[itype][jtype].a:params(itype,jtype).a)*rexp -
+ (STACKPARAMS?m_params[itype][jtype].c:params(itype,jtype).c)*r6inv -
+ (STACKPARAMS?m_params[itype][jtype].offset:params(itype,jtype).offset);
+}
+
+/* ----------------------------------------------------------------------
+ compute coulomb pair force between atoms i and j
+ ---------------------------------------------------------------------- */
+template
+template
+KOKKOS_INLINE_FUNCTION
+F_FLOAT PairBuckCoulCutKokkos::
+compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j,
+ const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const {
+ const F_FLOAT r2inv = 1.0/rsq;
+ const F_FLOAT rinv = sqrt(r2inv);
+ F_FLOAT forcecoul;
+
+ forcecoul = qqrd2e*qtmp*q(j) *rinv;
+
+ return factor_coul*forcecoul*r2inv;
+}
+
+/* ----------------------------------------------------------------------
+ compute coulomb pair potential energy between atoms i and j
+ ---------------------------------------------------------------------- */
+template
+template
+KOKKOS_INLINE_FUNCTION
+F_FLOAT PairBuckCoulCutKokkos::
+compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j,
+ const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const {
+ const F_FLOAT r2inv = 1.0/rsq;
+ const F_FLOAT rinv = sqrt(r2inv);
+
+ return factor_coul*qqrd2e*qtmp*q(j)*rinv;
+
+}
+
+/* ----------------------------------------------------------------------
+ allocate all arrays
+------------------------------------------------------------------------- */
+
+template
+void PairBuckCoulCutKokkos::allocate()
+{
+ PairBuckCoulCut::allocate();
+
+ int n = atom->ntypes;
+ memory->destroy(cutsq);
+ memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq");
+ d_cutsq = k_cutsq.template view();
+ memory->destroy(cut_ljsq);
+ memory->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq");
+ d_cut_ljsq = k_cut_ljsq.template view();
+ memory->destroy(cut_coulsq);
+ memory->create_kokkos(k_cut_coulsq,cut_coulsq,n+1,n+1,"pair:cut_coulsq");
+ d_cut_coulsq = k_cut_coulsq.template view();
+ k_params = Kokkos::DualView("PairBuckCoulCut::params",n+1,n+1);
+ params = k_params.d_view;
+}
+
+/* ----------------------------------------------------------------------
+ global settings
+------------------------------------------------------------------------- */
+
+template
+void PairBuckCoulCutKokkos::settings(int narg, char **arg)
+{
+ if (narg > 2) error->all(FLERR,"Illegal pair_style command");
+
+ PairBuckCoulCut::settings(1,arg);
+}
+
+/* ----------------------------------------------------------------------
+ init specific to this pair style
+------------------------------------------------------------------------- */
+
+template
+void PairBuckCoulCutKokkos::init_style()
+{
+ PairBuckCoulCut::init_style();
+
+ // error if rRESPA with inner levels
+
+ if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
+ int respa = 0;
+ if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
+ if (((Respa *) update->integrate)->level_middle >= 0) respa = 2;
+ if (respa)
+ error->all(FLERR,"Cannot use Kokkos pair style with rRESPA inner/middle");
+ }
+
+ // irequest = neigh request made by parent class
+
+ neighflag = lmp->kokkos->neighflag;
+ int irequest = neighbor->nrequest - 1;
+
+ neighbor->requests[irequest]->
+ kokkos_host = Kokkos::Impl::is_same::value &&
+ !Kokkos::Impl::is_same::value;
+ neighbor->requests[irequest]->
+ kokkos_device = Kokkos::Impl::is_same::value;
+
+ if (neighflag == FULL) {
+ neighbor->requests[irequest]->full = 1;
+ neighbor->requests[irequest]->half = 0;
+ neighbor->requests[irequest]->full_cluster = 0;
+ } else if (neighflag == HALF || neighflag == HALFTHREAD) {
+ neighbor->requests[irequest]->full = 0;
+ neighbor->requests[irequest]->half = 1;
+ neighbor->requests[irequest]->full_cluster = 0;
+ } else if (neighflag == N2) {
+ neighbor->requests[irequest]->full_cluster = 0;
+ neighbor->requests[irequest]->full = 0;
+ neighbor->requests[irequest]->half = 0;
+ } else if (neighflag == FULLCLUSTER) {
+ neighbor->requests[irequest]->full = 1;
+ neighbor->requests[irequest]->half = 0;
+ neighbor->requests[irequest]->full_cluster = 1;
+ } else {
+ error->all(FLERR,"Cannot use chosen neighbor list style with buck/coul/cut/kk");
+ }
+}
+
+/* ----------------------------------------------------------------------
+ init for one type pair i,j and corresponding j,i
+------------------------------------------------------------------------- */
+
+template
+double PairBuckCoulCutKokkos::init_one(int i, int j)
+{
+ double cutone = PairBuckCoulCut::init_one(i,j);
+ double cut_ljsqm = cut_ljsq[i][j];
+ double cut_coulsqm = cut_coulsq[i][j];
+
+ k_params.h_view(i,j).a = a[i][j];
+ k_params.h_view(i,j).c = c[i][j];
+ k_params.h_view(i,j).rhoinv = rhoinv[i][j];
+ k_params.h_view(i,j).buck1 = buck1[i][j];
+ k_params.h_view(i,j).buck2 = buck2[i][j];
+ k_params.h_view(i,j).offset = offset[i][j];
+ k_params.h_view(i,j).cut_ljsq = cut_ljsqm;
+ k_params.h_view(i,j).cut_coulsq = cut_coulsqm;
+
+ k_params.h_view(j,i) = k_params.h_view(i,j);
+ if(i();
+ k_cut_ljsq.h_view(i,j) = cut_ljsqm;
+ k_cut_ljsq.template modify();
+ k_cut_coulsq.h_view(i,j) = cut_coulsqm;
+ k_cut_coulsq.template modify();
+ k_params.template modify();
+
+ return cutone;
+}
+
+template class PairBuckCoulCutKokkos;
+#ifdef KOKKOS_HAVE_CUDA
+template class PairBuckCoulCutKokkos;
+#endif
diff --git a/src/KOKKOS/pair_buck_coul_cut_kokkos.h b/src/KOKKOS/pair_buck_coul_cut_kokkos.h
new file mode 100644
index 0000000000..709098493b
--- /dev/null
+++ b/src/KOKKOS/pair_buck_coul_cut_kokkos.h
@@ -0,0 +1,134 @@
+/* -*- c++ -*- ----------------------------------------------------------
+ LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
+ http://lammps.sandia.gov, Sandia National Laboratories
+ Steve Plimpton, sjplimp@sandia.gov
+
+ Copyright (2003) Sandia Corporation. Under the terms of Contract
+ DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
+ certain rights in this software. This software is distributed under
+ the GNU General Public License.
+
+ See the README file in the top-level LAMMPS directory.
+------------------------------------------------------------------------- */
+
+#ifdef PAIR_CLASS
+
+PairStyle(buck/coul/cut/kk,PairBuckCoulCutKokkos)
+PairStyle(buck/coul/cut/kk/device,PairBuckCoulCutKokkos)
+PairStyle(buck/coul/cut/kk/host,PairBuckCoulCutKokkos)
+
+#else
+
+#ifndef LMP_PAIR_BUCK_COUL_CUT_KOKKOS_H
+#define LMP_PAIR_BUCK_COUL_CUT_KOKKOS_H
+
+#include "pair_kokkos.h"
+#include "pair_buck_coul_cut.h"
+#include "neigh_list_kokkos.h"
+
+namespace LAMMPS_NS {
+
+template
+class PairBuckCoulCutKokkos : public PairBuckCoulCut {
+ public:
+ enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF};
+ enum {COUL_FLAG=1};
+ typedef DeviceType device_type;
+ PairBuckCoulCutKokkos(class LAMMPS *);
+ ~PairBuckCoulCutKokkos();
+
+ void compute(int, int);
+
+ void settings(int, char **);
+ void init_style();
+ double init_one(int, int);
+
+ struct params_buck_coul{
+ params_buck_coul(){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;};
+ params_buck_coul(int i){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;};
+ F_FLOAT cut_ljsq,cut_coulsq,a,c,rhoinv,buck1,buck2,offset;
+ };
+
+ protected:
+ void cleanup_copy() {}
+
+ template
+ KOKKOS_INLINE_FUNCTION
+ F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j,
+ const int& itype, const int& jtype) const;
+
+ template
+ KOKKOS_INLINE_FUNCTION
+ F_FLOAT compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j,
+ const int& itype, const int& jtype) const;
+
+ template
+ KOKKOS_INLINE_FUNCTION
+ F_FLOAT compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j,
+ const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const;
+
+ template
+ KOKKOS_INLINE_FUNCTION
+ F_FLOAT compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j,
+ const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const;
+
+ Kokkos::DualView k_params;
+ typename Kokkos::DualView::t_dev_const params;
+ // hardwired to space for 15 atom types
+ params_buck_coul m_params[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1];
+
+ F_FLOAT m_cutsq[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1];
+ F_FLOAT m_cut_ljsq[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1];
+ F_FLOAT m_cut_coulsq[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1];
+ typename ArrayTypes::t_x_array_randomread x;
+ typename ArrayTypes::t_x_array c_x;
+ typename ArrayTypes::t_f_array f;
+ typename ArrayTypes::t_int_1d_randomread type;
+ typename ArrayTypes::t_float_1d_randomread q;
+
+ DAT::tdual_efloat_1d k_eatom;
+ DAT::tdual_virial_array k_vatom;
+ typename ArrayTypes::t_efloat_1d d_eatom;
+ typename ArrayTypes::t_virial_array d_vatom;
+
+ int newton_pair;
+
+ typename ArrayTypes::tdual_ffloat_2d k_cutsq;
+ typename ArrayTypes::t_ffloat_2d d_cutsq;
+ typename ArrayTypes::tdual_ffloat_2d k_cut_ljsq;
+ typename ArrayTypes::t_ffloat_2d d_cut_ljsq;
+ typename ArrayTypes::tdual_ffloat_2d k_cut_coulsq;
+ typename ArrayTypes::t_ffloat_2d d_cut_coulsq;
+
+ class AtomKokkos *atomKK;
+ int neighflag;
+ int nlocal,nall,eflag,vflag;
+
+ double special_lj[4], special_coul[4];
+ double qqrd2e;
+
+ void allocate();
+
+ friend class PairComputeFunctor;
+ friend class PairComputeFunctor;
+ friend class PairComputeFunctor;
+ friend class PairComputeFunctor;
+ friend class PairComputeFunctor;
+ friend class PairComputeFunctor;
+ friend EV_FLOAT pair_compute_neighlist(PairBuckCoulCutKokkos*,NeighListKokkos*);
+ friend EV_FLOAT pair_compute_neighlist(PairBuckCoulCutKokkos*,NeighListKokkos*);
+ friend EV_FLOAT pair_compute_neighlist(PairBuckCoulCutKokkos*,NeighListKokkos*);
+ friend EV_FLOAT pair_compute(PairBuckCoulCutKokkos*,
+ NeighListKokkos*);
+
+};
+
+}
+
+#endif
+#endif
+
+/* ERROR/WARNING messages:
+
+*/
diff --git a/src/KOKKOS/pair_buck_coul_long_kokkos.cpp b/src/KOKKOS/pair_buck_coul_long_kokkos.cpp
new file mode 100644
index 0000000000..1f733ab3d7
--- /dev/null
+++ b/src/KOKKOS/pair_buck_coul_long_kokkos.cpp
@@ -0,0 +1,517 @@
+/* ----------------------------------------------------------------------
+ LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
+ http://lammps.sandia.gov, Sandia National Laboratories
+ Steve Plimpton, sjplimp@sandia.gov
+
+ Copyright (2003) Sandia Corporation. Under the terms of Contract
+ DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
+ certain rights in this software. This software is distributed under
+ the GNU General Public License.
+
+ See the README file in the top-level LAMMPS directory.
+------------------------------------------------------------------------- */
+
+/* ----------------------------------------------------------------------
+ Contributing author: Ray Shan (SNL)
+------------------------------------------------------------------------- */
+
+#include "math.h"
+#include "stdio.h"
+#include "stdlib.h"
+#include "string.h"
+#include "pair_buck_coul_long_kokkos.h"
+#include "kokkos.h"
+#include "atom_kokkos.h"
+#include "comm.h"
+#include "force.h"
+#include "neighbor.h"
+#include "neigh_list.h"
+#include "neigh_request.h"
+#include "update.h"
+#include "integrate.h"
+#include "respa.h"
+#include "math_const.h"
+#include "memory.h"
+#include "error.h"
+#include "atom_masks.h"
+
+using namespace LAMMPS_NS;
+using namespace MathConst;
+
+#define KOKKOS_CUDA_MAX_THREADS 256
+#define KOKKOS_CUDA_MIN_BLOCKS 8
+
+
+#define EWALD_F 1.12837917
+#define EWALD_P 0.3275911
+#define A1 0.254829592
+#define A2 -0.284496736
+#define A3 1.421413741
+#define A4 -1.453152027
+#define A5 1.061405429
+
+/* ---------------------------------------------------------------------- */
+
+template
+PairBuckCoulLongKokkos::PairBuckCoulLongKokkos(LAMMPS *lmp):PairBuckCoulLong(lmp)
+{
+ respa_enable = 0;
+
+ atomKK = (AtomKokkos *) atom;
+ execution_space = ExecutionSpaceFromDevice::space;
+ datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK;
+ datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK;
+ cutsq = NULL;
+ cut_ljsq = NULL;
+ cut_coulsq = 0.0;
+
+}
+
+/* ---------------------------------------------------------------------- */
+
+template
+PairBuckCoulLongKokkos::~PairBuckCoulLongKokkos()
+{
+ if (!copymode) {
+ memory->destroy_kokkos(k_eatom,eatom);
+ memory->destroy_kokkos(k_vatom,vatom);
+ k_cutsq = DAT::tdual_ffloat_2d();
+ k_cut_ljsq = DAT::tdual_ffloat_2d();
+ k_cut_coulsq = DAT::tdual_ffloat_2d();
+ memory->sfree(cutsq);
+ memory->sfree(cut_ljsq);
+ //memory->sfree(cut_coulsq);
+ eatom = NULL;
+ vatom = NULL;
+ cutsq = NULL;
+ cut_ljsq = NULL;
+ //cut_coulsq = NULL;
+ }
+}
+
+/* ---------------------------------------------------------------------- */
+
+template
+void PairBuckCoulLongKokkos::cleanup_copy() {
+ allocated = 0;
+ cutsq = NULL;
+ cut_ljsq = NULL;
+ eatom = NULL;
+ vatom = NULL;
+ ftable = NULL;
+}
+
+/* ---------------------------------------------------------------------- */
+
+template
+void PairBuckCoulLongKokkos::compute(int eflag_in, int vflag_in)
+{
+ eflag = eflag_in;
+ vflag = vflag_in;
+
+ if (neighflag == FULL || neighflag == FULLCLUSTER) no_virial_fdotr_compute = 1;
+
+ if (eflag || vflag) ev_setup(eflag,vflag);
+ else evflag = vflag_fdotr = 0;
+
+ atomKK->sync(execution_space,datamask_read);
+ k_cutsq.template sync();
+ k_cut_ljsq.template sync();
+ k_cut_coulsq.template sync();
+ k_params.template sync();
+ if (eflag || vflag) atomKK->modified(execution_space,datamask_modify);
+ else atomKK->modified(execution_space,F_MASK);
+
+ x = atomKK->k_x.view();
+ c_x = atomKK->k_x.view();
+ f = atomKK->k_f.view();
+ q = atomKK->k_q.view();
+ type = atomKK->k_type.view();
+ nlocal = atom->nlocal;
+ nall = atom->nlocal + atom->nghost;
+ qqrd2e = force->qqrd2e;
+ newton_pair = force->newton_pair;
+ special_lj[0] = force->special_lj[0];
+ special_lj[1] = force->special_lj[1];
+ special_lj[2] = force->special_lj[2];
+ special_lj[3] = force->special_lj[3];
+ special_coul[0] = force->special_coul[0];
+ special_coul[1] = force->special_coul[1];
+ special_coul[2] = force->special_coul[2];
+ special_coul[3] = force->special_coul[3];
+
+ // loop over neighbors of my atoms
+
+ copymode = 1;
+
+ EV_FLOAT ev;
+ if(ncoultablebits)
+ ev = pair_compute,CoulLongTable<1> >
+ (this,(NeighListKokkos*)list);
+ else
+ ev = pair_compute,CoulLongTable<0> >
+ (this,(NeighListKokkos*)list);
+
+
+ DeviceType::fence();
+
+ if (eflag) {
+ eng_vdwl += ev.evdwl;
+ eng_coul += ev.ecoul;
+ }
+ if (vflag_global) {
+ virial[0] += ev.v[0];
+ virial[1] += ev.v[1];
+ virial[2] += ev.v[2];
+ virial[3] += ev.v[3];
+ virial[4] += ev.v[4];
+ virial[5] += ev.v[5];
+ }
+
+ if (vflag_fdotr) pair_virial_fdotr_compute(this);
+
+ copymode = 0;
+}
+
+/* ----------------------------------------------------------------------
+ compute Buckingham pair force between atoms i and j
+ ---------------------------------------------------------------------- */
+template
+template
+KOKKOS_INLINE_FUNCTION
+F_FLOAT PairBuckCoulLongKokkos::
+compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const {
+ const F_FLOAT r2inv = 1.0/rsq;
+ const F_FLOAT r6inv = r2inv*r2inv*r2inv;
+ const F_FLOAT r = sqrt(rsq);
+ const F_FLOAT rexp = exp(-r*(STACKPARAMS?m_params[itype][jtype].rhoinv:params(itype,jtype).rhoinv));
+
+ const F_FLOAT forcebuck =
+ (STACKPARAMS?m_params[itype][jtype].buck1:params(itype,jtype).buck1)*r*rexp -
+ (STACKPARAMS?m_params[itype][jtype].buck2:params(itype,jtype).buck2)*r6inv;
+
+ return forcebuck*r2inv;
+}
+
+/* ----------------------------------------------------------------------
+ compute Buckingham pair potential energy between atoms i and j
+ ---------------------------------------------------------------------- */
+template
+template
+KOKKOS_INLINE_FUNCTION
+F_FLOAT PairBuckCoulLongKokkos::
+compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const {
+ const F_FLOAT r2inv = 1.0/rsq;
+ const F_FLOAT r6inv = r2inv*r2inv*r2inv;
+ const F_FLOAT r = sqrt(rsq);
+ const F_FLOAT rexp = exp(-r*(STACKPARAMS?m_params[itype][jtype].rhoinv:params(itype,jtype).rhoinv));
+
+ return (STACKPARAMS?m_params[itype][jtype].a:params(itype,jtype).a)*rexp -
+ (STACKPARAMS?m_params[itype][jtype].c:params(itype,jtype).c)*r6inv -
+ (STACKPARAMS?m_params[itype][jtype].offset:params(itype,jtype).offset);
+}
+
+/* ----------------------------------------------------------------------
+ compute coulomb pair force between atoms i and j
+ ---------------------------------------------------------------------- */
+
+template
+template
+KOKKOS_INLINE_FUNCTION
+F_FLOAT PairBuckCoulLongKokkos::
+compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j,
+ const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const {
+ if(Specialisation::DoTable && rsq > tabinnersq) {
+ union_int_float_t rsq_lookup;
+ rsq_lookup.f = rsq;
+ const int itable = (rsq_lookup.i & ncoulmask) >> ncoulshiftbits;
+ const F_FLOAT fraction = (rsq_lookup.f - d_rtable[itable]) * d_drtable[itable];
+ const F_FLOAT table = d_ftable[itable] + fraction*d_dftable[itable];
+ F_FLOAT forcecoul = qtmp*q[j] * table;
+ if (factor_coul < 1.0) {
+ const F_FLOAT table = d_ctable[itable] + fraction*d_dctable[itable];
+ const F_FLOAT prefactor = qtmp*q[j] * table;
+ forcecoul -= (1.0-factor_coul)*prefactor;
+ }
+ return forcecoul/rsq;
+ } else {
+ const F_FLOAT r = sqrt(rsq);
+ const F_FLOAT grij = g_ewald * r;
+ const F_FLOAT expm2 = exp(-grij*grij);
+ const F_FLOAT t = 1.0 / (1.0 + EWALD_P*grij);
+ const F_FLOAT rinv = 1.0/r;
+ const F_FLOAT erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+ const F_FLOAT prefactor = qqrd2e * qtmp*q[j]*rinv;
+ F_FLOAT forcecoul = prefactor * (erfc + EWALD_F*grij*expm2);
+ if (factor_coul < 1.0) forcecoul -= (1.0-factor_coul)*prefactor;
+
+ return forcecoul*rinv*rinv;
+ }
+}
+
+/* ----------------------------------------------------------------------
+ compute coulomb pair potential energy between atoms i and j
+ ---------------------------------------------------------------------- */
+
+template
+template
+KOKKOS_INLINE_FUNCTION
+F_FLOAT PairBuckCoulLongKokkos::
+compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j,
+ const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const {
+ if(Specialisation::DoTable) {
+ union_int_float_t rsq_lookup;
+ rsq_lookup.f = rsq;
+ const int itable = (rsq_lookup.i & ncoulmask) >> ncoulshiftbits;
+ const F_FLOAT fraction = (rsq_lookup.f - d_rtable[itable]) * d_drtable[itable];
+ const F_FLOAT table = d_etable[itable] + fraction*d_detable[itable];
+ F_FLOAT ecoul = qtmp*q[j] * table;
+ if (factor_coul < 1.0) {
+ const F_FLOAT table = d_ctable[itable] + fraction*d_dctable[itable];
+ const F_FLOAT prefactor = qtmp*q[j] * table;
+ ecoul -= (1.0-factor_coul)*prefactor;
+ }
+ return ecoul;
+ } else {
+ const F_FLOAT r = sqrt(rsq);
+ const F_FLOAT grij = g_ewald * r;
+ const F_FLOAT expm2 = exp(-grij*grij);
+ const F_FLOAT t = 1.0 / (1.0 + EWALD_P*grij);
+ const F_FLOAT erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
+ const F_FLOAT prefactor = qqrd2e * qtmp*q[j]/r;
+ F_FLOAT ecoul = prefactor * erfc;
+ if (factor_coul < 1.0) ecoul -= (1.0-factor_coul)*prefactor;
+ return ecoul;
+ }
+}
+
+/* ----------------------------------------------------------------------
+ allocate all arrays
+------------------------------------------------------------------------- */
+
+template
+void PairBuckCoulLongKokkos::allocate()
+{
+ PairBuckCoulLong::allocate();
+
+ int n = atom->ntypes;
+
+ memory->destroy(cutsq);
+ memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq");
+ d_cutsq = k_cutsq.template view();
+
+ memory->destroy(cut_ljsq);
+ memory->create_kokkos(k_cut_ljsq,cut_ljsq,n+1,n+1,"pair:cut_ljsq");
+ d_cut_ljsq = k_cut_ljsq.template view();
+
+ memory->create_kokkos(k_cut_coulsq,n+1,n+1,"pair:cut_coulsq");
+ d_cut_coulsq = k_cut_coulsq.template view();
+
+ k_params = Kokkos::DualView("PairBuckCoulLong::params",n+1,n+1);
+ params = k_params.d_view;
+}
+
+template
+void PairBuckCoulLongKokkos::init_tables(double cut_coul, double *cut_respa)
+{
+ Pair::init_tables(cut_coul,cut_respa);
+
+ typedef typename ArrayTypes::t_ffloat_1d table_type;
+ typedef typename ArrayTypes::t_ffloat_1d host_table_type;
+
+ int ntable = 1;
+ for (int i = 0; i < ncoultablebits; i++) ntable *= 2;
+
+
+ // Copy rtable and drtable
+ {
+ host_table_type h_table("HostTable",ntable);
+ table_type d_table("DeviceTable",ntable);
+ for(int i = 0; i < ntable; i++) {
+ h_table(i) = rtable[i];
+ }
+ Kokkos::deep_copy(d_table,h_table);
+ d_rtable = d_table;
+ }
+
+ {
+ host_table_type h_table("HostTable",ntable);
+ table_type d_table("DeviceTable",ntable);
+ for(int i = 0; i < ntable; i++) {
+ h_table(i) = drtable[i];
+ }
+ Kokkos::deep_copy(d_table,h_table);
+ d_drtable = d_table;
+ }
+
+ {
+ host_table_type h_table("HostTable",ntable);
+ table_type d_table("DeviceTable",ntable);
+
+ // Copy ftable and dftable
+ for(int i = 0; i < ntable; i++) {
+ h_table(i) = ftable[i];
+ }
+ Kokkos::deep_copy(d_table,h_table);
+ d_ftable = d_table;
+ }
+
+ {
+ host_table_type h_table("HostTable",ntable);
+ table_type d_table("DeviceTable",ntable);
+
+ for(int i = 0; i < ntable; i++) {
+ h_table(i) = dftable[i];
+ }
+ Kokkos::deep_copy(d_table,h_table);
+ d_dftable = d_table;
+ }
+
+ {
+ host_table_type h_table("HostTable",ntable);
+ table_type d_table("DeviceTable",ntable);
+
+ // Copy ctable and dctable
+ for(int i = 0; i < ntable; i++) {
+ h_table(i) = ctable[i];
+ }
+ Kokkos::deep_copy(d_table,h_table);
+ d_ctable = d_table;
+ }
+
+ {
+ host_table_type h_table("HostTable",ntable);
+ table_type d_table("DeviceTable",ntable);
+
+ for(int i = 0; i < ntable; i++) {
+ h_table(i) = dctable[i];
+ }
+ Kokkos::deep_copy(d_table,h_table);
+ d_dctable = d_table;
+ }
+
+ {
+ host_table_type h_table("HostTable",ntable);
+ table_type d_table("DeviceTable",ntable);
+
+ // Copy etable and detable
+ for(int i = 0; i < ntable; i++) {
+ h_table(i) = etable[i];
+ }
+ Kokkos::deep_copy(d_table,h_table);
+ d_etable = d_table;
+ }
+
+ {
+ host_table_type h_table("HostTable",ntable);
+ table_type d_table("DeviceTable",ntable);
+
+ for(int i = 0; i < ntable; i++) {
+ h_table(i) = detable[i];
+ }
+ Kokkos::deep_copy(d_table,h_table);
+ d_detable = d_table;
+ }
+}
+
+
+/* ----------------------------------------------------------------------
+ global settings
+------------------------------------------------------------------------- */
+
+template
+void PairBuckCoulLongKokkos::settings(int narg, char **arg)
+{
+ if (narg > 2) error->all(FLERR,"Illegal pair_style command");
+
+ PairBuckCoulLong::settings(narg,arg);
+}
+
+/* ----------------------------------------------------------------------
+ init specific to this pair style
+------------------------------------------------------------------------- */
+
+template
+void PairBuckCoulLongKokkos::init_style()
+{
+ PairBuckCoulLong::init_style();
+
+ // error if rRESPA with inner levels
+
+ if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
+ int respa = 0;
+ if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
+ if (((Respa *) update->integrate)->level_middle >= 0) respa = 2;
+ if (respa)
+ error->all(FLERR,"Cannot use Kokkos pair style with rRESPA inner/middle");
+ }
+
+ // irequest = neigh request made by parent class
+
+ neighflag = lmp->kokkos->neighflag;
+ int irequest = neighbor->nrequest - 1;
+
+ neighbor->requests[irequest]->
+ kokkos_host = Kokkos::Impl::is_same::value &&
+ !Kokkos::Impl::is_same::value;
+ neighbor->requests[irequest]->
+ kokkos_device = Kokkos::Impl::is_same::value;
+
+ if (neighflag == FULL) {
+ neighbor->requests[irequest]->full = 1;
+ neighbor->requests[irequest]->half = 0;
+ neighbor->requests[irequest]->full_cluster = 0;
+ } else if (neighflag == HALF || neighflag == HALFTHREAD) {
+ neighbor->requests[irequest]->full = 0;
+ neighbor->requests[irequest]->half = 1;
+ neighbor->requests[irequest]->full_cluster = 0;
+ } else {
+ error->all(FLERR,"Cannot use chosen neighbor list style with buck/coul/long/kk");
+ }
+}
+
+/* ----------------------------------------------------------------------
+ init for one type pair i,j and corresponding j,i
+------------------------------------------------------------------------- */
+
+template
+double PairBuckCoulLongKokkos::init_one(int i, int j)
+{
+ double cutone = PairBuckCoulLong::init_one(i,j);
+ double cut_ljsqm = cut_ljsq[i][j];
+ double cut_coulsqm = cut_coulsq;
+
+ k_params.h_view(i,j).a = a[i][j];
+ k_params.h_view(i,j).c = c[i][j];
+ k_params.h_view(i,j).rhoinv = rhoinv[i][j];
+ k_params.h_view(i,j).buck1 = buck1[i][j];
+ k_params.h_view(i,j).buck2 = buck2[i][j];
+ k_params.h_view(i,j).offset = offset[i][j];
+ k_params.h_view(i,j).cut_ljsq = cut_ljsqm;
+ k_params.h_view(i,j).cut_coulsq = cut_coulsqm;
+
+ k_params.h_view(j,i) = k_params.h_view(i,j);
+ if(i();
+ k_cut_ljsq.h_view(i,j) = cut_ljsqm;
+ k_cut_ljsq.template modify();
+ k_cut_coulsq.h_view(i,j) = cut_coulsqm;
+ k_cut_coulsq.template modify();
+ k_params.template modify();
+
+ return cutone;
+
+}
+
+
+template class PairBuckCoulLongKokkos;
+#ifdef KOKKOS_HAVE_CUDA
+template class PairBuckCoulLongKokkos;
+#endif
diff --git a/src/KOKKOS/pair_buck_coul_long_kokkos.h b/src/KOKKOS/pair_buck_coul_long_kokkos.h
new file mode 100644
index 0000000000..b4a0c96ff6
--- /dev/null
+++ b/src/KOKKOS/pair_buck_coul_long_kokkos.h
@@ -0,0 +1,150 @@
+/* -*- c++ -*- ----------------------------------------------------------
+ LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
+ http://lammps.sandia.gov, Sandia National Laboratories
+ Steve Plimpton, sjplimp@sandia.gov
+
+ Copyright (2003) Sandia Corporation. Under the terms of Contract
+ DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
+ certain rights in this software. This software is distributed under
+ the GNU General Public License.
+
+ See the README file in the top-level LAMMPS directory.
+------------------------------------------------------------------------- */
+
+#ifdef PAIR_CLASS
+
+PairStyle(buck/coul/long/kk,PairBuckCoulLongKokkos)
+PairStyle(buck/coul/long/kk/device,PairBuckCoulLongKokkos)
+PairStyle(buck/coul/long/kk/host,PairBuckCoulLongKokkos)
+
+#else
+
+#ifndef LMP_PAIR_BUCK_COUL_LONG_KOKKOS_H
+#define LMP_PAIR_BUCK_COUL_LONG_KOKKOS_H
+
+#include "pair_kokkos.h"
+#include "pair_buck_coul_long.h"
+#include "neigh_list_kokkos.h"
+
+namespace LAMMPS_NS {
+
+template
+class PairBuckCoulLongKokkos : public PairBuckCoulLong {
+ public:
+ enum {EnabledNeighFlags=FULL|HALFTHREAD|HALF};
+ enum {COUL_FLAG=1};
+ typedef DeviceType device_type;
+ PairBuckCoulLongKokkos(class LAMMPS *);
+ ~PairBuckCoulLongKokkos();
+
+ void compute(int, int);
+
+ void settings(int, char **);
+ void init_tables(double cut_coul, double *cut_respa);
+ void init_style();
+ double init_one(int, int);
+
+ struct params_buck_coul{
+ params_buck_coul(){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;};
+ params_buck_coul(int i){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;};
+ F_FLOAT cut_ljsq,cut_coulsq,a,c,rhoinv,buck1,buck2,offset;
+ };
+
+ protected:
+ void cleanup_copy();
+
+ template
+ KOKKOS_INLINE_FUNCTION
+ F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j,
+ const int& itype, const int& jtype) const;
+
+ template
+ KOKKOS_INLINE_FUNCTION
+ F_FLOAT compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, const int& itype,
+ const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const;
+
+ template
+ KOKKOS_INLINE_FUNCTION
+ F_FLOAT compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j,
+ const int& itype, const int& jtype) const;
+
+ template
+ KOKKOS_INLINE_FUNCTION
+ F_FLOAT compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j,
+ const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const;
+
+ Kokkos::DualView k_params;
+ typename Kokkos::DualView::t_dev_const params;
+ // hardwired to space for 15 atom types
+ params_buck_coul m_params[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1];
+
+ F_FLOAT m_cutsq[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1];
+ F_FLOAT m_cut_ljsq[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1];
+ F_FLOAT m_cut_coulsq[MAX_TYPES_STACKPARAMS+1][MAX_TYPES_STACKPARAMS+1];
+ typename ArrayTypes::t_x_array_randomread x;
+ typename ArrayTypes::t_x_array c_x;
+ typename ArrayTypes::t_f_array f;
+ typename ArrayTypes::t_int_1d_randomread type;
+ typename ArrayTypes::t_float_1d_randomread q;
+
+ DAT::tdual_efloat_1d k_eatom;
+ DAT::tdual_virial_array k_vatom;
+ typename ArrayTypes::t_efloat_1d d_eatom;
+ typename ArrayTypes::t_virial_array d_vatom;
+
+ int newton_pair;
+
+ typename ArrayTypes::tdual_ffloat_2d k_cutsq;
+ typename ArrayTypes::t_ffloat_2d d_cutsq;
+ typename ArrayTypes::tdual_ffloat_2d k_cut_ljsq;
+ typename ArrayTypes::t_ffloat_2d d_cut_ljsq;
+ typename ArrayTypes::tdual_ffloat_2d k_cut_coulsq;
+ typename ArrayTypes::t_ffloat_2d d_cut_coulsq;
+
+ typename ArrayTypes::t_ffloat_1d_randomread
+ d_rtable, d_drtable, d_ftable, d_dftable,
+ d_ctable, d_dctable, d_etable, d_detable;
+ class AtomKokkos *atomKK;
+ int neighflag;
+ int nlocal,nall,eflag,vflag;
+
+ double special_lj[4], special_coul[4];
+ double qqrd2e;
+
+ void allocate();
+
+ friend class PairComputeFunctor >;
+ friend class PairComputeFunctor >;
+ friend class PairComputeFunctor >;
+ friend class PairComputeFunctor >;
+ friend class PairComputeFunctor >;
+ friend class PairComputeFunctor >;
+ friend EV_FLOAT pair_compute_neighlist >(PairBuckCoulLongKokkos*,NeighListKokkos*);
+ friend EV_FLOAT pair_compute_neighlist >(PairBuckCoulLongKokkos*,NeighListKokkos*);
+ friend EV_FLOAT pair_compute_neighlist >(PairBuckCoulLongKokkos*,NeighListKokkos*);
+ friend EV_FLOAT pair_compute >(PairBuckCoulLongKokkos*,
+ NeighListKokkos*);
+ friend class PairComputeFunctor >;
+ friend class PairComputeFunctor >;
+ friend class PairComputeFunctor >;
+ friend class PairComputeFunctor >;
+ friend class PairComputeFunctor >;
+ friend class PairComputeFunctor >;
+ friend EV_FLOAT pair_compute_neighlist >(PairBuckCoulLongKokkos*,NeighListKokkos*);
+ friend EV_FLOAT pair_compute_neighlist >(PairBuckCoulLongKokkos*,NeighListKokkos*);
+ friend EV_FLOAT pair_compute_neighlist >(PairBuckCoulLongKokkos*,NeighListKokkos*);
+ friend EV_FLOAT pair_compute >(PairBuckCoulLongKokkos*,
+ NeighListKokkos*);
+ friend void pair_virial_fdotr_compute(PairBuckCoulLongKokkos*);
+
+};
+
+}
+
+#endif
+#endif
+
+/* ERROR/WARNING messages:
+
+*/
diff --git a/src/KOKKOS/pair_coul_debye_kokkos.cpp b/src/KOKKOS/pair_coul_debye_kokkos.cpp
new file mode 100644
index 0000000000..50fb7f8162
--- /dev/null
+++ b/src/KOKKOS/pair_coul_debye_kokkos.cpp
@@ -0,0 +1,313 @@
+/* ----------------------------------------------------------------------
+ LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
+ http://lammps.sandia.gov, Sandia National Laboratories
+ Steve Plimpton, sjplimp@sandia.gov
+
+ Copyright (2003) Sandia Corporation. Under the terms of Contract
+ DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
+ certain rights in this software. This software is distributed under
+ the GNU General Public License.
+
+ See the README file in the top-level LAMMPS directory.
+------------------------------------------------------------------------- */
+
+/* ----------------------------------------------------------------------
+ Contributing author: Ray Shan (SNL)
+------------------------------------------------------------------------- */
+
+#include "math.h"
+#include "stdio.h"
+#include "stdlib.h"
+#include "string.h"
+#include "pair_coul_debye_kokkos.h"
+#include "kokkos.h"
+#include "atom_kokkos.h"
+#include "comm.h"
+#include "force.h"
+#include "neighbor.h"
+#include "neigh_list.h"
+#include "neigh_request.h"
+#include "update.h"
+#include "integrate.h"
+#include "respa.h"
+#include "math_const.h"
+#include "memory.h"
+#include "error.h"
+#include "atom_masks.h"
+
+using namespace LAMMPS_NS;
+using namespace MathConst;
+
+#define KOKKOS_CUDA_MAX_THREADS 256
+#define KOKKOS_CUDA_MIN_BLOCKS 8
+
+/* ---------------------------------------------------------------------- */
+
+template
+PairCoulDebyeKokkos::PairCoulDebyeKokkos(LAMMPS *lmp):PairCoulDebye(lmp)
+{
+ respa_enable = 0;
+
+ atomKK = (AtomKokkos *) atom;
+ execution_space = ExecutionSpaceFromDevice::space;
+ datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK;
+ datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK;
+ cutsq = NULL;
+
+}
+
+/* ---------------------------------------------------------------------- */
+
+template
+PairCoulDebyeKokkos::~PairCoulDebyeKokkos()
+{
+ if (!copymode) {
+ memory->destroy_kokkos(k_cutsq, cutsq);
+ }
+}
+
+/* ---------------------------------------------------------------------- */
+
+template
+void PairCoulDebyeKokkos::cleanup_copy() {
+ // WHY needed: this prevents parent copy from deallocating any arrays
+ allocated = 0;
+ cutsq = NULL;
+ eatom = NULL;
+ vatom = NULL;
+}
+
+/* ---------------------------------------------------------------------- */
+
+template
+void PairCoulDebyeKokkos::compute(int eflag_in, int vflag_in)
+{
+ eflag = eflag_in;
+ vflag = vflag_in;
+
+ if (neighflag == FULL || neighflag == FULLCLUSTER) no_virial_fdotr_compute = 1;
+
+ if (eflag || vflag) ev_setup(eflag,vflag);
+ else evflag = vflag_fdotr = 0;
+
+ atomKK->sync(execution_space,datamask_read);
+ k_cutsq.template sync();
+ k_cut_ljsq.template sync();
+ k_cut_coulsq.template sync();
+ k_params.template sync();
+ if (eflag || vflag) atomKK->modified(execution_space,datamask_modify);
+ else atomKK->modified(execution_space,F_MASK);
+
+ x = atomKK->k_x.view();
+ c_x = atomKK->k_x.view();
+ f = atomKK->k_f.view();
+ q = atomKK->k_q.view();
+ type = atomKK->k_type.view();
+ nlocal = atom->nlocal;
+ nall = atom->nlocal + atom->nghost;
+ special_lj[0] = force->special_lj[0];
+ special_lj[1] = force->special_lj[1];
+ special_lj[2] = force->special_lj[2];
+ special_lj[3] = force->special_lj[3];
+ special_coul[0] = force->special_coul[0];
+ special_coul[1] = force->special_coul[1];
+ special_coul[2] = force->special_coul[2];
+ special_coul[3] = force->special_coul[3];
+ qqrd2e = force->qqrd2e;
+ newton_pair = force->newton_pair;
+
+ // loop over neighbors of my atoms
+
+ copymode = 1;
+
+ EV_FLOAT ev = pair_compute,void >
+ (this,(NeighListKokkos*)list);
+
+ DeviceType::fence();
+
+ if (eflag) {
+ eng_vdwl += ev.evdwl;
+ eng_coul += ev.ecoul;
+ }
+ if (vflag_global) {
+ virial[0] += ev.v[0];
+ virial[1] += ev.v[1];
+ virial[2] += ev.v[2];
+ virial[3] += ev.v[3];
+ virial[4] += ev.v[4];
+ virial[5] += ev.v[5];
+ }
+
+ if (vflag_fdotr) virial_fdotr_compute();
+
+ copymode = 0;
+}
+
+/* ----------------------------------------------------------------------
+ compute coulomb pair force between atoms i and j
+ ---------------------------------------------------------------------- */
+template
+template
+KOKKOS_INLINE_FUNCTION
+F_FLOAT PairCoulDebyeKokkos::
+compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j,
+ const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const {
+
+ const F_FLOAT r2inv = 1.0/rsq;
+ const F_FLOAT rinv = sqrt(r2inv);
+ const F_FLOAT r = 1.0/rinv;
+ const F_FLOAT screening = exp(-kappa*r);
+ F_FLOAT forcecoul;
+
+ forcecoul = qqrd2e * qtmp * q(j) * screening * (kappa + rinv) *
+ (STACKPARAMS?m_params[itype][jtype].scale:params(itype,jtype).scale);
+
+ return factor_coul*forcecoul*r2inv;
+
+}
+
+/* ----------------------------------------------------------------------
+ compute coulomb pair potential energy between atoms i and j
+ ---------------------------------------------------------------------- */
+template
+template
+KOKKOS_INLINE_FUNCTION
+F_FLOAT PairCoulDebyeKokkos::
+compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j,
+ const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const {
+
+ const F_FLOAT r2inv = 1.0/rsq;
+ const F_FLOAT rinv = sqrt(r2inv);
+ const F_FLOAT r = 1.0/rinv;
+ const F_FLOAT screening = exp(-kappa*r);
+
+ return factor_coul * qqrd2e * qtmp * q(j) * rinv * screening *
+ (STACKPARAMS?m_params[itype][jtype].scale:params(itype,jtype).scale);
+
+}
+
+/* ----------------------------------------------------------------------
+ allocate all arrays
+------------------------------------------------------------------------- */
+
+template
+void PairCoulDebyeKokkos::allocate()
+{
+ PairCoulDebye::allocate();
+
+ int n = atom->ntypes;
+ memory->destroy(cutsq);
+ memory->create_kokkos(k_cutsq,cutsq,n+1,n+1,"pair:cutsq");
+ d_cutsq = k_cutsq.template view();
+ k_params = Kokkos::DualView("PairCoulDebye::params",n+1,n+1);
+ params = k_params.d_view;
+}
+
+/* ----------------------------------------------------------------------
+ global settings
+------------------------------------------------------------------------- */
+
+template
+void PairCoulDebyeKokkos::settings(int narg, char **arg)
+{
+ if (narg > 2) error->all(FLERR,"Illegal pair_style command");
+
+ kappa = force->numeric(FLERR,arg[0]);
+ cut_global = force->numeric(FLERR,arg[1]);
+
+ // reset cutoffs that have been explicitly set
+
+ if (allocated) {
+ int i,j;
+ for (i = 1; i <= atom->ntypes; i++)
+ for (j = i+1; j <= atom->ntypes; j++)
+ if (setflag[i][j]) cut[i][j] = cut_global;
+ }
+
+}
+
+/* ----------------------------------------------------------------------
+ init specific to this pair style
+------------------------------------------------------------------------- */
+
+template
+void PairCoulDebyeKokkos::init_style()
+{
+ PairCoulDebye::init_style();
+
+ // error if rRESPA with inner levels
+
+ if (update->whichflag == 1 && strstr(update->integrate_style,"respa")) {
+ int respa = 0;
+ if (((Respa *) update->integrate)->level_inner >= 0) respa = 1;
+ if (((Respa *) update->integrate)->level_middle >= 0) respa = 2;
+ if (respa)
+ error->all(FLERR,"Cannot use Kokkos pair style with rRESPA inner/middle");
+ }
+
+ // irequest = neigh request made by parent class
+
+ neighflag = lmp->kokkos->neighflag;
+ int irequest = neighbor->nrequest - 1;
+
+ neighbor->requests[irequest]->
+ kokkos_host = Kokkos::Impl::is_same::value &&
+ !Kokkos::Impl::is_same::value;
+ neighbor->requests[irequest]->
+ kokkos_device = Kokkos::Impl::is_same::value;
+
+ if (neighflag == FULL) {
+ neighbor->requests[irequest]->full = 1;
+ neighbor->requests[irequest]->half = 0;
+ neighbor->requests[irequest]->full_cluster = 0;
+ } else if (neighflag == HALF || neighflag == HALFTHREAD) {
+ neighbor->requests[irequest]->full = 0;
+ neighbor->requests[irequest]->half = 1;
+ neighbor->requests[irequest]->full_cluster = 0;
+ } else if (neighflag == N2) {
+ neighbor->requests[irequest]->full = 0;
+ neighbor->requests[irequest]->half = 0;
+ neighbor->requests[irequest]->full_cluster = 0;
+ } else if (neighflag == FULLCLUSTER) {
+ neighbor->requests[irequest]->full_cluster = 1;
+ neighbor->requests[irequest]->full = 1;
+ neighbor->requests[irequest]->half = 0;
+ } else {
+ error->all(FLERR,"Cannot use chosen neighbor list style with coul/debye/kk");
+ }
+}
+
+/* ----------------------------------------------------------------------
+ init for one type pair i,j and corresponding j,i
+------------------------------------------------------------------------- */
+
+template
+double PairCoulDebyeKokkos::init_one(int i, int j)
+{
+ double cutone = PairCoulDebye::init_one(i,j);
+
+ k_params.h_view(i,j).scale = scale[i][j];
+ k_params.h_view(i,j).cutsq = cutone*cutone;
+ k_params.h_view(j,i) = k_params.h_view(i,j);
+
+ if(i();
+ //k_cut_ljsq.h_view(i,j) = cutone*cutone;
+ k_cut_ljsq.template modify();
+ //k_cut_coulsq.h_view(i,j) = cutone*cutone;
+ k_cut_coulsq.template modify();
+ k_params.template modify();
+
+ return cutone;
+}
+
+template class PairCoulDebyeKokkos