Adding fix spring/self/kk, needed to add maxatom to fix spring/self, may need resize xoriginal as well

This commit is contained in:
Trung Nguyen
2023-08-10 00:34:52 -05:00
parent 4ca32f0cec
commit 6ff85cab7f
2 changed files with 3 additions and 1 deletions

View File

@ -73,6 +73,7 @@ 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);

View File

@ -47,11 +47,12 @@ class FixSpringSelf : public Fix {
int size_restart(int) override;
int maxsize_restart() override;
private:
protected:
double k, espring;
double **xoriginal; // original coords of atoms
int xflag, yflag, zflag;
int ilevel_respa;
int maxatom;
};
} // namespace LAMMPS_NS