testing confinement (preliminary)
| | |
| | | cfg = cfg_init(opts, 0); |
| | | retval=cfg_parse_buf(cfg, buffer); |
| | | tape->plane_confinement_switch=cfg_getint(cfg,"plane_confinement_switch"); |
| | | tape->plane_d=cfg_getint(cfg,"plane_d"); |
| | | tape->plane_F=cfg_getint(cfg,"plane_F"); |
| | | tape->plane_d=cfg_getfloat(cfg,"plane_d"); |
| | | tape->plane_F=cfg_getfloat(cfg,"plane_F"); |
| | | |
| | | if(retval==CFG_FILE_ERROR){ |
| | | fatal("No tape file.",100); |
| | |
| | | centermass(vesicle); |
| | | cell_occupation(vesicle); |
| | | vesicle_volume(vesicle); //needed for constant volume at this moment |
| | | vesicle_area(vesicle); //needed for constant area at this moment |
| | | vesicle_area(vesicle); //needed for constant area at this moment |
| | | if(V0<0.000001) |
| | | V0=vesicle->volume; |
| | | ts_fprintf(stdout,"Setting volume V0=%.17f\n",V0); |
| | |
| | | A0=vesicle->area; |
| | | ts_fprintf(stdout,"Setting area A0=%.17f\n",A0); |
| | | epsvol=4.0*sqrt(2.0*M_PI)/pow(3.0,3.0/4.0)*V0/pow(vesicle->tlist->n,3.0/2.0); |
| | | epsarea=A0/(ts_double)vesicle->tlist->n; |
| | | epsarea=A0/(ts_double)vesicle->tlist->n; |
| | | |
| | | //plane confinement part 1 |
| | | |
| | | if(vesicle->tape->plane_confinement_switch){ |
| | | vesicle->confinement_plane.z_min=-vesicle->tape->plane_d/2.0; |
| | | vesicle->confinement_plane.z_max=vesicle->tape->plane_d/2.0; |
| | | ts_fprintf(stderr,"Vesicle confinement by plane set to (zmin, zmax)=(%e,%e).\n",vesicle->confinement_plane.z_min,vesicle->confinement_plane.z_max); |
| | | } |
| | | |
| | | // fprintf(stderr, "DVol=%1.16f (%1.16f), V0=%1.16f\n", epsvol,0.003e-2*V0,V0); |
| | | if(start_iteration<inititer) ts_fprintf(stdout, "Starting simulation (first %d x %d MC sweeps will not be recorded on disk)\n", inititer, mcsweeps); |
| | | for(i=start_iteration;i<inititer+iterations;i++){ |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | // plane confinement check whether the new position of vertex will be out of bounds |
| | | if(vesicle->tape->plane_confinement_switch){ |
| | | if(vtx->z>vesicle->confinement_plane.z_max || vtx->z<vesicle->confinement_plane.z_min){ |
| | | vtx=memcpy((void *)vtx,(void *)&backupvtx[0],sizeof(ts_vertex)); |
| | | return TS_FAIL; |
| | | } |
| | | } |
| | | //#undef SQ |
| | | //self avoidance check with distant vertices |
| | | cellidx=vertex_self_avoidance(vesicle, vtx); |