Add copymode protection to class2 styles

This commit is contained in:
Stan Moore 2017-02-15 13:56:16 -07:00
parent ccaec315db
commit 5f93fad012
4 changed files with 8 additions and 0 deletions

View File

@ -41,6 +41,8 @@ AngleClass2::AngleClass2(LAMMPS *lmp) : Angle(lmp) {}
AngleClass2::~AngleClass2()
{
if (copymode) return;
if (allocated) {
memory->destroy(setflag);
memory->destroy(setflag_a);

View File

@ -36,6 +36,8 @@ BondClass2::BondClass2(LAMMPS *lmp) : Bond(lmp) {}
BondClass2::~BondClass2()
{
if (copymode) return;
if (allocated) {
memory->destroy(setflag);
memory->destroy(r0);

View File

@ -46,6 +46,8 @@ DihedralClass2::DihedralClass2(LAMMPS *lmp) : Dihedral(lmp)
DihedralClass2::~DihedralClass2()
{
if (copymode) return;
if (allocated) {
memory->destroy(setflag);
memory->destroy(setflag_d);

View File

@ -45,6 +45,8 @@ ImproperClass2::ImproperClass2(LAMMPS *lmp) : Improper(lmp)
ImproperClass2::~ImproperClass2()
{
if (copymode) return;
if (allocated) {
memory->destroy(setflag);
memory->destroy(setflag_i);