From d5d78a49c6b51fb1f6f0661d063034eaf65e02f7 Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@gmail.com>
Date: Wed, 25 Sep 2019 09:20:36 +0000
Subject: [PATCH] Constant volume and constant area fix. Removed spherical harmonics calculations in simulations. No ulm2.cvs and state.dat files are produced anymore

---
 src/tsmeasure.c |   49 ++++++++++++++++++++++++++++---------------------
 1 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/src/tsmeasure.c b/src/tsmeasure.c
index aa03aa1..beabc61 100644
--- a/src/tsmeasure.c
+++ b/src/tsmeasure.c
@@ -34,13 +34,15 @@
 }
 
 void vesicle_calculate_ulm2(ts_vesicle *vesicle){
-	vesicle->sphHarmonics=complex_sph_init(vesicle->vlist,21);
+	//complex_sph_free(vesicle->sphHarmonics);
+
+	//vesicle->sphHarmonics=complex_sph_init(vesicle->vlist,21);
 	vesicle_volume(vesicle);
 	preparationSh(vesicle,getR0(vesicle));
 	calculateUlmComplex(vesicle);
 	ts_int i,j;
 	for(i=0;i<vesicle->sphHarmonics->l;i++){
-    		for(j=0;j<2*i+1;j++){
+    		for(j=i;j<2*i+1;j++){
 			printf("%e ", gsl_complex_abs2(vesicle->sphHarmonics->ulmComplex[i][j]));
     		}
 	}
@@ -51,39 +53,44 @@
 int main(){
 	ts_vesicle *vesicle;
 	ts_char *i,*j;
-	ts_uint tstep;
+	ts_uint tstep,n;
     	ts_char *number;
+	struct dirent **list;
+	int count;
 	ts_fprintf(stdout,"TRISURF-NG v. %s, compiled on: %s %s.\n", TS_VERSION, __DATE__, __TIME__);
-	ts_fprintf(stdout,"Programming done by: Samo Penic and Miha Fosnaric\n");
-	ts_fprintf(stdout,"Released under terms of GPLv3\n");
-	ts_fprintf(stdout,"Starting program...\n\n");
-	DIR *dir = opendir(".");
-	if(dir){
+	count=scandir(".",&list,0,alphasort);
+	if(count<0){
+		fatal("Error, cannot open directory.",1);
+	}
+        tstep=0;
+	for(n=0;n<count;n++){
 		struct dirent *ent;
-        	tstep=0;
-		while((ent = readdir(dir)) != NULL)
-		{
+		ent=list[n];	
             	i=rindex(ent->d_name,'.');
-            	if(i==NULL) continue;
+            	if(i==NULL) {
+				continue;
+		}
             	if(strcmp(i+1,"vtu")==0){
                     j=rindex(ent->d_name,'_');
                     if(j==NULL) continue;
                     number=strndup(j+1,j-i); 
 			quiet=1;
                     ts_fprintf(stdout,"timestep: %u filename: %s\n",atoi(number),ent->d_name);
+			printf("%u ",atoi(number));
 			vesicle=restoreVesicle(ent->d_name);
 			vesicle_calculate_ulm2(vesicle);
                     	tstep++;
-			//vesicle_free(vesicle);
                     free(number);
-            	}  
+			tape_free(vesicle->tape);
+			vesicle_free(vesicle);
+            	}
 		}
-	}
-	free(dir);
-
-
-
-
-return 0;
+	for (n = 0; n < count; n++)
+  	{
+  		free(list[n]);
+  	}
+	
+	free(list);
+	return 0;
 }
 

--
Gitblit v1.9.3