From 42641cde38cfd1d27a2031604cc1397b5bd2849b Mon Sep 17 00:00:00 2001 From: Samo Penic <samo.penic@gmail.com> Date: Fri, 21 Mar 2014 20:57:24 +0000 Subject: [PATCH] Merge with trout-rnc. --- src/poly.c | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/poly.c b/src/poly.c index aa41184..5cfc6e0 100644 --- a/src/poly.c +++ b/src/poly.c @@ -6,6 +6,17 @@ #include<math.h> #include"energy.h" +ts_bool poly_assign_filament_xi(ts_vesicle *vesicle, ts_tape *tape){ + ts_uint i; + + for(i=0;i<vesicle->filament_list->n;i++){ + vesicle->filament_list->poly[i]->k = tape->xi; + } + + return TS_SUCCESS; +} + + ts_bool poly_assign_spring_const(ts_vesicle *vesicle){ ts_uint i; @@ -97,14 +108,14 @@ else { /* Make filaments inside the vesicle. Helix with radius... Dist. between poly vertices put to 1*/ - dphi = 2*asin(1/2/vesicle->R_nucleus)*1.001; - dh = dphi/2/M_PI*1.001; + dphi = 2.0*asin(1.0/2.0/vesicle->R_nucleus)*1.001; + dh = dphi/2.0/M_PI*1.001; for(i=0;i<poly_list->n;i++){ for (j=0;j<poly_list->poly[i]->vlist->n;j++){ ji = j + i*poly_list->poly[i]->vlist->n; poly_list->poly[i]->vlist->vtx[j]->x = vesicle->R_nucleus*cos(ji*dphi); poly_list->poly[i]->vlist->vtx[j]->y = vesicle->R_nucleus*sin(ji*dphi); - poly_list->poly[i]->vlist->vtx[j]->z = ji*dh; + poly_list->poly[i]->vlist->vtx[j]->z = ji*dh - (dh*poly_list->n*poly_list->poly[i]->vlist->n/2.0); } } } -- Gitblit v1.9.3