Trisurf Monte Carlo simulator
Samo Penic
2016-02-29 ecdd71929b38a504e2b0ae1a9c105a5e1ac28e4a
Dump and restore seems equal to original in paraview.
1 files modified
13 ■■■■■ changed files
src/restore.c 13 ●●●●● patch | view | raw | blame | history
src/restore.c
@@ -273,13 +273,15 @@
            points = xmlNodeListGetString(doc, child->xmlChildrenNode, 1);
            pts=(char *)points;
            token[0]=strtok(pts," ");
            for(i=1;i<3;i++)    token[i]=strtok(NULL," ");
            token[1]=strtok(NULL," ");
            token[2]=strtok(NULL,"\n");
            idx=0;
            while(token[0]!=NULL){
                vesicle->vlist->vtx[idx]->x=atof(token[0]);
                vesicle->vlist->vtx[idx]->y=atof(token[1]);
                vesicle->vlist->vtx[idx]->z=atof(token[2]);
                for(i=0;i<3;i++)    token[i]=strtok(NULL," ");
                for(i=0;i<2;i++)    token[i]=strtok(NULL," ");
                token[2]=strtok(NULL,"\n");
                idx++;
            }
            xmlFree(points);
@@ -294,18 +296,19 @@
    xmlNodePtr child = cur->xmlChildrenNode;
    xmlChar *bonds;
    char *b;
    int i, idx;
    int idx;
    char *token[2];
    while (child != NULL) {
        if ((!xmlStrcmp(child->name, (const xmlChar *)"DataArray")) && !xmlStrcmp(xmlGetProp(child, (xmlChar *)"Name"), (const xmlChar *)"connectivity") ){
            bonds = xmlNodeListGetString(doc, child->xmlChildrenNode, 1);
            b=(char *)bonds;
            token[0]=strtok(b," ");
            token[1]=strtok(NULL," ");
            token[1]=strtok(NULL,"\n");
            idx=0;
            while(token[0]!=NULL){
                bond_add(vesicle->blist, vesicle->vlist->vtx[atoi(token[0])], vesicle->vlist->vtx[atoi(token[1])]);
                for(i=0;i<2;i++)    token[i]=strtok(NULL," ");
                token[0]=strtok(NULL," ");
                token[1]=strtok(NULL,"\n");
                idx++;
            }
            xmlFree(bonds);