From f6bc99c334f6481e40f547d0e91f771b9564aa38 Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@fe.uni-lj.si>
Date: Tue, 05 Jul 2016 10:09:08 +0000
Subject: [PATCH] Merge branch 'clustercount' into nirgov

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

diff --git a/src/initial_distribution.c b/src/initial_distribution.c
index 0f04e5f..d8e917f 100644
--- a/src/initial_distribution.c
+++ b/src/initial_distribution.c
@@ -114,8 +114,17 @@
 	int rndvtx;
 	if(tape->number_of_vertices_with_c0>0){
 		ts_fprintf(stderr,"Setting values for spontaneous curvature as defined in tape\n");
+		j=0;
 		for(i=0;i<tape->number_of_vertices_with_c0;i++){
 			rndvtx=rand() % vesicle->vlist->n;
+			if(fabs(vesicle->vlist->vtx[rndvtx]->c-tape->c0)<1e-15){
+				j++;
+				i--;
+				if(j>10*vesicle->vlist->n){
+					fatal("cannot populate vesicle with vertices with spontaneous curvature. Too many spontaneous curvature vertices?",100);
+				}
+				continue;
+			}
 			vesicle->vlist->vtx[rndvtx]->c=tape->c0;
 		}
 		mean_curvature_and_energy(vesicle);

--
Gitblit v1.9.3