Trisurf Monte Carlo simulator
Samo Penic
2013-10-20 b14a8d3d373ab1682a8a713e4f2a3795934d6b26
commit | author | age
d7639a 1 #include<stdlib.h>
SP 2 #include<stdio.h>
aec47d 3 #include<math.h>
SP 4 //#include "io.h"
5 #include "general.h"
6 #include "timestep.h"
7 #include "vertexmove.h"
30ee9c 8 #include "bondflip.h"
d7639a 9
SP 10 ts_bool single_timestep(ts_vesicle *vesicle){
11     ts_bool retval;
12     ts_double rnvec[3];
13     ts_uint i;
aec47d 14     for(i=0;i<vesicle->vlist->n;i++){
d7639a 15         rnvec[0]=drand48();
SP 16         rnvec[1]=drand48();
17         rnvec[2]=drand48();
aec47d 18         retval=single_verticle_timestep(vesicle,vesicle->vlist->vtx[i],rnvec);
d7639a 19     }
SP 20
b7c9b3 21 //    ts_int cnt=0;
aec47d 22     for(i=0;i<vesicle->blist->n;i++){
d7639a 23         rnvec[0]=drand48();
SP 24         rnvec[1]=drand48();
25         rnvec[2]=drand48();
26         //find a bond and return a pointer to a bond...
27         //call single_bondflip_timestep...
30ee9c 28         retval=single_bondflip_timestep(vesicle,vesicle->blist->bond[i],rnvec);
b7c9b3 29 //    if(retval==TS_SUCCESS) cnt++;        
d7639a 30     } 
b7c9b3 31 //    printf("Bondflip success rate in one sweep: %d/%d=%e\n", cnt,vesicle->blist->n,(double)cnt/(double)vesicle->blist->n);
41a035 32     if(retval);
d7639a 33     return TS_SUCCESS;
SP 34 }
35
36
37