Removed maxatom from fix spring/self, need to work on exchange for xoriginal on spring/self/kk

This commit is contained in:
Trung Nguyen
2023-08-11 09:43:28 -05:00
parent 4bb3ecd09c
commit a24eccf95d
3 changed files with 3 additions and 13 deletions

View File

@ -43,9 +43,8 @@ FixSpringSelfKokkos<DeviceType>::FixSpringSelfKokkos(LAMMPS *lmp, int narg, char
datamask_read = EMPTY_MASK;
datamask_modify = EMPTY_MASK;
maxatom = atom->nmax;
memory->destroy(xoriginal);
memoryKK->create_kokkos(k_xoriginal,xoriginal,maxatom,3,"spring/self:xoriginal");
memoryKK->create_kokkos(k_xoriginal,xoriginal,atom->nmax,3,"spring/self:xoriginal");
d_xoriginal = k_xoriginal.view<DeviceType>();
}
@ -85,15 +84,6 @@ void FixSpringSelfKokkos<DeviceType>::post_force(int /*vflag*/)
int nlocal = atom->nlocal;
// reallocate xoriginal array if necessary
if (atom->nmax > maxatom) {
maxatom = atom->nmax;
memoryKK->destroy_kokkos(k_xoriginal,xoriginal);
memoryKK->create_kokkos(k_xoriginal,xoriginal,maxatom,3,"fix_spring/self:xoriginal");
d_xoriginal = k_xoriginal.view<DeviceType>();
}
double espring_kk;

View File

@ -73,7 +73,6 @@ FixSpringSelf::FixSpringSelf(LAMMPS *lmp, int narg, char **arg) :
// register with Atom class
xoriginal = nullptr;
maxatom = atom->nmax;
FixSpringSelf::grow_arrays(atom->nmax);
atom->add_callback(Atom::GROW);
atom->add_callback(Atom::RESTART);
@ -97,6 +96,8 @@ FixSpringSelf::FixSpringSelf(LAMMPS *lmp, int narg, char **arg) :
FixSpringSelf::~FixSpringSelf()
{
if (copymode) return;
// unregister callbacks to this fix from Atom class
atom->delete_callback(id,Atom::GROW);

View File

@ -52,7 +52,6 @@ class FixSpringSelf : public Fix {
double **xoriginal; // original coords of atoms
int xflag, yflag, zflag;
int ilevel_respa;
int maxatom;
};
} // namespace LAMMPS_NS