Trisurf Monte Carlo simulator
Samo Penic
2014-12-16 fda1ab6babed79842534b3a21a6ee96bc26f9d93
src/timestep.c
@@ -11,6 +11,7 @@
#include "stats.h"
#include "sh.h"
#include "shcomplex.h"
#include "shreal.h"
#include "vesicle.h"
#include<gsl/gsl_complex.h>
#include<gsl/gsl_complex_math.h>
@@ -21,6 +22,7 @@
   ts_double r0,kc1,kc2,kc3,kc4;
   ts_double l1,l2,l3,vmsr,bfsr, vmsrt, bfsrt;
   ts_ulong epochtime;
    ts_double diff;
   FILE *fd1,*fd2=NULL;
    char filename[10000];
    strcpy(filename,command_line_args.path);
@@ -88,7 +90,10 @@
             //calculateYlmi(vesicle);
             calculateUlmComplex(vesicle);
             storeUlmComplex2(vesicle);
             saveAvgUlm2(vesicle);
             saveAvgUlm2Complex(vesicle);
                calculateUlmReal(vesicle);
                storeUlm2Real(vesicle);
                saveAvgUlm2Real(vesicle);
                kc1=calculateKc(vesicle, 2,9);
                kc2=calculateKc(vesicle, 6,9);
                kc3=calculateKc(vesicle, 2,vesicle->sphHarmonics->l);
@@ -112,9 +117,16 @@
         for(l=0;l<vesicle->sphHarmonics->l;l++){
            for(m=l;m<2*l+1;m++){
               fprintf(fd2,"%e ", gsl_complex_abs2(vesicle->sphHarmonics->ulmComplex[l][m]) );
                   if(l<5) {
                         if(m==l) diff=  gsl_complex_abs2(vesicle->sphHarmonics->ulmComplex[l][m])-pow(vesicle->sphHarmonics->ulmReal[l][m],2);
                         else     diff=  gsl_complex_abs2(vesicle->sphHarmonics->ulmComplex[l][m])-(pow(vesicle->sphHarmonics->ulmReal[l][m],2)+pow(vesicle->sphHarmonics->ulmReal[l][2*l-m],2))/2.0;
                        fprintf(stderr,"%e ", diff/gsl_complex_abs2(vesicle->sphHarmonics->ulmComplex[l][m]) );
                    }
            }
                if(l<5) fprintf(stderr,"\n");
         }
            fprintf(fd2,"\n");
            fprintf(stderr,"---\n");
   
             fflush(fd2);