diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 88f576bad2..6d30cff01d 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -142,6 +142,16 @@ PairKIM::~PairKIM() return; } +/* ---------------------------------------------------------------------- */ +void PairKIM::set_contributing() +{ + int const nall = atom->nlocal + atom->nghost; + for (int i = 0; i < nall; ++i) + { + kim_particleContributing[i] = ( (i < atom->nlocal) ? 1 : 0 ); + } +} + /* ---------------------------------------------------------------------- */ void PairKIM::compute(int eflag , int vflag) @@ -185,10 +195,11 @@ void PairKIM::compute(int eflag , int vflag) for (int i = 0; i < nall; i++) { ielement = lmps_map_species_to_unique[species[i]]; kim_particleSpecies[i] = kim_particle_codes[ielement]; - - kim_particleContributing[i] = ( (inlocal) ? 1 : 0 ); } + // Set kim contributing flags + set_contributing(); + // pass current atom pointers to KIM set_argument_pointers(); diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index bdebfbcad0..59f477b1e4 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -117,6 +117,7 @@ namespace LAMMPS_NS { int** lmps_stripped_neigh_ptr; // pointer into lists // KIM specific helper functions + virtual void set_contributing(); void kim_init(); void kim_free(); void set_argument_pointers();