From d335d9af322ef4b32d22c0b25b6ff540a2febebf Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@gmail.com>
Date: Sat, 07 Dec 2013 21:29:57 +0000
Subject: [PATCH] Changes in ts_bond data structure, bond.c added assign_triangles functions that is called in initial_distribution for each bond.

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

diff --git a/src/initial_distribution.c b/src/initial_distribution.c
index f507d50..dde08a4 100644
--- a/src/initial_distribution.c
+++ b/src/initial_distribution.c
@@ -32,6 +32,7 @@
     retval = init_triangle_neighbours(vesicle);
     retval = init_common_vertex_triangle_neighbours(vesicle);
     retval = init_normal_vectors(vesicle->tlist);
+    retval = init_bond_triangles(vesicle->blist);
     retval = mean_curvature_and_energy(vesicle);
  ts_fprintf(stderr,"initial_distribution finished!\n");
 	if(retval);
@@ -382,3 +383,16 @@
 	}
 	return TS_SUCCESS;
 }
+
+ts_bool init_bond_triangles(ts_bond_list *blist){
+
+	ts_uint i;
+	ts_bool retval;
+	for(i=0;i<blist->n;i++){
+		retval=bond_assign_triangles(blist->bond[i]);
+		if(retval==TS_FAIL){
+			fatal("Bond %u does not have 2 triangles. Possible error in structure.",156);
+		}
+	}
+	return TS_SUCCESS;
+}

--
Gitblit v1.9.3