From a5e543120d541f47fe0a2e9841d02151dd3e693a Mon Sep 17 00:00:00 2001
From: mihaf <miha.fosnaric@gmail.com>
Date: Tue, 08 Jul 2014 12:27:15 +0000
Subject: [PATCH] Fix: the number of cell total must be updated from new tape aswell.

---
 src/io.c |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/src/io.c b/src/io.c
index 17adda4..898b47b 100644
--- a/src/io.c
+++ b/src/io.c
@@ -170,7 +170,8 @@
 */
 
 	fwrite(vesicle->clist, sizeof(ts_cell_list),1,  fh);
-	
+/* write tape information on vesicle */
+    fwrite(vesicle->tape,sizeof(ts_tape),1,fh);
 	fwrite(&iteration, sizeof(ts_uint),1,fh);
     fclose(fh);
     return TS_SUCCESS;
@@ -418,16 +419,22 @@
                 vesicle->filament_list->poly[i]->blist->bond[j]->vtx2=vesicle->filament_list->poly[i]->vlist->vtx[idx];
         }
     }
-
+    vesicle->tape=parsetape("tape");
 // recreating space for cells // 
 	vesicle->clist=(ts_cell_list *)malloc(sizeof(ts_cell_list));
-	retval=fread(vesicle->clist, sizeof(ts_cell_list), 1,fh); 
+	retval=fread(vesicle->clist, sizeof(ts_cell_list), 1,fh);
+    vesicle->clist->ncmax[0]=vesicle->tape->ncxmax; 
+    vesicle->clist->ncmax[1]=vesicle->tape->ncymax; 
+    vesicle->clist->ncmax[2]=vesicle->tape->nczmax; 
+	vesicle->clist->cellno=vesicle->clist->ncmax[0]*vesicle->clist->ncmax[1]*vesicle->clist->ncmax[2];
 	vesicle->clist->cell=(ts_cell **)malloc(sizeof(ts_cell *)*vesicle->clist->ncmax[0]*vesicle->clist->ncmax[1]*vesicle->clist->ncmax[2]);
 	for(i=0;i<vesicle->clist->ncmax[0]*vesicle->clist->ncmax[1]*vesicle->clist->ncmax[2];i++){
         	vesicle->clist->cell[i]=(ts_cell *)calloc(1,sizeof(ts_cell));
         	vesicle->clist->cell[i]->idx=i+1; // We enumerate cells! Probably never required!
     	}
-
+//recreating stored tape information//
+//    vesicle->tape=(ts_tape *)malloc(sizeof(ts_tape));
+//    retval=fread(vesicle->tape, sizeof(ts_tape),1,fh);
 	retval=fread(iteration,sizeof(ts_uint),1,fh);
     if(retval); 
     fclose(fh);
@@ -970,8 +977,11 @@
 	CFG_SIMPLE_INT("nfono",&tape->nfono),
 	CFG_SIMPLE_INT("R_nucleus",&tape->R_nucleus),
 	CFG_SIMPLE_FLOAT("dmax", &tape->dmax),
+	CFG_SIMPLE_FLOAT("dmin_interspecies", &tape->dmin_interspecies),
         CFG_SIMPLE_FLOAT("xk0",&tape->xk0),
 	CFG_SIMPLE_INT("pswitch",&tape->pswitch),
+	CFG_SIMPLE_INT("constvolswitch",&tape->constvolswitch),
+	CFG_SIMPLE_FLOAT("constvolprecision",&tape->constvolprecision),
 	CFG_SIMPLE_FLOAT("pressure",&tape->pressure),
 	CFG_SIMPLE_FLOAT("k_spring",&tape->kspring),
 	CFG_SIMPLE_FLOAT("xi",&tape->xi),
@@ -987,6 +997,7 @@
         CFG_SIMPLE_INT("smp_cores",&tape->brezveze0),
         CFG_SIMPLE_INT("cluster_nodes",&tape->brezveze1),
         CFG_SIMPLE_INT("distributed_processes",&tape->brezveze2),
+	CFG_SIMPLE_INT("spherical_harmonics_coefficients",&tape->shc),
         CFG_END()
     };
     cfg_t *cfg;    

--
Gitblit v1.9.3