Merge pull request #1125 from athomps/sna-atom-leakfix
The sna*/atom computes were not destroying SNA objects. Fixed.
This commit is contained in:
@ -115,7 +115,8 @@ ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
} else error->all(FLERR,"Illegal compute sna/atom command");
|
||||
}
|
||||
|
||||
snaptr = new SNA*[comm->nthreads];
|
||||
nthreads = comm->nthreads;
|
||||
snaptr = new SNA*[nthreads];
|
||||
#if defined(_OPENMP)
|
||||
#pragma omp parallel default(none) shared(lmp,rfac0,twojmax,rmin0,switchflag,bzeroflag)
|
||||
#endif
|
||||
@ -146,6 +147,8 @@ ComputeSNAAtom::~ComputeSNAAtom()
|
||||
memory->destroy(radelem);
|
||||
memory->destroy(wjelem);
|
||||
memory->destroy(cutsq);
|
||||
for (int tid = 0; tid<nthreads; tid++)
|
||||
delete snaptr[tid];
|
||||
delete [] snaptr;
|
||||
}
|
||||
|
||||
|
||||
@ -45,6 +45,7 @@ class ComputeSNAAtom : public Compute {
|
||||
class SNA** snaptr;
|
||||
double cutmax;
|
||||
int quadraticflag;
|
||||
int nthreads;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -148,6 +148,8 @@ ComputeSNADAtom::~ComputeSNADAtom()
|
||||
memory->destroy(radelem);
|
||||
memory->destroy(wjelem);
|
||||
memory->destroy(cutsq);
|
||||
for (int tid = 0; tid<nthreads; tid++)
|
||||
delete snaptr[tid];
|
||||
delete [] snaptr;
|
||||
}
|
||||
|
||||
|
||||
@ -47,6 +47,7 @@ class ComputeSNADAtom : public Compute {
|
||||
class SNA** snaptr;
|
||||
double cutmax;
|
||||
int quadraticflag;
|
||||
int nthreads;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -142,6 +142,9 @@ ComputeSNAVAtom::~ComputeSNAVAtom()
|
||||
memory->destroy(radelem);
|
||||
memory->destroy(wjelem);
|
||||
memory->destroy(cutsq);
|
||||
|
||||
for (int tid = 0; tid<nthreads; tid++)
|
||||
delete snaptr[tid];
|
||||
delete [] snaptr;
|
||||
}
|
||||
|
||||
|
||||
@ -46,6 +46,7 @@ class ComputeSNAVAtom : public Compute {
|
||||
double *wjelem;
|
||||
class SNA** snaptr;
|
||||
int quadraticflag;
|
||||
int nthreads;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user