Returning back to 142a67fe82b830e5c7816914afa62445959c87ca
| | |
| | | ts_double projArea; |
| | | ts_double relR; |
| | | ts_double solAngle; |
| | | ts_int locked; |
| | | }; |
| | | typedef struct ts_vertex ts_vertex; |
| | | |
| | |
| | | #how many MC sweeps between subsequent records of states to disk |
| | | mcsweeps=100 |
| | | #how many initial mcsweeps*inititer MC sweeps before recording to disk? |
| | | inititer=10 |
| | | inititer=100 |
| | | #how many records do you want on the disk iteration are there in a run? |
| | | iterations=100 |
| | | iterations=1000 |
| | | |
| | | |
| | | #shut up if we are using cluster!!! |
| | |
| | | #include "vertexmove.h" |
| | | #include "bondflip.h" |
| | | #include "frame.h" |
| | | #include "vertex.h" |
| | | #include "io.h" |
| | | ts_bool run_simulation(ts_vesicle *vesicle, ts_uint mcsweeps, ts_uint inititer, ts_uint iterations){ |
| | | ts_uint i, j; |
| | |
| | | ts_bool single_timestep(ts_vesicle *vesicle){ |
| | | ts_bool retval; |
| | | ts_double rnvec[3]; |
| | | ts_uint i;// b; |
| | | ts_uint i, b; |
| | | for(i=0;i<vesicle->vlist->n;i++){ |
| | | rnvec[0]=drand48(); |
| | | rnvec[1]=drand48(); |
| | | rnvec[2]=drand48(); |
| | | vertex_taint(vesicle->vlist->vtx[i],1); |
| | | // ts_fprintf(stdout, "Vertex %d should be tainted, level=%d.\n", i, vesicle->vlist->vtx[i]->locked); |
| | | if(vertex_tainted(vesicle->vlist->vtx[i],1,1)){ |
| | | ts_fprintf(stdout, "Vertex %d tainted, level=%d. Waiting....\n", i, vesicle->vlist->vtx[i]->locked); |
| | | while(vertex_tainted(vesicle->vlist->vtx[i],1,1)); |
| | | } |
| | | retval=single_verticle_timestep(vesicle,vesicle->vlist->vtx[i],rnvec); |
| | | vertex_untaint(vesicle->vlist->vtx[i],1); |
| | | // ts_fprintf(stdout, "Vertex %d should be untainted, level=%d.\n", i, vesicle->vlist->vtx[i]->locked); |
| | | } |
| | | |
| | | // ts_int cnt=0; |
| | | /* |
| | | for(i=0;i<vesicle->vlist->n;i++){ |
| | | //why is rnvec needed in bondflip? |
| | | /* rnvec[0]=drand48(); |
| | | rnvec[1]=drand48(); |
| | | rnvec[2]=drand48(); |
| | | */ |
| | | b=rand() % vesicle->blist->n; |
| | | //find a bond and return a pointer to a bond... |
| | | //call single_bondflip_timestep... |
| | |
| | | // if(retval==TS_SUCCESS) cnt++; |
| | | } |
| | | // printf("Bondflip success rate in one sweep: %d/%d=%e\n", cnt,vesicle->blist->n,(double)cnt/(double)vesicle->blist->n); |
| | | */ |
| | | if(retval); |
| | | return TS_SUCCESS; |
| | | } |
| | |
| | | |
| | | return vlist; |
| | | } |
| | | |
| | | |
| | | |
| | | ts_bool vertex_taint(ts_vertex *vtx, ts_uint level){ |
| | | if(level==0){ |
| | | vtx->locked++; |
| | | return TS_SUCCESS; |
| | | } |
| | | ts_uint i; |
| | | for(i=0; i<vtx->neigh_no; i++){ |
| | | vertex_taint(vtx->neigh[i], level-1); |
| | | } |
| | | vtx->locked++; |
| | | return TS_SUCCESS; |
| | | } |
| | | |
| | | ts_bool vertex_untaint(ts_vertex *vtx, ts_uint level){ |
| | | if(level==0){ |
| | | vtx->locked--; |
| | | return TS_SUCCESS; |
| | | } |
| | | ts_uint i; |
| | | for(i=0; i<vtx->neigh_no; i++){ |
| | | vertex_untaint(vtx->neigh[i], level-1); |
| | | } |
| | | vtx->locked--; |
| | | return TS_SUCCESS; |
| | | } |
| | | |
| | | inline ts_bool vertex_tainted(ts_vertex *vtx, ts_uint level, ts_uint amount){ |
| | | if(vtx->locked>amount) return 1; |
| | | else return 0; |
| | | } |
| | |
| | | ts_bool vtx_duplicate(ts_vertex *cvtx, ts_vertex *ovtx); |
| | | ts_vertex **vtx_neigh_copy(ts_vertex_list *vlist,ts_vertex *ovtx); |
| | | ts_vertex_list *vertex_list_copy(ts_vertex_list *ovlist); |
| | | ts_bool vertex_taint(ts_vertex *vtx, ts_uint level); |
| | | ts_bool vertex_untaint(ts_vertex *vtx, ts_uint level); |
| | | inline ts_bool vertex_tainted(ts_vertex *vtx, ts_uint level, ts_uint amount); |
| | | |
| | | #endif |