Move nr_nonperturbed out of t_ilist
[alexxy/gromacs.git] / src / gromacs / topology / idef.cpp
index ef3f17e8374d4ec1197a70dd7a35adc51c02d8ca..b438c3583db518dd01590746695e241ba43de338 100644 (file)
@@ -411,15 +411,15 @@ void init_idef(t_idef* idef)
     idef->iparams_fbposres = nullptr;
     for (int f = 0; f < F_NRE; ++f)
     {
-        idef->il[f].iatoms          = nullptr;
-        idef->il[f].nalloc          = 0;
-        idef->il[f].nr              = 0;
-        idef->il[f].nr_nonperturbed = 0;
+        idef->il[f].iatoms                   = nullptr;
+        idef->il[f].nalloc                   = 0;
+        idef->il[f].nr                       = 0;
+        idef->numNonperturbedInteractions[f] = 0;
     }
     idef->cmap_grid               = nullptr;
     idef->iparams_posres_nalloc   = 0;
     idef->iparams_fbposres_nalloc = 0;
-    idef->ilsort                  = 0;
+    idef->ilsort                  = ilsortUNKNOWN;
 }
 
 void done_idef(t_idef* idef)
@@ -439,11 +439,10 @@ void done_idef(t_idef* idef)
 
 void copy_ilist(const t_ilist* src, t_ilist* dst)
 {
-    dst->nr              = src->nr;
-    dst->nr_nonperturbed = src->nr_nonperturbed;
-    dst->nalloc          = src->nalloc;
+    dst->nr     = src->nr;
+    dst->nalloc = src->nr;
 
-    snew(dst->iatoms, dst->nr);
+    snew(dst->iatoms, dst->nalloc);
     for (int i = 0; i < dst->nr; ++i)
     {
         dst->iatoms[i] = src->iatoms[i];