| | |
| | | |
| | | if (vlist!=NULL){ |
| | | /* Make straight grafted poylmers normal to membrane (polymer brush). Dist. between poly vertices put to 1*/ |
| | | ts_int intpoly=vesicle->tape->internal_poly; |
| | | for (i=0;i<poly_list->n;i++){ |
| | | |
| | | xnorm=0.0; |
| | |
| | | znorm-=poly_list->poly[i]->grafted_vtx->tristar[j]->znorm; |
| | | } |
| | | normlength=sqrt(xnorm*xnorm+ynorm*ynorm+znorm*znorm); |
| | | if(intpoly && i%2){ |
| | | normlength=-normlength; |
| | | } |
| | | xnorm=xnorm/normlength; |
| | | ynorm=ynorm/normlength; |
| | | znorm=znorm/normlength; |
| | |
| | | |
| | | ts_bool poly_free(ts_poly *poly){ |
| | | |
| | | if (poly->grafted_vtx!=NULL){ |
| | | poly->grafted_vtx->grafted_poly=NULL; |
| | | } |
| | | // if (poly->grafted_vtx!=NULL){ |
| | | // poly->grafted_vtx->grafted_poly=NULL; |
| | | // } |
| | | vtx_list_free(poly->vlist); |
| | | bond_list_free(poly->blist); |
| | | free(poly); |
| | |
| | | |
| | | ts_bool poly_list_free(ts_poly_list *poly_list){ |
| | | ts_uint i; |
| | | |
| | | //fprintf(stderr,"no. of polys=%d\n", poly_list->n); |
| | | for(i=0;i<poly_list->n;i++){ |
| | | // fprintf(stderr,"%d poly address in mem=%ld\n",i+1,(long)&(poly_list->poly[i])); |
| | | poly_free(poly_list->poly[i]); |
| | | } |
| | | free(poly_list->poly); |