diff --git a/src/ML-POD/pair_pod.cpp b/src/ML-POD/pair_pod.cpp index 991ab6855c3..f76191328ff 100644 --- a/src/ML-POD/pair_pod.cpp +++ b/src/ML-POD/pair_pod.cpp @@ -77,6 +77,7 @@ PairPOD::PairPOD(LAMMPS *lmp) : Pair(lmp), fastpodptr(nullptr) abfx = nullptr; abfy = nullptr; abfz = nullptr; + abftm = nullptr; sumU = nullptr; forcecoeff = nullptr; Centroids = nullptr; @@ -88,6 +89,7 @@ PairPOD::PairPOD(LAMMPS *lmp) : Pair(lmp), fastpodptr(nullptr) pdd = nullptr; coefficients = nullptr; pn3 = nullptr; + pq3 = nullptr; pc3 = nullptr; pa4 = nullptr; pb4 = nullptr; @@ -124,6 +126,7 @@ PairPOD::~PairPOD() memory->destroy(abfx); memory->destroy(abfy); memory->destroy(abfz); + memory->destroy(abftm); memory->destroy(sumU); memory->destroy(forcecoeff); memory->destroy(Centroids); @@ -135,6 +138,7 @@ PairPOD::~PairPOD() memory->destroy(pdd); memory->destroy(coefficients); memory->destroy(pn3); + memory->destroy(pq3); memory->destroy(pc3); memory->destroy(pa4); memory->destroy(pb4); @@ -568,14 +572,18 @@ void PairPOD::copy_data_from_pod_class() besselparams[1] = fastpodptr->besselparams[1]; besselparams[2] = fastpodptr->besselparams[2]; + memory->destroy(abftm); memory->create(abftm, 4*K3, "abftm"); + memory->destroy(elemindex); memory->create(elemindex, nelements*nelements, "elemindex"); for (int i=0; ielemindex[i]; + memory->destroy(Phi); memory->create(Phi, ns * ns, "pair_pod:Phi"); for (int i=0; iPhi[i]; + memory->destroy(coefficients); memory->create(coefficients, nCoeffPerElement * nelements, "pair_pod:coefficients"); for (int i=0; icoeff[i]; @@ -590,11 +598,17 @@ void PairPOD::copy_data_from_pod_class() Centroids[i] = fastpodptr->Centroids[i]; } + memory->destroy(pn3); memory->create(pn3, nabf3+1, "pn3"); // array stores the number of monomials for each degree + memory->destroy(pq3); memory->create(pq3, K3*2, "pq3"); // array needed for the recursive computation of the angular basis functions + memory->destroy(pc3); memory->create(pc3, K3, "pc3"); // array needed for the computation of the three-body descriptors + memory->destroy(pa4); memory->create(pa4, nabf4+1, "pa4"); // this array is a subset of the array {0, 1, 4, 10, 19, 29, 47, 74, 89, 119, 155, 209, 230, 275, 335, 425, 533, 561, 624, 714, 849, 949, 1129, 1345} + memory->destroy(pb4); memory->create(pb4, Q4*3, "pb4"); // array stores the indices of the monomials needed for the computation of the angular basis functions + memory->destroy(pc4); memory->create(pc4, Q4, "pc4"); // array of monomial coefficients needed for the computation of the four-body descriptors for (int i=0; ipn3[i]; for (int i=0; ipc3[i];