Add virtual set_contributing() to pair_kim

This commit is contained in:
Ryan S. Elliott
2018-07-16 19:46:00 -05:00
parent 67e6afaab2
commit e37e9cfa2f
2 changed files with 14 additions and 2 deletions

View File

@ -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] = ( (i<atom->nlocal) ? 1 : 0 );
}
// Set kim contributing flags
set_contributing();
// pass current atom pointers to KIM
set_argument_pointers();

View File

@ -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();