Trisurf Monte Carlo simulator
Samo Penic
2014-03-06 063289f4f872d642078d70757685c728e3fdfc81
Fixed a bug. added cells
2 files modified
22 ■■■■ changed files
src/io.c 12 ●●●● patch | view | raw | blame | history
src/main.c 10 ●●●●● patch | view | raw | blame | history
src/io.c
@@ -127,6 +127,8 @@
        poly_list->poly->bond
*/
    fwrite(vesicle->clist, sizeof(ts_cell_list),1,  fh);
    fclose(fh);
    return TS_SUCCESS;
}
@@ -298,8 +300,14 @@
        }
    }
// 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->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!
        }
    if(retval); 
    fclose(fh);
src/main.c
@@ -64,7 +64,7 @@
vtx_list_free(vlist1);
printf("Tests complete.\n");
*/
//vesicle1=parsetape(&mcsweeps, &inititer, &iterations);
vesicle1=parsetape(&mcsweeps, &inititer, &iterations);
/*Testing */
//vesicle->poly_list=init_poly_list(1400,20,vesicle->vlist);
@@ -74,14 +74,16 @@
//write_vertex_xml_file(vesicle,0);
//vesicle_free(vesicle);
dump_state(vesicle1);
vesicle=restore_state();
write_vertex_xml_file(vesicle,1);
write_master_xml_file("test.pvd");
//write_vertex_xml_file(vesicle,1);
//write_master_xml_file("test.pvd");
//vesicle_free(vesicle1);
//vesicle_free(vesicle);
return 0;
vesicle_free(vesicle1);
fprintf(stderr,"Starting simulation...");
run_simulation(vesicle, mcsweeps, inititer, iterations);
return 0;
write_master_xml_file("test.pvd");
write_dout_fcompat_file(vesicle,"dout");