| | |
| | | #include <libxml/tree.h> |
| | | #include "vertex.h" |
| | | #include "energy.h" |
| | | |
| | | #include "sh.h" |
| | | #include "cell.h" |
| | | #include "frame.h" |
| | | ts_vesicle *vtk2vesicle(char *filename, ts_tape *tape){ |
| | | |
| | | ts_uint nshell=tape->nshell; |
| | |
| | | ts_vesicle *vesicle=init_vesicle(no_vertices,ncmax1,ncmax2,ncmax3,stepsize); |
| | | vesicle->nshell=nshell; |
| | | parse_vtk(filename, vesicle); |
| | | |
| | | //we have vertices and neighbour relations all set, but unordered. Let's do bonds, ordering, triangles... |
| | | vesicle->vlist = vtk_sort_neighbours(vesicle->blist,vesicle->vlist); |
| | | init_triangles(vesicle); |
| | | init_triangle_neighbours(vesicle); |
| | | init_common_vertex_triangle_neighbours(vesicle); |
| | | init_normal_vectors(vesicle->tlist); |
| | | mean_curvature_and_energy(vesicle); |
| | | |
| | | |
| | | //preliminaries for spherical harmonics... |
| | | centermass(vesicle); |
| | | cell_occupation(vesicle); |
| | | vesicle_volume(vesicle); //needed for constant volume at this moment |
| | | vesicle_area(vesicle); //needed for constant area at this moment |
| | | ts_double v0=vesicle->volume; |
| | | ts_double a0=vesicle->area; |
| | | ts_double r0=getR0(vesicle); |
| | | if(r0&&v0&&a0); |
| | | exit(1); |
| | | return vesicle; |
| | | } |
| | |
| | | break; //segfaults, because it finds another cells. Why? |
| | | } |
| | | } |
| | | //we have vertices and neighbour relations all set, but unordered. Let's do bonds, ordering, triangles... |
| | | vesicle->vlist = vtk_sort_neighbours(vesicle->blist,vesicle->vlist); |
| | | init_triangles(vesicle); |
| | | init_triangle_neighbours(vesicle); |
| | | init_common_vertex_triangle_neighbours(vesicle); |
| | | init_normal_vectors(vesicle->tlist); |
| | | mean_curvature_and_energy(vesicle); |
| | | ts_fprintf(stdout,"restoring from vtk dump finished!\n"); |
| | | return TS_SUCCESS; |
| | | } |