| | |
| | | #include <sys/types.h> |
| | | #include <dirent.h> |
| | | #include <errno.h> |
| | | #include <snapshot.h> |
| | | /** DUMP STATE TO DISK DRIVE **/ |
| | | |
| | | ts_bool dump_state(ts_vesicle *vesicle, ts_uint iteration){ |
| | |
| | | } |
| | | } |
| | | |
| | | fprintf(fh, "<?xml version=\"1.0\"?>\n<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" compressor=\"vtkZLibDataCompressor\">\n <UnstructuredGrid>\n"); |
| | | fprintf(fh, "<?xml version=\"1.0\"?>\n<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" compressor=\"vtkZLibDataCompressor\">\n"); |
| | | xml_trisurf_data(fh,vesicle); |
| | | fprintf(fh, " <UnstructuredGrid>\n"); |
| | | fprintf(fh, "<Piece NumberOfPoints=\"%u\" NumberOfCells=\"%u\">\n",vlist->n+monono*polyno+fonono*filno, blist->n+monono*polyno+filno*(fonono-1)); |
| | | fprintf(fh,"<PointData Scalars=\"scalars\">\n<DataArray type=\"Int64\" Name=\"scalars\" format=\"ascii\">"); |
| | | for(i=0;i<vlist->n;i++){ |
| | |
| | | |
| | | |
| | | ts_tape *parsetape(char *filename){ |
| | | FILE *fd = fopen (filename, "r"); |
| | | long length; |
| | | size_t size; |
| | | fseek (fd, 0, SEEK_END); |
| | | length = ftell (fd); |
| | | fseek (fd, 0, SEEK_SET); |
| | | size=fread (tapetxt, 1, length, fd); |
| | | fclose(fd); |
| | | if(size); |
| | | ts_tape *tape=parsetapebuffer(tapetxt); |
| | | return tape; |
| | | } |
| | | |
| | | ts_tape *parsetapebuffer(char *buffer){ |
| | | ts_tape *tape=(ts_tape *)calloc(1,sizeof(ts_tape)); |
| | | tape->multiprocessing=calloc(255,sizeof(char)); |
| | | |
| | |
| | | cfg_t *cfg; |
| | | ts_uint retval; |
| | | cfg = cfg_init(opts, 0); |
| | | retval=cfg_parse(cfg, filename); |
| | | retval=cfg_parse_buf(cfg, buffer); |
| | | if(retval==CFG_FILE_ERROR){ |
| | | fatal("No tape file.",100); |
| | | } |