From 4019ca8157136a68b6e43b31f166dc93acd81b4d Mon Sep 17 00:00:00 2001 From: Samo Penic <samo.penic@gmail.com> Date: Fri, 08 Feb 2019 08:14:57 +0000 Subject: [PATCH] Merge branch 'stretching-devel' into plane-new --- src/bondflip.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/src/bondflip.c b/src/bondflip.c index 66c40f7..13ec263 100644 --- a/src/bondflip.c +++ b/src/bondflip.c @@ -176,7 +176,6 @@ /* vesicle_volume(vesicle); fprintf(stderr,"Volume in the beginning=%1.16e\n", vesicle->volume); */ - /* fix data structure for flipped bond */ ts_flip_bond(k,it,km,kp, bond,lm, lp, lm2, lp1, vesicle->tape->w); @@ -189,6 +188,12 @@ delta_energy+=it->xk* it->energy; delta_energy+=bond->energy; /* attraction with neighboring vertices, that have spontaneous curvature */ //Neigbours of k, it, km, kp don't change its energy. + if(vesicle->tape->stretchswitch==1){ + oldenergy+=lm->energy+lp->energy; + stretchenergy(vesicle,lm); + stretchenergy(vesicle,lp); + delta_energy+=lm->energy+lp->energy; + } delta_energy-=oldenergy; if(vesicle->pswitch == 1 || vesicle->tape->constvolswitch>0){ @@ -334,6 +339,10 @@ // fprintf(stderr,"Restoration complete!!!\n"); // vesicle_volume(vesicle); // fprintf(stderr,"Volume after fail=%1.16e\n", vesicle->volume); + if(vesicle->tape->stretchswitch==1){ + stretchenergy(vesicle,lm); + stretchenergy(vesicle,lp); + } return TS_FAIL; } -- Gitblit v1.9.3