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 |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/src/shcomplex.c b/src/shcomplex.c
index 7d8c9d8..8492609 100644
--- a/src/shcomplex.c
+++ b/src/shcomplex.c
@@ -1,3 +1,4 @@
+/* vim: set ts=4 sts=4 sw=4 noet : */
 #include<math.h>
 #include<stdlib.h>
 #include<gsl/gsl_complex.h>
@@ -68,7 +69,7 @@
     if(sph->co != NULL) free(sph->co);
     if(sph->ulm !=NULL) free(sph->ulm);
     if(sph->ulmComplex !=NULL) free(sph->ulmComplex);
-
+    if(sph->sumUlm2 !=NULL) free(sph->sumUlm2);
         if(sph->Ylmi!=NULL) {
             for(i=0;i<sph->l;i++){
                 if(sph->Ylmi[i]!=NULL){
@@ -116,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;

--
Gitblit v1.9.3