From bd221077dabdfe4d42757781a340f8f3e9f4fe24 Mon Sep 17 00:00:00 2001 From: Samo Penic <samo.penic@gmail.com> Date: Wed, 03 Sep 2014 20:12:23 +0000 Subject: [PATCH] Fix a major screwup in dump. Clist and Tape is not restored from dump, so it must not be included in one! --- src/io.c | 19 +++++-------------- 1 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/io.c b/src/io.c index ead2a7e..01ca5d5 100644 --- a/src/io.c +++ b/src/io.c @@ -10,7 +10,7 @@ #include <dirent.h> #include "initial_distribution.h" #include "poly.h" - +#include "cell.h" #include <getopt.h> #include <sys/stat.h> #include <sys/types.h> @@ -169,9 +169,9 @@ poly_list->poly->bond */ - fwrite(vesicle->clist, sizeof(ts_cell_list),1, fh); +// fwrite(vesicle->clist, sizeof(ts_cell_list),1, fh); /* write tape information on vesicle */ - fwrite(vesicle->tape,sizeof(ts_tape),1,fh); +// fwrite(vesicle->tape,sizeof(ts_tape),1,fh); fwrite(&iteration, sizeof(ts_uint),1,fh); fclose(fh); return TS_SUCCESS; @@ -421,17 +421,8 @@ } 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); - vesicle->clist->ncmax[0]=vesicle->tape->ncxmax; - vesicle->clist->ncmax[1]=vesicle->tape->ncymax; - vesicle->clist->ncmax[2]=vesicle->tape->nczmax; - 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->clist=init_cell_list(vesicle->tape->ncxmax, vesicle->tape->ncymax, vesicle->tape->nczmax, vesicle->tape->stepsize); + vesicle->clist->max_occupancy=8; // 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); -- Gitblit v1.9.3