From 4891eb093f61d37056c50c572e669349dd49a65a Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@gmail.com>
Date: Tue, 31 May 2016 19:33:33 +0000
Subject: [PATCH] Nucleus translates with the vesicle. Dump and restore includes optional <nucleus> tag within <trisurf> tag if the nucleus is present at all.

---
 src/snapshot.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/snapshot.c b/src/snapshot.c
index cabb1f8..8b71e83 100644
--- a/src/snapshot.c
+++ b/src/snapshot.c
@@ -32,6 +32,7 @@
 	xml_trisurf_tria_neigh(data,vesicle->tlist);
 	xml_trisurf_vtx_neigh(data,vesicle->vlist);	
 	xml_trisurf_vtx_tristar(data,vesicle->vlist);
+	xml_trisurf_nucleus(data,vesicle);
 #ifdef COMPRESSION
 	char *compressed;
 	ts_uint nbytes=ts_compress_string64(data->string, data->beg-1, &compressed); //suppress null character at the end with by substracting 1
@@ -124,7 +125,12 @@
 	return TS_SUCCESS;
 }
 
-
+ts_bool xml_trisurf_nucleus(ts_string *data, ts_vesicle* vesicle){
+	if(vesicle->R_nucleus>0.0 || (vesicle->R_nucleusX>0.0 && vesicle->R_nucleusY>0.0 && vesicle->R_nucleusZ>0.0)){
+		ts_sprintf(data,"<nucleus>%.17e %.17e %.7e</nucleus>",vesicle->nucleus_center[0], vesicle->nucleus_center[1], vesicle->nucleus_center[2]);
+	}
+	return TS_SUCCESS;
+}
 
 
 /* UTILITIES */

--
Gitblit v1.9.3