Trisurf Monte Carlo simulator
Samo Penic
2019-10-19 4ca00dc38c72f67dc714fbb45b3006afec097c9c
commit | author | age
7f6076 1 /* vim: set ts=4 sts=4 sw=4 noet : */
8c1bb1 2 #include <stdio.h>
SP 3 #include <string.h>
4 #include <stdlib.h>
5 #include <libxml/xmlmemory.h>
6 #include <libxml/parser.h>
7 #include <general.h>
8 #include <restore.h>
9 #include <snapshot.h>
10 #include <zlib.h>
11 #include "vesicle.h"
487968 12 #include "vertex.h"
a011d2 13 #include "triangle.h"
a3dbf0 14 #include "bond.h"
SP 15 #include "energy.h"
bb4033 16 #include "poly.h"
a3dbf0 17 #include "initial_distribution.h"
698ae1 18 #include "io.h"
002513 19 #include <math.h>
a011d2 20
ab798b 21 ts_vesicle *parseDump(char *dumpfname) {
8c1bb1 22     xmlDocPtr doc;
8fa1c0 23     xmlNodePtr cur, cur1,cur2;
SP 24     ts_vesicle *vesicle=NULL;
8c1bb1 25     doc = xmlParseFile(dumpfname);
002513 26     int i;
8c1bb1 27     if (doc == NULL ) {
SP 28         fatal("Dump file could not be found or parsed. It is correct file?",1);
29     }
30     
31     cur = xmlDocGetRootElement(doc);
32     
33     if (cur == NULL) {
34         fatal("Dump file is empty.",1);
35     }
36     
37     if (xmlStrcmp(cur->name, (const xmlChar *) "VTKFile")) {
38         fatal("document of the wrong type, root node != story",1);
39     }
40     
41     cur = cur->xmlChildrenNode;
42     while (cur != NULL) {
698ae1 43
SP 44         if ((!xmlStrcmp(cur->name, (const xmlChar *)"tape"))){
45             setGlobalTapeTXTfromTapeTag(doc, cur);
46         }
47
8c1bb1 48         if ((!xmlStrcmp(cur->name, (const xmlChar *)"trisurf"))){
3c772b 49             vesicle=parseTrisurfTag(doc, cur);
8c1bb1 50         }
8fa1c0 51         // START Point Position data &  Bonds
SP 52         if ((!xmlStrcmp(cur->name, (const xmlChar *)"UnstructuredGrid"))){
53             cur1 = cur->xmlChildrenNode;
54             while(cur1!=NULL){
55                 if ((!xmlStrcmp(cur1->name, (const xmlChar *)"Piece"))){
56                     cur2=cur1->xmlChildrenNode;
57                     while(cur2!=NULL){
def8b5 58                         if ((!xmlStrcmp(cur2->name, (const xmlChar *)"PointData"))){
SP 59                             if(vesicle!=NULL)
60                                 parseXMLPointData(vesicle,doc,cur2);
61                         }
8fa1c0 62                         if ((!xmlStrcmp(cur2->name, (const xmlChar *)"Points"))){
720bd4 63                             //fprintf(stderr,"Found point data\n");
8fa1c0 64                             if(vesicle!=NULL)
f62178 65                                 //fprintf(stderr,"Fils: %ld, Nfono: %ld\n", vesicle->tape->nfil, vesicle->tape->nfono);
28efdb 66                                 parseXMLVertexPosition(vesicle, doc, cur2);
8fa1c0 67                         }
SP 68                         if ((!xmlStrcmp(cur2->name, (const xmlChar *)"Cells"))){
720bd4 69                         //fprintf(stderr,"Found cell(Bonds) data\n");
a3dbf0 70                             if(vesicle!=NULL)
28efdb 71                                 parseXMLBonds(vesicle, doc, cur2);
8fa1c0 72                         }
SP 73                         cur2=cur2->next;
74                     }    
75                 }
76                 cur1 = cur1->next;
77             }
78         }
79         // END Point Position data & Bonds
8c1bb1 80     cur = cur->next;
SP 81     }
82     xmlFreeDoc(doc);
bb4033 83
86b69b 84 //    vesicle->poly_list=init_poly_list(0, 0, vesicle->vlist, vesicle);
d43116 85     set_vesicle_values_from_tape(vesicle);
a3dbf0 86     init_normal_vectors(vesicle->tlist);
SP 87     mean_curvature_and_energy(vesicle);
89434d 88     sweep_attraction_bond_energy(vesicle);
002513 89     if(vesicle->tape->stretchswitch==1){
699ac4 90         vesicle->tlist->a0=sqrt(3)/4.0*pow((vesicle->tape->dmax+1.0)/2.0,2);  
002513 91         for(i=0;i<vesicle->tlist->n;i++){
SP 92             stretchenergy(vesicle, vesicle->tlist->tria[i]);
93         }
94     }
ab798b 95 /* TODO: filaments */
a3dbf0 96
f4d6ca 97 //    ts_fprintf(stdout,"Restoration completed\n");
ab798b 98 //    write_vertex_xml_file(vesicle,999);
SP 99 //    vesicle_free(vesicle);
100 //    exit(0);
101     return vesicle;
8c1bb1 102 }
SP 103
698ae1 104 ts_bool setGlobalTapeTXTfromTapeTag(xmlDocPtr doc, xmlNodePtr cur){
SP 105     xmlChar *tape = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
106     strcpy(tapetxt,(char *)tape);
107     xmlFree(tape);
108     return TS_SUCCESS;
109 }
8fa1c0 110
SP 111
112 /* this is a parser of additional data in xml */
8c1bb1 113 ts_vesicle *parseTrisurfTag(xmlDocPtr doc, xmlNodePtr cur){
720bd4 114     //fprintf(stderr,"Parsing trisurf tag\n");
487968 115     xmlNodePtr child;
SP 116
117 #ifdef COMPRESS
8c1bb1 118     /* base64decode */
SP 119     size_t cLen;
120     /*size_t tLen;
121     const unsigned char test[]="Test";
122     char *cTest=base64_encode(test, 4,&tLen);
123     unsigned char *cuTest=base64_decode((char *)cTest,tLen,&tLen);
124     cuTest[tLen]=0;
125     fprintf(stderr,"%s\n",cuTest);
126     */
127     xmlChar *b64=xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
128     unsigned char *compressed=base64_decode((char *)b64,strlen((char *)b64)-1,&cLen);
129     /* uncompress */
130     unsigned char *subtree=(unsigned char *)malloc(512000*sizeof(unsigned char)); /* TODO: again, the uncompressed string must not exceed this */
131     z_stream infstream;
132     infstream.zalloc = Z_NULL;
133     infstream.zfree = Z_NULL;
134     infstream.opaque = Z_NULL;
135     infstream.avail_in = (ts_uint)cLen; // size of input
136         infstream.next_in = compressed; // input char array
137         infstream.avail_out = (ts_uint)512000; // size of output
138         infstream.next_out = subtree; // output char array
139      
140         // the actual DE-compression work.
141         inflateInit(&infstream);
142         inflate(&infstream, Z_NO_FLUSH);
143         inflateEnd(&infstream);    
720bd4 144     //fprintf(stderr,"%lu\n",cLen);
8c1bb1 145     subtree[infstream.total_out]='\0'; //zero terminate string    
720bd4 146     //fprintf(stderr,"%s\n",subtree);
8c1bb1 147     
SP 148     free(subtree);
487968 149 #endif
8c1bb1 150     /*parse xml subtree */
86b69b 151     xmlChar *nvtx, *npoly, *nmono;
8c1bb1 152     nvtx = xmlGetProp(cur, (xmlChar *)"nvtx");
SP 153     npoly=xmlGetProp(cur, (xmlChar *)"npoly");
86b69b 154     nmono=xmlGetProp(cur, (xmlChar *)"nmono");
698ae1 155     ts_tape *tape=parsetapebuffer(tapetxt);
SP 156     //fprintf(stderr,"nvtx=%u\n",atoi((char *)nvtx));
157     //TODO: check if nvtx is in agreement with nshell from tape
158     ts_vesicle *vesicle=init_vesicle(atoi((char *)nvtx),tape->ncxmax,tape->ncymax,tape->nczmax,tape->stepsize);
d43116 159 //    vesicle->poly_list=init_poly_list(atoi((char *)npoly),atoi((char *)nmono), vesicle->vlist, vesicle);
SP 160     vesicle->poly_list=init_empty_poly_list(atoi((char *)npoly),atoi((char *)nmono));
8c1bb1 161     xmlFree(nvtx);
SP 162     xmlFree(npoly);
86b69b 163     xmlFree(nmono);
487968 164
SP 165     child = cur->xmlChildrenNode;
166     while (child != NULL) {
167         if ((!xmlStrcmp(child->name, (const xmlChar *)"vtxn"))){
168             parseTrisurfVtxn(vesicle->vlist, doc, child);
169         }
a011d2 170         if ((!xmlStrcmp(child->name, (const xmlChar *)"tria"))){
SP 171             parseTrisurfTria(vesicle, doc, child);
172         }
e9ac7b 173         if ((!xmlStrcmp(child->name, (const xmlChar *)"trianeigh"))){
SP 174             parseTrisurfTriaNeigh(vesicle, doc, child);
175         }
a011d2 176          if ((!xmlStrcmp(child->name, (const xmlChar *)"tristar"))){
SP 177             parseTrisurfTristar(vesicle, doc, child);
178         }
4891eb 179          if ((!xmlStrcmp(child->name, (const xmlChar *)"nucleus"))){
SP 180             parseTrisurfNucleus(vesicle, doc, child);
181         }
49981c 182           if ((!xmlStrcmp(child->name, (const xmlChar *)"constant_volume"))){
SP 183             parseTrisurfConstantVolume(doc, child);
184         }
185           if ((!xmlStrcmp(child->name, (const xmlChar *)"constant_area"))){
186             parseTrisurfConstantArea(doc, child);
187         }
188
a011d2 189
487968 190     child = child->next;
SP 191     }
192
698ae1 193     vesicle->tape=tape;
d43116 194 //    set_vesicle_values_from_tape(vesicle);
8c1bb1 195     return vesicle;
SP 196 }
487968 197
a011d2 198
SP 199
200 /* Low level tags parsers */
49981c 201 ts_bool parseTrisurfConstantVolume(xmlDocPtr doc, xmlNodePtr cur){
SP 202     xmlChar *cvol = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
203     char *n=(char *)cvol;
204     V0=atof(n);
205     xmlFree(cvol);
206     return TS_SUCCESS;
207 }
208 ts_bool parseTrisurfConstantArea(xmlDocPtr doc, xmlNodePtr cur){
209     xmlChar *carea = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
210     char *n=(char *)carea;
211     A0=atof(n);
212     xmlFree(carea);
213     return TS_SUCCESS;
214 }
215
4891eb 216 ts_bool parseTrisurfNucleus(ts_vesicle *vesicle, xmlDocPtr doc, xmlNodePtr cur){
SP 217     xmlChar *coords = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
218     char *n=(char *)coords;
219     char *token=strtok(n," ");
220     ts_uint i;
221     for(i=0;i<3;i++){
222         vesicle->nucleus_center[i]=atof(token);
223         token=strtok(NULL," ");
224     }
225     xmlFree(coords);
226     return TS_SUCCESS;
227 }
a011d2 228
SP 229 ts_bool parseTrisurfVtxn(ts_vertex_list *vlist, xmlDocPtr doc, xmlNodePtr cur){
487968 230
SP 231     xmlChar *chari;
232     xmlChar *neighs;
233     char *n;
234     char *token;
235     ts_uint neighi;
236     ts_uint i;
237     chari = xmlGetProp(cur, (xmlChar *)"idx");
238     i=atoi((char *)chari);
239     xmlFree(chari);
240     ts_vertex *vtx=vlist->vtx[i];
241     neighs = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
242     //fprintf(stderr,"Found neigh for vtx %u that seems to have index %u with neighs=%s\n",i,vtx->idx,neighs);
243
244     n=(char *)neighs;
245     token=strtok(n," ");
246     while(token!=NULL){
247         neighi=atoi(token);
248         //fprintf(stderr,"%u", neighi);
249         vtx_add_neighbour(vtx,vlist->vtx[neighi]);
250         token=strtok(NULL," ");
251     }    
252     xmlFree(neighs);
253     return TS_SUCCESS;
254 }
255
a011d2 256 ts_bool parseTrisurfTria(ts_vesicle *vesicle, xmlDocPtr doc, xmlNodePtr cur){
SP 257     xmlChar *triangles;
258     char *tria;
259     char *vtx[3];
260     
e87e4e 261     ts_uint i,j;
a011d2 262     triangles = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
SP 263     tria=(char *)triangles;
e87e4e 264     vtx[0]=strtok(tria," ");
SP 265     for(i=1;i<3;i++)    vtx[i]=strtok(NULL," ");
266     j=0;
a011d2 267     while(vtx[2]!=NULL){
SP 268         triangle_add(vesicle->tlist, vesicle->vlist->vtx[atoi(vtx[0])],vesicle->vlist->vtx[atoi(vtx[1])],vesicle->vlist->vtx[atoi(vtx[2])]);
269         for(i=0;i<3;i++)    vtx[i]=strtok(NULL," ");
e87e4e 270         j++;
a011d2 271     }    
720bd4 272     //fprintf(stderr,"Parsing triangles %s j=%d\n",triangles,j);    
a011d2 273
SP 274     xmlFree(triangles);
275     return TS_SUCCESS;
276 }
277
278
e9ac7b 279 ts_bool parseTrisurfTriaNeigh(ts_vesicle *vesicle, xmlDocPtr doc, xmlNodePtr cur){
SP 280     xmlChar *triangles;
281     char *tria;
282     char *ntria[3];
283     ts_uint i,j;
284     triangles = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
285     tria=(char *)triangles;
e87e4e 286     ntria[0]=strtok(tria," ");
SP 287     for(i=1;i<3;i++)    ntria[i]=strtok(NULL," ");
e9ac7b 288     j=0;
SP 289     while(ntria[2]!=NULL){
290         triangle_add_neighbour(vesicle->tlist->tria[j],vesicle->tlist->tria[atoi(ntria[0])]);
291         triangle_add_neighbour(vesicle->tlist->tria[j],vesicle->tlist->tria[atoi(ntria[1])]);
292         triangle_add_neighbour(vesicle->tlist->tria[j],vesicle->tlist->tria[atoi(ntria[2])]);
293         j++;
294         for(i=0;i<3;i++)    ntria[i]=strtok(NULL," ");
295     }    
720bd4 296     //fprintf(stderr,"Parsing triangle neighbors j=%d\n",j);    
e9ac7b 297
SP 298     xmlFree(triangles);
299     return TS_SUCCESS;
300 }
301
302
a011d2 303 ts_bool parseTrisurfTristar(ts_vesicle *vesicle, xmlDocPtr doc, xmlNodePtr cur){
SP 304
305     xmlChar *chari;
306     xmlChar *tristar;
307     char *t;
308     char *token;
309     ts_uint neighi;
310     ts_uint i;
311     chari = xmlGetProp(cur, (xmlChar *)"idx");
312     i=atoi((char *)chari);
313     xmlFree(chari);
314     ts_vertex *vtx=vesicle->vlist->vtx[i];
315     tristar = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1);
316 //    fprintf(stderr,"Found tristar for vtx %u that seems to have index %u with tristar=%s\n",i,vtx->idx,tristar);
317
318     t=(char *)tristar;
319     token=strtok(t," ");
320     while(token!=NULL){
321         neighi=atoi(token);
322         //fprintf(stderr,"%u", neighi);
323         vertex_add_tristar(vtx,vesicle->tlist->tria[neighi]);
324         token=strtok(NULL," ");
325     }    
326     xmlFree(tristar);
327     return TS_SUCCESS;
328 }
329
def8b5 330 /* this parses the data for vertices (like spontaneous curvature, etc.) */
SP 331 ts_bool parseXMLPointData(ts_vesicle *vesicle,xmlDocPtr doc, xmlNodePtr cur){
332     xmlNodePtr child = cur->xmlChildrenNode;
333     xmlChar *property_name;
334     xmlChar *values;
335     char *vals;
336     char *token;
337     int idx, polyidx, monoidx, filidx, fonoidx;
338     while (child != NULL) {
339         if ((!xmlStrcmp(child->name, (const xmlChar *)"DataArray"))){
340             property_name=xmlGetProp(child, (xmlChar *)"Name");
341         //    fprintf(stderr,"Name: %s\n", property_name);
342             if(!xmlStrcmp(property_name,(const xmlChar *)"spontaneous_curvature")){
343                 values=xmlNodeListGetString(doc,child->xmlChildrenNode,1);
344                 vals=(char *)values;
345                 token=strtok(vals," ");
346                 idx=0;
347                 while(token!=NULL){
348                     if(idx<vesicle->vlist->n){
349                         vesicle->vlist->vtx[idx]->c=atof(token);
350                     } else if(vesicle->tape->nmono && vesicle->tape->npoly && idx<vesicle->vlist->n+vesicle->tape->nmono*vesicle->tape->npoly) {
351                         polyidx=(idx-vesicle->vlist->n)/vesicle->tape->nmono;
352                         monoidx=(idx-vesicle->vlist->n)%vesicle->tape->nmono;
353                         vesicle->poly_list->poly[polyidx]->vlist->vtx[monoidx]->c=atof(token);
354                     } else {
355                         filidx=(idx-vesicle->vlist->n-vesicle->tape->nmono*vesicle->tape->npoly)/vesicle->tape->nfono;
356                         fonoidx=(idx-vesicle->vlist->n-vesicle->tape->nmono*vesicle->tape->npoly)%vesicle->tape->nfono;
357                         //fprintf(stderr,"filidx=%d, fonoidx=%d, coord=%s,%s,%s\n",filidx,fonoidx,token[0],token[1],token[2]);
358                         vesicle->filament_list->poly[filidx]->vlist->vtx[fonoidx]->c=atof(token);
359                     }
360                     idx++;
361                     token=strtok(NULL," ");
362                 }
363                 xmlFree(values);        
364             }
365             xmlFree(property_name);
366         }
367         
368         child=child->next;
369     }
370     return TS_SUCCESS;
371 }
8fa1c0 372 /* this is a parser of vertex positions and bonds from main xml data */
SP 373 ts_bool parseXMLVertexPosition(ts_vesicle *vesicle,xmlDocPtr doc, xmlNodePtr cur){
374     xmlNodePtr child = cur->xmlChildrenNode;
375     xmlChar *points;
376     char *pts;
301c87 377     int i, idx, polyidx, monoidx, filidx, fonoidx;
8fa1c0 378     char *token[3];
SP 379     while (child != NULL) {
380         if ((!xmlStrcmp(child->name, (const xmlChar *)"DataArray"))){
381             points = xmlNodeListGetString(doc, child->xmlChildrenNode, 1);
382             pts=(char *)points;
e87e4e 383             token[0]=strtok(pts," ");
ecdd71 384             token[1]=strtok(NULL," ");
SP 385             token[2]=strtok(NULL,"\n");
8fa1c0 386             idx=0;
SP 387             while(token[0]!=NULL){
86b69b 388                 if(idx<vesicle->vlist->n){
SP 389                     vesicle->vlist->vtx[idx]->x=atof(token[0]);
390                     vesicle->vlist->vtx[idx]->y=atof(token[1]);
391                     vesicle->vlist->vtx[idx]->z=atof(token[2]);
301c87 392                 } else if(vesicle->tape->nmono && vesicle->tape->npoly && idx<vesicle->vlist->n+vesicle->tape->nmono*vesicle->tape->npoly) {
86b69b 393                     polyidx=(idx-vesicle->vlist->n)/vesicle->tape->nmono;
SP 394                     monoidx=(idx-vesicle->vlist->n)%vesicle->tape->nmono;
395                     vesicle->poly_list->poly[polyidx]->vlist->vtx[monoidx]->x=atof(token[0]);
396                     vesicle->poly_list->poly[polyidx]->vlist->vtx[monoidx]->y=atof(token[1]);
397                     vesicle->poly_list->poly[polyidx]->vlist->vtx[monoidx]->z=atof(token[2]);
301c87 398                 } else {
SP 399                     filidx=(idx-vesicle->vlist->n-vesicle->tape->nmono*vesicle->tape->npoly)/vesicle->tape->nfono;
400                     fonoidx=(idx-vesicle->vlist->n-vesicle->tape->nmono*vesicle->tape->npoly)%vesicle->tape->nfono;
f62178 401                     //fprintf(stderr,"filidx=%d, fonoidx=%d, coord=%s,%s,%s\n",filidx,fonoidx,token[0],token[1],token[2]);
301c87 402                     vesicle->filament_list->poly[filidx]->vlist->vtx[fonoidx]->x=atof(token[0]);
SP 403                     vesicle->filament_list->poly[filidx]->vlist->vtx[fonoidx]->y=atof(token[1]);
404                     vesicle->filament_list->poly[filidx]->vlist->vtx[fonoidx]->z=atof(token[2]);
86b69b 405                 }
ecdd71 406                 for(i=0;i<2;i++)    token[i]=strtok(NULL," ");    
SP 407                 token[2]=strtok(NULL,"\n");
8fa1c0 408                 idx++;
SP 409             }
410             xmlFree(points);
411         }
412         child=child->next;
413     }
f62178 414     //fprintf(stderr,"Came here\n");
720bd4 415     //fprintf(stderr,"Vertices position j=%d\n",idx);    
28efdb 416
8fa1c0 417     return TS_SUCCESS;
SP 418 }
a3dbf0 419 ts_bool parseXMLBonds(ts_vesicle *vesicle,xmlDocPtr doc, xmlNodePtr cur){
SP 420     xmlNodePtr child = cur->xmlChildrenNode;
bb4033 421     xmlChar *bonds, *conname;
a3dbf0 422     char *b;
86b69b 423     int idx, polyidx;
a3dbf0 424     char *token[2];
3cd5f4 425     int temp_cnt=0;
a3dbf0 426     while (child != NULL) {
bb4033 427         conname=xmlGetProp(child, (xmlChar *)"Name");
SP 428         if ((!xmlStrcmp(child->name, (const xmlChar *)"DataArray")) && !xmlStrcmp(conname, (const xmlChar *)"connectivity") ){
a3dbf0 429             bonds = xmlNodeListGetString(doc, child->xmlChildrenNode, 1);
SP 430             b=(char *)bonds;
e87e4e 431             token[0]=strtok(b," ");
ecdd71 432             token[1]=strtok(NULL,"\n");
a3dbf0 433             idx=0;
SP 434             while(token[0]!=NULL){
86b69b 435                 if(idx<3*(vesicle->vlist->n-2)){
SP 436                     bond_add(vesicle->blist, vesicle->vlist->vtx[atoi(token[0])], vesicle->vlist->vtx[atoi(token[1])]);
3cd5f4 437                     //fprintf(stderr,"Bonds in vesicle count idx=%d\n",idx);
86b69b 438                 }
SP 439                 else {
440                 //find grafted vtx
301c87 441                     if(vesicle->tape->npoly && vesicle->tape->nmono && (vesicle->tape->nmono-1)==(idx-3*(vesicle->vlist->n-2))%(vesicle->tape->nmono)
3cd5f4 442                         && idx<(3*vesicle->vlist->n-2+vesicle->tape->nmono*vesicle->tape->npoly)){
SP 443                         temp_cnt++;
444                         //fprintf(stderr,"%d: Bonds in poly count idx=%d, t1=%s t2=%s\n",temp_cnt,idx, token[0], token[1]);
445                         
86b69b 446                         polyidx=(idx-3*(vesicle->vlist->n-2))/(vesicle->tape->nmono);
720bd4 447                         //fprintf(stderr,"poly=%d, vertex=%d\n",polyidx,atoi(token[0]));
86b69b 448                         vesicle->poly_list->poly[polyidx]->grafted_vtx=vesicle->vlist->vtx[atoi(token[0])];
SP 449                         vesicle->vlist->vtx[atoi(token[0])]->grafted_poly=vesicle->poly_list->poly[polyidx];
450                     }
451                 }
ecdd71 452                 token[0]=strtok(NULL," ");    
SP 453                 token[1]=strtok(NULL,"\n");    
a3dbf0 454                 idx++;
SP 455             }
456             xmlFree(bonds);
457         }
bb4033 458         xmlFree(conname);
a3dbf0 459         child=child->next;
SP 460     }
720bd4 461     //fprintf(stderr,"Bond data j=%d\n",idx);    
a3dbf0 462     return TS_SUCCESS;
SP 463 }
464
8fa1c0 465
SP 466