diff --git a/src/KOKKOS/pair_kokkos.h b/src/KOKKOS/pair_kokkos.h index 5f9b347ddf403f2bb4fe324b41c28a847770562e..eb188f9c149486d808c820fa8c3b58d20afca415 100644 --- a/src/KOKKOS/pair_kokkos.h +++ b/src/KOKKOS/pair_kokkos.h @@ -355,12 +355,12 @@ struct PairComputeFunctor<PairStyle,FULLCLUSTER,STACKPARAMS,Specialisation> { EV_FLOAT compute_item(const typename Kokkos::TeamPolicy<device_type>::member_type& dev, const NeighListKokkos<device_type> &list, const NoCoulTag& ) const { EV_FLOAT ev; - const int i = dev.league_rank()*dev.team_size() + dev.team_rank(); + int i = dev.league_rank()*dev.team_size() + dev.team_rank(); const X_FLOAT xtmp = c.c_x(i,0); const X_FLOAT ytmp = c.c_x(i,1); const X_FLOAT ztmp = c.c_x(i,2); - const int itype = c.type(i); + int itype = c.type(i); const AtomNeighborsConst neighbors_i = list.get_neighbors_const(i); const int jnum = list.d_numneigh[i]; @@ -368,7 +368,7 @@ struct PairComputeFunctor<PairStyle,FULLCLUSTER,STACKPARAMS,Specialisation> { F_FLOAT3 ftmp; for (int jj = 0; jj < jnum; jj++) { - const int jjj = neighbors_i(jj); + int jjj = neighbors_i(jj); Kokkos::parallel_reduce(Kokkos::ThreadVectorRange(dev,NeighClusterSize),[&] (const int& k, F_FLOAT3& fftmp) { const F_FLOAT factor_lj = c.special_lj[sbmask(jjj+k)]; diff --git a/src/KOKKOS/verlet_kokkos.cpp b/src/KOKKOS/verlet_kokkos.cpp index 67e852a7d944a7af92f68faafefd464757cec6ae..527e10add33956e294b0da3d4befe88f8733f553 100644 --- a/src/KOKKOS/verlet_kokkos.cpp +++ b/src/KOKKOS/verlet_kokkos.cpp @@ -458,7 +458,7 @@ void VerletKokkos::force_clear() size_t nbytes = sizeof(double) * nall; if (nbytes) { - if (atomKK->k_f.modified_host > atomKK->k_f.modified_device) { + if (atomKK->k_f.modified_host() > atomKK->k_f.modified_device()) { memset_kokkos(atomKK->k_f.view<LMPHostType>()); atomKK->modified(Host,F_MASK); } else { @@ -475,7 +475,7 @@ void VerletKokkos::force_clear() } else { int nall = atomKK->nfirst; - if (atomKK->k_f.modified_host > atomKK->k_f.modified_device) { + if (atomKK->k_f.modified_host() > atomKK->k_f.modified_device()) { memset_kokkos(atomKK->k_f.view<LMPHostType>()); atomKK->modified(Host,F_MASK); } else { diff --git a/src/MANYBODY/pair_comb3.cpp b/src/MANYBODY/pair_comb3.cpp index 255e8a54c4db5b323e13a372c658555c27980793..fc2a805d15ef4363be5baf3f3a64372e962ba76b 100644 --- a/src/MANYBODY/pair_comb3.cpp +++ b/src/MANYBODY/pair_comb3.cpp @@ -604,7 +604,7 @@ void PairComb3::read_file(char *file) FILE *fp; if (comm->me == 0) { - fp = fopen(file,"r"); + fp = force->open_potential(file); if (fp == NULL) { char str[128]; sprintf(str,"Cannot open COMB3 potential file %s",file); diff --git a/src/USER-MISC/fix_srp.cpp b/src/USER-MISC/fix_srp.cpp index e5d592d30155578f358e661bc135609b368b7903..88f18e9a7c1bb56db42b6d03387ba1c375b83b24 100644 --- a/src/USER-MISC/fix_srp.cpp +++ b/src/USER-MISC/fix_srp.cpp @@ -104,6 +104,16 @@ void FixSRP::init() if ((bptype < 1) || (bptype > atom->ntypes)) error->all(FLERR,"Illegal bond particle type"); + // fix SRP should be the first fix running at the PRE_EXCHANGE step. + // Otherwise it might conflict with, e.g. fix deform + + if (modify->n_pre_exchange > 1) { + char *first = modify->fix[modify->list_pre_exchange[0]]->id; + if ((comm->me == 0) && (strcmp(id,first) != 0)) + error->warning(FLERR,"Internal fix for pair srp defined too late." + " May lead to incorrect behavior."); + } + // setup neigh exclusions for diff atom types // bond particles do not interact with other types // type bptype only interacts with itself diff --git a/src/USER-PHONON/fix_phonon.cpp b/src/USER-PHONON/fix_phonon.cpp index f2748994f52f33c8870eedf7e2193ed96dc6fd85..d67573617982d50f7cb9ab4f00cf66a3ea3507cc 100644 --- a/src/USER-PHONON/fix_phonon.cpp +++ b/src/USER-PHONON/fix_phonon.cpp @@ -23,8 +23,11 @@ konglt@sjtu.edu.cn; konglt@gmail.com ------------------------------------------------------------------------- */ +#include <stdio.h> +#include <stdlib.h> #include <string.h> #include "fix_phonon.h" +#include "fft3d_wrap.h" #include "atom.h" #include "compute.h" #include "domain.h" diff --git a/src/USER-PHONON/fix_phonon.h b/src/USER-PHONON/fix_phonon.h index 95a9d200e1ba5ece92752f5e906429164a432501..ecd3a8ebc95e81a3d2bb5fade804dbf7cae1bcb7 100644 --- a/src/USER-PHONON/fix_phonon.h +++ b/src/USER-PHONON/fix_phonon.h @@ -43,10 +43,6 @@ typedef double FFT_SCALAR; #include <complex> #include "fix.h" #include <map> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include "fft3d_wrap.h" namespace LAMMPS_NS { diff --git a/src/modify.h b/src/modify.h index 036776103704fda2bbb018cd72c6d7032c07692f..17d409a46e2ea36f3958377b181d58fddcc05315 100644 --- a/src/modify.h +++ b/src/modify.h @@ -23,6 +23,7 @@ namespace LAMMPS_NS { class Modify : protected Pointers { friend class Info; + friend class FixSRP; public: int nfix,maxfix; int n_initial_integrate,n_post_integrate,n_pre_exchange,n_pre_neighbor;