From 9bf6ee3e299ae9d5627c15814bfad56bf47e9917 Mon Sep 17 00:00:00 2001 From: Samo Penic <samo.penic@gmail.com> Date: Thu, 07 Jun 2012 21:08:30 +0000 Subject: [PATCH] preparationSh seems to work ok -- but it was not debugged. calculateYlmi does not work --- src/sh.h | 4 +++- src/vesicle.h | 2 +- src/co_test.c | 11 +++++++++-- src/sh.c | 2 ++ 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/co_test.c b/src/co_test.c index 3b5c69d..93d5b41 100644 --- a/src/co_test.c +++ b/src/co_test.c @@ -2,6 +2,7 @@ #include "sh.h" #include "vesicle.h" #include "initial_distribution.h" +#include <math.h> int main(){ ts_vesicle *vesicle=initial_distribution_dipyramid(4,60,60,60,0.15); @@ -21,9 +22,15 @@ fprintf(stderr,"co(%d,%d)=%e\n",i,j,vesicle->sphHarmonics->co[i][j]); } } - +ts_double r0; +vesicle_volume(vesicle); +fprintf(stderr,"Volume=%e\n",vesicle->volume); +r0=getR0(vesicle); +fprintf(stderr,"r0=%e\n",r0); +preparationSh(vesicle,r0); +calculateYlmi(vesicle); sph_free(vesicle->sphHarmonics); -//vesicle_free(vesicle); +vesicle_free(vesicle); return 0; } diff --git a/src/sh.c b/src/sh.c index 12a6ce4..27b67aa 100644 --- a/src/sh.c +++ b/src/sh.c @@ -120,7 +120,9 @@ } +/** @brief: Precomputes coefficients that are required for spherical harmonics computations. +*/ ts_bool precomputeShCoeff(ts_spharm *sph){ ts_int i,j,al,am; ts_double **co=sph->co; diff --git a/src/sh.h b/src/sh.h index 5b8a10c..5ce02c1 100644 --- a/src/sh.h +++ b/src/sh.h @@ -9,5 +9,7 @@ ts_bool precomputeShCoeff(ts_spharm *sph); ts_spharm *sph_init(ts_vertex_list *vlist, ts_uint l); ts_bool sph_free(ts_spharm *sph); - +ts_double getR0(ts_vesicle *vesicle); +ts_bool preparationSh(ts_vesicle *vesicle, ts_double r0); +ts_bool calculateYlmi(ts_vesicle *vesicle); #endif diff --git a/src/vesicle.h b/src/vesicle.h index aa7de50..2992491 100644 --- a/src/vesicle.h +++ b/src/vesicle.h @@ -4,6 +4,6 @@ ts_vesicle *init_vesicle(ts_uint N, ts_uint ncmax1, ts_uint ncmax2, ts_uint ncmax3, ts_double stepsize); ts_bool vesicle_translate(ts_vesicle *vesicle,ts_double x, ts_double y, ts_double z); ts_bool vesicle_free(ts_vesicle *vesicle); - +ts_bool vesicle_volume(ts_vesicle *vesicle); #endif -- Gitblit v1.9.3