From e5858ff1dcf5cecfcfe81602f52d255de9d508f4 Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@fe.uni-lj.si>
Date: Tue, 21 Jun 2016 10:49:57 +0000
Subject: [PATCH] Change in location of setting spontaneous curvature. Now it is done in initial_distribution.c, in function set_vesicle_values_from_tape. Also, energy assigning function is done and sweeping of the whole vesicle aswell.

---
 src/initial_distribution.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/initial_distribution.c b/src/initial_distribution.c
index 45a4124..0f04e5f 100644
--- a/src/initial_distribution.c
+++ b/src/initial_distribution.c
@@ -110,6 +110,21 @@
     else {
         vesicle->sphHarmonics=NULL;
     }
+
+	int rndvtx;
+	if(tape->number_of_vertices_with_c0>0){
+		ts_fprintf(stderr,"Setting values for spontaneous curvature as defined in tape\n");
+		for(i=0;i<tape->number_of_vertices_with_c0;i++){
+			rndvtx=rand() % vesicle->vlist->n;
+			vesicle->vlist->vtx[rndvtx]->c=tape->c0;
+		}
+		mean_curvature_and_energy(vesicle);
+		if(fabs(tape->w)>1e-16){ //if nonzero energy
+			ts_fprintf(stderr,"Setting attraction between vertices with spontaneous curvature\n");
+			sweep_attraction_bond_energy(vesicle);
+		}
+	}
+    
     return TS_SUCCESS;
 
 }

--
Gitblit v1.9.3