Finished spontaneous force
| | |
| | | } |
| | | return TS_SUCCESS; |
| | | } |
| | | |
| | | ts_double direct_force_energy(ts_vesicle *vesicle, ts_vertex *vtx, ts_vertex *vtx_old){ |
| | | if(fabs(vtx->c)<1e-15) return 0.0; |
| | | // printf("was here"); |
| | | if(fabs(vesicle->tape->F)<1e-15) return 0.0; |
| | | |
| | | ts_double norml,ddp=0.0; |
| | | ts_uint i; |
| | | ts_double xnorm=0.0,ynorm=0.0,znorm=0.0; |
| | | /*find normal of the vertex as average normal of all the triangles surrounding it. */ |
| | | for(i=0;i<vtx->tristar_no;i++){ |
| | | xnorm=vtx->tristar[i]->xnorm; |
| | | ynorm=vtx->tristar[i]->ynorm; |
| | | znorm=vtx->tristar[i]->znorm; |
| | | } |
| | | /*normalize*/ |
| | | norml=sqrt(xnorm*xnorm+ynorm*ynorm+znorm*znorm); |
| | | xnorm/=norml; |
| | | ynorm/=norml; |
| | | znorm/=norml; |
| | | /*calculate ddp, perpendicular displacement*/ |
| | | ddp=xnorm*(vtx->x-vtx_old->x)+xnorm*(vtx->y-vtx_old->y)+znorm*(vtx->z-vtx_old->z); |
| | | /*calculate dE*/ |
| | | // printf("ddp=%e",ddp); |
| | | return vesicle->tape->F*ddp; |
| | | |
| | | } |
| | |
| | | |
| | | ts_bool sweep_attraction_bond_energy(ts_vesicle *vesicle); |
| | | inline ts_bool attraction_bond_energy(ts_bond *bond, ts_double w); |
| | | |
| | | ts_double direct_force_energy(ts_vesicle *vesicle, ts_vertex *vtx, ts_vertex *vtx_old); |
| | | #endif |
| | |
| | | long int number_of_vertices_with_c0; |
| | | ts_double c0; |
| | | ts_double w; |
| | | ts_double F; |
| | | } ts_tape; |
| | | |
| | | |
| | |
| | | CFG_SIMPLE_INT("number_of_vertices_with_c0", &tape->number_of_vertices_with_c0), |
| | | CFG_SIMPLE_FLOAT("c0",&tape->c0), |
| | | CFG_SIMPLE_FLOAT("w",&tape->w), |
| | | CFG_SIMPLE_FLOAT("F",&tape->F), |
| | | CFG_END() |
| | | }; |
| | | cfg_t *cfg; |
| | |
| | | |
| | | #NirGov branch only! |
| | | #number of vertices with spontaneous curvature (integer) |
| | | number_of_vertices_with_c0=30 |
| | | number_of_vertices_with_c0=100 |
| | | #spontaneous curvature (float) |
| | | c0=0.5 |
| | | #energy of attraction of vertices with spontaneous curvature (float, positive value for attraction) |
| | | w=100.0 |
| | | |
| | | w=10.0 |
| | | #direct force on vesicles with spontaneous curvature (float) |
| | | F=2.0 |
| | |
| | | delta_energy+=delta_energy_cv; |
| | | // fprintf(stderr,"Denergy after=%e\n",delta_energy); |
| | | } |
| | | /* Vertices with spontaneous curvature may have spontaneous force perpendicular to the surface of the vesicle. additional delta energy is calculated in this function */ |
| | | delta_energy+=direct_force_energy(vesicle,vtx,backupvtx); |
| | | /* No poly-bond energy for now! |
| | | if(vtx->grafted_poly!=NULL){ |
| | | delta_energy+= |