From aede7e0121a037fd7226a8bfd558eb21a932fa5a Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@gmail.com>
Date: Wed, 14 Aug 2019 21:30:25 +0000
Subject: [PATCH] Added additional functions to ease Ulm2 poststating

---
 src/shcomplex.c |   19 +++++++++++++++++++
 src/shcomplex.h |    2 ++
 2 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/src/shcomplex.c b/src/shcomplex.c
index bd3a733..8492609 100644
--- a/src/shcomplex.c
+++ b/src/shcomplex.c
@@ -117,6 +117,25 @@
     return TS_SUCCESS;
 }
 
+char *Ulm2Complex2String(ts_vesicle *vesicle){
+	ts_int i,j;
+	char *strng=(char *)calloc(5000, sizeof(char));
+	for(i=0;i<vesicle->sphHarmonics->l;i++){
+    		for(j=i;j<2*i+1;j++){
+			sprintf(strng,"%e ", gsl_complex_abs2(vesicle->sphHarmonics->ulmComplex[i][j]));
+    		}
+	}
+	sprintf(strng,"\n");
+
+	return strng;
+}
+
+ts_bool freeUlm2String(char *strng){
+	free(strng);
+	return TS_SUCCESS;
+}
+
+
 ts_bool storeUlmComplex2(ts_vesicle *vesicle){
 
 	ts_spharm *sph=vesicle->sphHarmonics;
diff --git a/src/shcomplex.h b/src/shcomplex.h
index 63c6af5..9101572 100644
--- a/src/shcomplex.h
+++ b/src/shcomplex.h
@@ -6,5 +6,7 @@
 ts_spharm *complex_sph_init(ts_vertex_list *vlist, ts_uint l);
 ts_bool complex_sph_free(ts_spharm *sph);
 ts_bool calculateUlmComplex(ts_vesicle *vesicle);
+char *Ulm2Complex2String(ts_vesicle *vesicle);
+ts_bool freeUlm2String(char *strng);
 ts_double calculateKc(ts_vesicle *vesicle, ts_int lmin, ts_int lmax);
 #endif

--
Gitblit v1.9.3