Unverified Commit 558d2eb8 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #2203 from akohlmey/collected-small-changes

Various small fixes and cleanups. Bugfixes for atom style hybrid
parents a73f1d4f 0a9dd812
Loading
Loading
Loading
Loading
+23 −9
Original line number Diff line number Diff line
@@ -236,7 +236,7 @@ void PairBodyRoundedPolygon::compute(int eflag, int vflag)
        edge[jefirst+nj][4] = 0;
      }

      int interact, num_contacts, done;
      int num_contacts, done;
      double delta_a, j_a;
      Contact contact_list[MAX_CONTACTS];

@@ -244,15 +244,13 @@ void PairBodyRoundedPolygon::compute(int eflag, int vflag)

      // check interaction between i's vertices and j' edges

      interact = vertex_against_edge(i, j, k_nij, k_naij,
                                     x, f, torque, tag, contact_list,
                                     num_contacts, evdwl, facc);
      vertex_against_edge(i, j, k_nij, k_naij, x, f, torque, tag,
                          contact_list, num_contacts, evdwl, facc);

      // check interaction between j's vertices and i' edges

      interact = vertex_against_edge(j, i, k_nij, k_naij,
                                     x, f, torque, tag, contact_list,
                                     num_contacts, evdwl, facc);
      vertex_against_edge(j, i, k_nij, k_naij, x, f, torque, tag,
                          contact_list, num_contacts, evdwl, facc);

      if (num_contacts >= 2) {

@@ -595,7 +593,7 @@ void PairBodyRoundedPolygon::sphere_against_sphere(int i, int j,
{
  double rradi,rradj;
  double vr1,vr2,vr3,vnnr,vn1,vn2,vn3,vt1,vt2,vt3;
  double rij,rsqinv,R,fx,fy,fz,fpair,shift,energy;
  double rij,rsqinv,R,fx,fy,fz,fn[3],ft[3],fpair,shift,energy;
  int nlocal = atom->nlocal;
  int newton_pair = force->newton_pair;

@@ -641,6 +639,23 @@ void PairBodyRoundedPolygon::sphere_against_sphere(int i, int j,
    vt1 = vr1 - vn1;
    vt2 = vr2 - vn2;
    vt3 = vr3 - vn3;

    // normal friction term at contact

    fn[0] = -c_n * vn1;
    fn[1] = -c_n * vn2;
    fn[2] = -c_n * vn3;

    // tangential friction term at contact,
    // excluding the tangential deformation term for now

    ft[0] = -c_t * vt1;
    ft[1] = -c_t * vt2;
    ft[2] = -c_t * vt3;

    fx += fn[0] + ft[0];
    fy += fn[1] + ft[1];
    fz += fn[2] + ft[2];
  }

  f[i][0] += fx;
@@ -1349,4 +1364,3 @@ void PairBodyRoundedPolygon::distance(const double* x2, const double* x1,
    + (x2[1] - x1[1]) * (x2[1] - x1[1])
    + (x2[2] - x1[2]) * (x2[2] - x1[2]));
}
+6 −6
Original line number Diff line number Diff line
@@ -103,14 +103,14 @@ class AtomVecKokkos : public AtomVec {
                         ExecutionSpace space) = 0;

  virtual int
    pack_border_vel_kokkos(int n, DAT::tdual_int_2d k_sendlist,
                           DAT::tdual_xfloat_2d buf,int iswap,
                           int pbc_flag, int *pbc, ExecutionSpace space) { return 0; }
    pack_border_vel_kokkos(int /*n*/, DAT::tdual_int_2d /*k_sendlist*/,
                           DAT::tdual_xfloat_2d /*buf*/,int /*iswap*/,
                           int /*pbc_flag*/, int * /*pbc*/, ExecutionSpace /*space*/) { return 0; }

  virtual void
    unpack_border_vel_kokkos(const int &n, const int &nfirst,
                             const DAT::tdual_xfloat_2d &buf,
                             ExecutionSpace space) {}
    unpack_border_vel_kokkos(const int &/*n*/, const int & /*nfirst*/,
                             const DAT::tdual_xfloat_2d & /*buf*/,
                             ExecutionSpace /*space*/) {}

  virtual int
    pack_exchange_kokkos(const int &nsend, DAT::tdual_xfloat_2d &buf,
+2 −2
Original line number Diff line number Diff line
@@ -272,7 +272,7 @@ template<typename T1, typename T2>
class ScatterViewHelper<Kokkos::Experimental::ScatterDuplicated,T1,T2> {
public:
  KOKKOS_INLINE_FUNCTION
  static T1 get(const T1 &dup, const T2 &nondup) {
  static T1 get(const T1 &dup, const T2 & /*nondup*/) {
    return dup;
  }
};
@@ -1025,7 +1025,7 @@ struct params_lj_coul {
  KOKKOS_INLINE_FUNCTION
  params_lj_coul(){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
  KOKKOS_INLINE_FUNCTION
  params_lj_coul(int i){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
  params_lj_coul(int /*i*/){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;};
  F_FLOAT cut_ljsq,cut_coulsq,lj1,lj2,lj3,lj4,offset;
};

+9 −13
Original line number Diff line number Diff line
@@ -368,7 +368,6 @@ void SNAKokkos<DeviceType>::compute_ui(const typename Kokkos::TeamPolicy<DeviceT

  for (int j = 1; j <= twojmax; j++) {
    const int jju = idxu_block[j];
    const int jjup = idxu_block[j-1];

    // fill in left side of matrix layer from previous layer

@@ -1080,7 +1079,6 @@ void SNAKokkos<DeviceType>::compute_bi_cpu(const typename Kokkos::TeamPolicy<Dev
        Kokkos::parallel_for(Kokkos::TeamThreadRange(team,idxb_max),
          [&] (const int& jjb) {
        //for(int jjb = 0; jjb < idxb_max; jjb++) {
          const auto jjballoy = itriple;
          const int j1 = idxb(jjb, 0);
          const int j2 = idxb(jjb, 1);
          const int j = idxb(jjb, 2);
@@ -2024,7 +2022,6 @@ double SNAKokkos<DeviceType>::memory_usage()
{
  int jdimpq = twojmax + 2;
  int jdim = twojmax + 1;
  int natom_pad = ((natom + 32 - 1) / 32) * 32; // for AoSoA layouts
  double bytes;

  bytes = 0;
@@ -2032,10 +2029,9 @@ double SNAKokkos<DeviceType>::memory_usage()
  bytes += jdimpq*jdimpq * sizeof(double);               // pqarray
  bytes += idxcg_max * sizeof(double);                   // cglist



#ifdef KOKKOS_ENABLE_CUDA
  if (std::is_same<DeviceType,Kokkos::Cuda>::value) {
    int natom_pad = ((natom + 32 - 1) / 32) * 32; // for AoSoA layouts

    bytes += natom * idxu_max * nelements * sizeof(double);          // ulisttot_re
    bytes += natom * idxu_max * nelements * sizeof(double);          // ulisttot_im
+0 −1
Original line number Diff line number Diff line
@@ -316,7 +316,6 @@ void PPPMDisp::init()
  for (int i=0; i<=EWALD_MAXORDER; ++i)                 // transcribe order
    if (ewald_order&(1<<i)) {                           // from pair_style
      int  k=0;
      char str[128];
      switch (i) {
        case 1:
          k = 0; break;
Loading