| | |
| | | #include "timestep.h" |
| | | #include "cell.h" |
| | | //#include "io.h" |
| | | #include "io.h" |
| | | #include<stdio.h> |
| | | #include "vertexmove.h" |
| | | #include <string.h> |
| | |
| | | memcpy((void *)&backupvtx[i+1],(void *)vtx->neigh[i],sizeof(ts_vertex)); |
| | | } |
| | | |
| | | if(vesicle->pswitch == 1){ |
| | | if(vesicle->pswitch == 1 || vesicle->tape->constvolswitch == 1){ |
| | | for(i=0;i<vtx->tristar_no;i++) dvol-=vtx->tristar[i]->volume; |
| | | }; |
| | | |
| | |
| | | delta_energy+=vtx->neigh[i]->xk*(vtx->neigh[i]->energy-oenergy); |
| | | } |
| | | |
| | | if(vesicle->pswitch == 1){ |
| | | if(vesicle->pswitch == 1 || vesicle->tape->constvolswitch == 1){ |
| | | for(i=0;i<vtx->tristar_no;i++) dvol+=vtx->tristar[i]->volume; |
| | | delta_energy-=vesicle->pressure*dvol; |
| | | if(vesicle->pswitch == 1) delta_energy-=vesicle->pressure*dvol; |
| | | }; |
| | | |
| | | /* No poly-bond energy for now! |
| | |
| | | return TS_FAIL; |
| | | } |
| | | } |
| | | |
| | | //accepted |
| | | // oldcellidx=vertex_self_avoidance(vesicle, &backupvtx[0]); |
| | | if(vtx->cell!=vesicle->clist->cell[cellidx]){ |
| | | retval=cell_add_vertex(vesicle->clist->cell[cellidx],vtx); |
| | |
| | | if(retval==TS_SUCCESS) cell_remove_vertex(backupvtx[0].cell,vtx); |
| | | |
| | | } |
| | | |
| | | if(vesicle->tape->constvolswitch == 1); |
| | | // if(oldcellidx); |
| | | //END MONTE CARLOOOOOOO |
| | | return TS_SUCCESS; |
| | |
| | | cellidx=vertex_self_avoidance(vesicle, vtx); |
| | | //check occupation number |
| | | retval=cell_occupation_number_and_internal_proximity(vesicle->clist,cellidx,vtx); |
| | | |
| | | if(retval==TS_FAIL){ |
| | | vtx=memcpy((void *)vtx,(void *)&backupvtx,sizeof(ts_vertex)); |
| | | return TS_FAIL; |