| | |
| | | ts_fprintf(stdout,"**** Restoring vesicle from VTK points list ****\n"); |
| | | ts_fprintf(stdout,"************************************************\n\n"); |
| | | vesicle = parseDump(command_line_args.dump_from_vtk); |
| | | // write_vertex_xml_file(vesicle,9999); // here you can test if restoration and rewritting results in the same dump file. Only the date od creation of dump file must differ. |
| | | tape = vesicle->tape; |
| | | int arguments_no; |
| | | FILE *fd=fopen(".status","r"); |
| | |
| | | |
| | | 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); |
| | |
| | | char *b; |
| | | int idx, polyidx; |
| | | char *token[2]; |
| | | int temp_cnt=0; |
| | | while (child != NULL) { |
| | | conname=xmlGetProp(child, (xmlChar *)"Name"); |
| | | if ((!xmlStrcmp(child->name, (const xmlChar *)"DataArray")) && !xmlStrcmp(conname, (const xmlChar *)"connectivity") ){ |
| | |
| | | while(token[0]!=NULL){ |
| | | if(idx<3*(vesicle->vlist->n-2)){ |
| | | bond_add(vesicle->blist, vesicle->vlist->vtx[atoi(token[0])], vesicle->vlist->vtx[atoi(token[1])]); |
| | | //fprintf(stderr,"Bonds in vesicle count idx=%d\n",idx); |
| | | } |
| | | else { |
| | | //find grafted vtx |
| | | if(vesicle->tape->npoly && vesicle->tape->nmono && (vesicle->tape->nmono-1)==(idx-3*(vesicle->vlist->n-2))%(vesicle->tape->nmono) |
| | | && idx<(3*vesicle->vlist->n-2+vesicle->tape->nmono*vesicle->tape->npoly+vesicle->tape->npoly)){ |
| | | && idx<(3*vesicle->vlist->n-2+vesicle->tape->nmono*vesicle->tape->npoly)){ |
| | | temp_cnt++; |
| | | //fprintf(stderr,"%d: Bonds in poly count idx=%d, t1=%s t2=%s\n",temp_cnt,idx, token[0], token[1]); |
| | | |
| | | polyidx=(idx-3*(vesicle->vlist->n-2))/(vesicle->tape->nmono); |
| | | //fprintf(stderr,"poly=%d, vertex=%d\n",polyidx,atoi(token[0])); |
| | | vesicle->poly_list->poly[polyidx]->grafted_vtx=vesicle->vlist->vtx[atoi(token[0])]; |