Added spherical harmonics as-is into rbc
| | |
| | | trisurfdir=../ |
| | | trisurf_PROGRAMS = trisurf |
| | | trisurf_SOURCES = general.c vertex.c bond.c triangle.c cell.c vesicle.c initial_distribution.c io.c frame.c energy.c timestep.c vertexmove.c bondflip.c main.c poly.c stats.c |
| | | trisurf_SOURCES = general.c vertex.c bond.c triangle.c cell.c vesicle.c initial_distribution.c io.c frame.c energy.c timestep.c vertexmove.c bondflip.c main.c poly.c stats.c sh.c |
| | | #trisurf_LDFLAGS = -lm -lconfuse |
| | | shdiscoverdir=../ |
| | | shdiscover_PROGRAMS= shdiscover |
| | |
| | | #include "energy.h" |
| | | #include "poly.h" |
| | | #include "io.h" |
| | | #include "sh.h" |
| | | |
| | | ts_vesicle *initial_distribution_dipyramid(ts_uint nshell, ts_uint ncmax1, ts_uint ncmax2, ts_uint ncmax3, ts_double stepsize){ |
| | | ts_fprintf(stdout,"Starting initial_distribution on vesicle with %u shells!...\n",nshell); |
| | |
| | | |
| | | vesicle->pressure= tape->pressure; |
| | | vesicle->pswitch=tape->pswitch; |
| | | |
| | | vesicle->sphHarmonics=sph_init(vesicle->vlist,tape->shc); |
| | | return vesicle; |
| | | |
| | | } |
| | |
| | | CFG_SIMPLE_INT("smp_cores",&tape->brezveze0), |
| | | CFG_SIMPLE_INT("cluster_nodes",&tape->brezveze1), |
| | | CFG_SIMPLE_INT("distributed_processes",&tape->brezveze2), |
| | | CFG_SIMPLE_INT("spherical_harmonics_coefficients",&tape->shc), |
| | | CFG_END() |
| | | }; |
| | | cfg_t *cfg; |
| | |
| | | long int inititer; |
| | | long int mcsweeps; |
| | | long int quiet; |
| | | long int shc; |
| | | } ts_tape; |
| | | |
| | | typedef struct{ |
| | |
| | | #include "frame.h" |
| | | #include "timestep.h" |
| | | #include "poly.h" |
| | | #include "sh.h" |
| | | |
| | | /** Entrance function to the program |
| | | * @param argv is a number of parameters used in program call (including the program name |
| | |
| | | vesicle->dmax=tape->dmax*tape->dmax; |
| | | poly_assign_filament_xi(vesicle,tape); |
| | | vesicle->clist->dmin_interspecies = tape->dmin_interspecies*tape->dmin_interspecies; |
| | | vesicle->sphHarmonics=sph_init(vesicle->vlist,tape->shc); |
| | | |
| | | if(command_line_args.reset_iteration_count) start_iteration=tape->inititer; |
| | | else start_iteration++; |
| | |
| | | sph->N++; |
| | | return TS_SUCCESS; |
| | | } |
| | | |
| | | |
| | | ts_bool saveAvgUlm2(ts_vesicle *vesicle){ |
| | | |
| | | FILE *fh; |
| | | |
| | | fh=fopen("sph2out.dat", "w"); |
| | | if(fh==NULL){ |
| | | err("Cannot open file %s for writing"); |
| | | return TS_FAIL; |
| | | } |
| | | |
| | | ts_spharm *sph=vesicle->sphHarmonics; |
| | | ts_int i,j; |
| | | fprintf(fh,"l,\tm,\tulm^2avg\n"); |
| | | for(i=0;i<sph->l;i++){ |
| | | for(j=0;j<2*i+1;j++){ |
| | | fprintf(fh,"%d,\t%d,\t%e\n", i, j-i, sph->sumUlm2[i][j]/(ts_double)sph->N); |
| | | |
| | | } |
| | | fprintf(fh,"\n"); |
| | | } |
| | | fclose(fh); |
| | | return TS_SUCCESS; |
| | | } |
| | |
| | | ts_bool preparationSh(ts_vesicle *vesicle, ts_double r0); |
| | | ts_bool calculateYlmi(ts_vesicle *vesicle); |
| | | ts_bool calculateUlm(ts_vesicle *vesicle); |
| | | ts_bool saveAvgUlm2(ts_vesicle *vesicle); |
| | | #endif |
| | |
| | | |
| | | |
| | | |
| | | ts_bool saveAvgUlm2(ts_vesicle *vesicle){ |
| | | |
| | | FILE *fh; |
| | | |
| | | fh=fopen("sph2out.dat", "w"); |
| | | if(fh==NULL){ |
| | | err("Cannot open file %s for writing"); |
| | | return TS_FAIL; |
| | | } |
| | | |
| | | ts_spharm *sph=vesicle->sphHarmonics; |
| | | ts_int i,j; |
| | | fprintf(fh,"l,\tm,\tulm^2avg\n"); |
| | | for(i=0;i<sph->l;i++){ |
| | | for(j=0;j<2*i+1;j++){ |
| | | fprintf(fh,"%d,\t%d,\t%e\n", i, j-i, sph->sumUlm2[i][j]/(ts_double)sph->N); |
| | | |
| | | } |
| | | fprintf(fh,"\n"); |
| | | } |
| | | fclose(fh); |
| | | return TS_SUCCESS; |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | ts_bool saveAvgUlm2(ts_vesicle *vesicle){ |
| | | |
| | | FILE *fh; |
| | | |
| | | fh=fopen("sph2out.dat", "w"); |
| | | if(fh==NULL){ |
| | | err("Cannot open file %s for writing"); |
| | | return TS_FAIL; |
| | | } |
| | | |
| | | ts_spharm *sph=vesicle->sphHarmonics; |
| | | ts_int i,j; |
| | | fprintf(fh,"l,\tm,\tulm^2avg\n"); |
| | | for(i=0;i<sph->l;i++){ |
| | | for(j=0;j<2*i+1;j++){ |
| | | fprintf(fh,"%d,\t%d,\t%e\n", i, j-i, sph->sumUlm2[i][j]/(ts_double)sph->N); |
| | | |
| | | } |
| | | fprintf(fh,"\n"); |
| | | } |
| | | fclose(fh); |
| | | return TS_SUCCESS; |
| | | } |
| | |
| | | #how many initial mcsweeps*inititer MC sweeps before recording to disk? |
| | | inititer=0 |
| | | #how many records do you want on the disk iteration are there in a run? |
| | | iterations=20 |
| | | iterations=2000 |
| | | |
| | | |
| | | ###### Spherical harmonics ########### |
| | | spherical_harmonics_coefficients=21 |
| | | |
| | | #shut up if we are using cluster!!! |
| | | quiet=false |
| | | |
| | |
| | | #include "frame.h" |
| | | #include "io.h" |
| | | #include "stats.h" |
| | | #include "sh.h" |
| | | #include "vesicle.h" |
| | | |
| | | ts_bool run_simulation(ts_vesicle *vesicle, ts_uint mcsweeps, ts_uint inititer, ts_uint iterations, ts_uint start_iteration){ |
| | | ts_uint i, j; |
| | | ts_double r0; |
| | | ts_double l1,l2,l3,volume=0.0,area=0.0,vmsr,bfsr, vmsrt, bfsrt; |
| | | ts_ulong epochtime; |
| | | // char filename[255]; |
| | |
| | | epochtime=get_epoch(); |
| | | gyration_eigen(vesicle, &l1, &l2, &l3); |
| | | get_area_volume(vesicle, &area,&volume); |
| | | vesicle_volume(vesicle); |
| | | r0=getR0(vesicle); |
| | | preparationSh(vesicle,r0); |
| | | calculateYlmi(vesicle); |
| | | calculateUlm(vesicle); |
| | | storeUlm2(vesicle); |
| | | saveAvgUlm2(vesicle); |
| | | |
| | | fprintf(fd, "%lu %u %e %e %e %e %e %e %e\n",epochtime,i,vmsr,bfsr,volume, area,l1,l2,l3); |
| | | |
| | | // sprintf(filename,"timestep-%05d.pov",i-inititer); |