Trisurf Monte Carlo simulator
Samo Penic
2012-06-27 8854f5104364fc4699d099641b406ce00a95a29a
commit | author | age
5bb11d 1 #include "general.h"
SP 2 #include "sh.h"
3 #include "vesicle.h"
4 #include "initial_distribution.h"
9bf6ee 5 #include <math.h>
5bb11d 6
SP 7 int main(){
8854f5 8 ts_vesicle *vesicle=initial_distribution_dipyramid(17,60,60,60,0.15);
5bb11d 9 //parsetape(vesicle,&i);
SP 10
11 //these four must come from parsetype!
12 vesicle->dmax=1.67*1.67;
13 vesicle->stepsize=0.15;
14 vesicle->clist->max_occupancy=8;
15 vesicle->bending_rigidity=25.0;
16 fprintf(stderr,"xk=%f\n",vesicle->bending_rigidity);
17
18 vesicle->sphHarmonics=sph_init(vesicle->vlist, 10);
19 int i,j;
8854f5 20 ts_double area;
79fc9c 21 for(i=1;i<=vesicle->sphHarmonics->l;i++){
SP 22     for(j=1;j<=2*i+1;j++){
23     fprintf(stderr,"co(%d,%d)=%e\n",i,j,vesicle->sphHarmonics->co[i][j]);
5bb11d 24     }
SP 25 }
9bf6ee 26 ts_double r0;
SP 27 vesicle_volume(vesicle);
28 fprintf(stderr,"Volume=%e\n",vesicle->volume);
29 r0=getR0(vesicle);
30 fprintf(stderr,"r0=%e\n",r0);
8854f5 31 area=0;
SP 32 for(i=0;i<vesicle->tlist->n;i++){
33     area+=vesicle->tlist->tria[i]->area;
34 }
35 fprintf(stderr,"area_dipyramid=%e\n",area);
36
9bf6ee 37 preparationSh(vesicle,r0);
SP 38 calculateYlmi(vesicle);
79048f 39 calculateUlm(vesicle);
SP 40
41 for(i=0;i<vesicle->sphHarmonics->l;i++){
42     for(j=0;j<2*i+1;j++){
43     fprintf(stderr,"ulm(%d,%d)=%e\n",i,j+1,vesicle->sphHarmonics->ulm[i][j]);
44     }
45 }
46
47
5bb11d 48
SP 49 sph_free(vesicle->sphHarmonics);
9bf6ee 50 vesicle_free(vesicle);
5bb11d 51 return 0;
SP 52 }