| | |
| | | #include <dirent.h> |
| | | #include "initial_distribution.h" |
| | | #include "poly.h" |
| | | |
| | | #include "cell.h" |
| | | #include <getopt.h> |
| | | #include <sys/stat.h> |
| | | #include <sys/types.h> |
| | |
| | | */ |
| | | |
| | | fwrite(vesicle->clist, sizeof(ts_cell_list),1, fh); |
| | | |
| | | /* write tape information on vesicle */ |
| | | fwrite(vesicle->tape,sizeof(ts_tape),1,fh); |
| | | fwrite(&iteration, sizeof(ts_uint),1,fh); |
| | | fclose(fh); |
| | | return TS_SUCCESS; |
| | |
| | | vesicle->filament_list->poly[i]->blist->bond[j]->vtx2=vesicle->filament_list->poly[i]->vlist->vtx[idx]; |
| | | } |
| | | } |
| | | |
| | | vesicle->tape=parsetape("tape"); |
| | | // recreating space for cells // |
| | | vesicle->clist=(ts_cell_list *)malloc(sizeof(ts_cell_list)); |
| | | retval=fread(vesicle->clist, sizeof(ts_cell_list), 1,fh); |
| | | vesicle->clist->cell=(ts_cell **)malloc(sizeof(ts_cell *)*vesicle->clist->ncmax[0]*vesicle->clist->ncmax[1]*vesicle->clist->ncmax[2]); |
| | | for(i=0;i<vesicle->clist->ncmax[0]*vesicle->clist->ncmax[1]*vesicle->clist->ncmax[2];i++){ |
| | | vesicle->clist->cell[i]=(ts_cell *)calloc(1,sizeof(ts_cell)); |
| | | vesicle->clist->cell[i]->idx=i+1; // We enumerate cells! Probably never required! |
| | | } |
| | | vesicle->clist=init_cell_list(vesicle->tape->ncxmax, vesicle->tape->ncymax, vesicle->tape->nczmax, vesicle->tape->stepsize); |
| | | |
| | | // vesicle->tape=(ts_tape *)malloc(sizeof(ts_tape)); |
| | | // retval=fread(vesicle->tape, sizeof(ts_tape),1,fh); |
| | | retval=fread(iteration,sizeof(ts_uint),1,fh); |
| | | if(retval); |
| | | fclose(fh); |
| | |
| | | } |
| | | |
| | | fprintf(fh, "<?xml version=\"1.0\"?>\n<VTKFile type=\"UnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\" compressor=\"vtkZLibDataCompressor\">\n <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, "<Piece NumberOfPoints=\"%u\" NumberOfCells=\"%u\">\n",vlist->n+monono*polyno+fonono*filno, blist->n+monono*polyno+filno*(fonono-1)+vesicle->tlist->n); |
| | | fprintf(fh,"<PointData Scalars=\"scalars\">\n<DataArray type=\"Int64\" Name=\"scalars\" format=\"ascii\">"); |
| | | for(i=0;i<vlist->n;i++){ |
| | | fprintf(fh,"%u ",vtx[i]->idx); |
| | |
| | | |
| | | } |
| | | |
| | | //triangles |
| | | for(i=0;i<vesicle->tlist->n;i++){ |
| | | fprintf(fh,"%u %u %u\n", vesicle->tlist->tria[i]->vertex[0]->idx,vesicle->tlist->tria[i]->vertex[1]->idx,vesicle->tlist->tria[i]->vertex[2]->idx); |
| | | } |
| | | |
| | | |
| | | fprintf(fh,"</DataArray>\n<DataArray type=\"Int64\" Name=\"offsets\" format=\"ascii\">"); |
| | | for (i=2;i<(blist->n+monono*polyno+(fonono-1)*filno)*2+1;i+=2){ |
| | | fprintf(fh,"%u ",i); |
| | | } |
| | | //triangles |
| | | i++; |
| | | for(;i<(blist->n+monono*polyno+(fonono-1)*filno)*2+1+vesicle->tlist->n*3+1;i+=3){ |
| | | fprintf(fh,"%u ",i); |
| | | } |
| | | fprintf(fh,"\n"); |
| | |
| | | for (i=0;i<blist->n+monono*polyno+fonono*filno;i++){ |
| | | fprintf(fh,"3 "); |
| | | } |
| | | //triangles |
| | | for(i=0;i<vesicle->tlist->n;i++){ |
| | | fprintf(fh,"5 "); |
| | | } |
| | | |
| | | fprintf(fh,"</DataArray>\n</Cells>\n</Piece>\n</UnstructuredGrid>\n</VTKFile>\n"); |
| | | fclose(fh); |
| | |
| | | CFG_SIMPLE_FLOAT("dmin_interspecies", &tape->dmin_interspecies), |
| | | CFG_SIMPLE_FLOAT("xk0",&tape->xk0), |
| | | CFG_SIMPLE_INT("pswitch",&tape->pswitch), |
| | | CFG_SIMPLE_INT("constvolswitch",&tape->constvolswitch), |
| | | CFG_SIMPLE_FLOAT("constvolprecision",&tape->constvolprecision), |
| | | CFG_SIMPLE_FLOAT("pressure",&tape->pressure), |
| | | CFG_SIMPLE_FLOAT("k_spring",&tape->kspring), |
| | | CFG_SIMPLE_FLOAT("xi",&tape->xi), |
| | |
| | | CFG_SIMPLE_INT("smp_cores",&tape->brezveze0), |
| | | CFG_SIMPLE_INT("cluster_nodes",&tape->brezveze1), |
| | | CFG_SIMPLE_INT("distributed_processes",&tape->brezveze2), |
| | | CFG_SIMPLE_INT("spherical_harmonics_coefficients",&tape->shc), |
| | | CFG_END() |
| | | }; |
| | | cfg_t *cfg; |