Convert gmx_cmap_t to C++
[alexxy/gromacs.git] / src / gromacs / domdec / domdec_topology.cpp
index 02d7a1a3d142094c90dc66707a964984b5a894c2..b86d93d23e1217de80280245a2e4c1843256f086 100644 (file)
@@ -2176,14 +2176,15 @@ gmx_localtop_t *dd_init_local_top(const gmx_mtop_t *top_global)
     snew(top, 1);
 
     /* TODO: Get rid of the const casts below, e.g. by using a reference */
-    top->idef.ntypes    = top_global->ffparams.numTypes();
-    top->idef.atnr      = top_global->ffparams.atnr;
-    top->idef.functype  = const_cast<t_functype *>(top_global->ffparams.functype.data());
-    top->idef.iparams   = const_cast<t_iparams *>(top_global->ffparams.iparams.data());
-    top->idef.fudgeQQ   = top_global->ffparams.fudgeQQ;
-    top->idef.cmap_grid = top_global->ffparams.cmap_grid;
-
-    top->idef.ilsort    = ilsortUNKNOWN;
+    top->idef.ntypes     = top_global->ffparams.numTypes();
+    top->idef.atnr       = top_global->ffparams.atnr;
+    top->idef.functype   = const_cast<t_functype *>(top_global->ffparams.functype.data());
+    top->idef.iparams    = const_cast<t_iparams *>(top_global->ffparams.iparams.data());
+    top->idef.fudgeQQ    = top_global->ffparams.fudgeQQ;
+    top->idef.cmap_grid  = new gmx_cmap_t;
+    *top->idef.cmap_grid = top_global->ffparams.cmap_grid;
+
+    top->idef.ilsort     = ilsortUNKNOWN;
 
     return top;
 }