Trisurf Monte Carlo simulator
Samo Penic
2016-07-05 0a2c81d28b72c6ab68ad418130148b144da90309
Some minor changes
4 files modified
46 ■■■■ changed files
src/io.c 37 ●●●●● patch | view | raw | blame | history
src/io.h 2 ●●● patch | view | raw | blame | history
src/timestep.c 2 ●●● patch | view | raw | blame | history
src/tspoststat.c 5 ●●●● patch | view | raw | blame | history
src/io.c
@@ -820,7 +820,7 @@
    return TS_SUCCESS;
}
ts_bool write_vertex_xml_file(ts_vesicle *vesicle, ts_uint timestepno){
ts_bool write_vertex_xml_file(ts_vesicle *vesicle, ts_uint timestepno, ts_cluster_list *cstlist){
    ts_vertex_list *vlist=vesicle->vlist;
    ts_bond_list *blist=vesicle->blist;
    ts_vertex **vtx=vlist->vtx;
@@ -887,7 +887,40 @@
    }
        fprintf(fh,"</DataArray>\n");
    if(cstlist!=NULL){
        fprintf(fh,"<DataArray type=\"Int64\" Name=\"vertices_in_cluster\" format=\"ascii\">");
        for(i=0;i<vlist->n;i++){
            if(vtx[i]->cluster!=NULL){
                fprintf(fh,"%u ",vtx[i]->cluster->nvtx);
            } else {
                fprintf(fh,"-1 ");
            }
            }
        //polymeres
        if(poly){
            poly_idx=vlist->n;
            for(i=0;i<vesicle->poly_list->n;i++){
                for(j=0;j<vesicle->poly_list->poly[i]->vlist->n;j++,poly_idx++){
                    fprintf(fh,"-1 ");
                }
            }
        }
        //filaments
        if(fil){
            poly_idx=vlist->n+monono*polyno;
            for(i=0;i<vesicle->filament_list->n;i++){
                for(j=0;j<vesicle->filament_list->poly[i]->vlist->n;j++,poly_idx++){
        //    fprintf(stderr,"was here\n");
                    fprintf(fh,"-1 ");
                }
            }
        }
        fprintf(fh,"</DataArray>\n");
    }
    //here comes additional data as needed. Currently only spontaneous curvature
    fprintf(fh,"<DataArray type=\"Float64\" Name=\"spontaneous_curvature\" format=\"ascii\">");
    for(i=0;i<vlist->n;i++){
src/io.h
@@ -72,7 +72,7 @@
 *    @param *text is a description line (max. 255 characters) to be included in the file
 */
ts_bool write_vertex_vtk_file(ts_vesicle *vesicle,ts_char *filename, ts_char *text);
ts_bool write_vertex_xml_file(ts_vesicle *vesicle, ts_uint timestepno);
ts_bool write_vertex_xml_file(ts_vesicle *vesicle, ts_uint timestepno, ts_cluster_list *cstlist);
ts_bool write_master_xml_file(ts_char *filename);
ts_bool write_pov_file(ts_vesicle *vesicle, char *filename);
src/timestep.c
@@ -93,7 +93,7 @@
        cell_occupation(vesicle);
            dump_state(vesicle,i);
        if(i>=inititer){
            write_vertex_xml_file(vesicle,i-inititer);
            write_vertex_xml_file(vesicle,i-inititer,NULL);
            write_master_xml_file(command_line_args.output_fullfilename);
            epochtime=get_epoch();            
            gyration_eigen(vesicle, &l1, &l2, &l3);
src/tspoststat.c
@@ -70,7 +70,7 @@
    ts_cluster_list *cstlist=init_cluster_list();
    clusterize_vesicle(vesicle,cstlist);
    //printf("No clusters=%d\n",cstlist->n);
    int k,i,cnt;
    int k,i,cnt, test=0;
    int max_nvtx=0;
    char filename[255];
    sprintf(filename,"histogram_%.6u.csv",timestep_no);
@@ -84,12 +84,15 @@
        for(k=0;k<cstlist->n;k++)
            if(cstlist->cluster[k]->nvtx==i) cnt++;
        fprintf(fd,"%d %d\n",i,cnt);
        test+=cnt*i;
    }
    //for(k=0;k<cstlist->n;k++){
//        printf("*Cluster %d has %d vertices\n",k,cstlist->cluster[k]->nvtx);
//    }
    fclose(fd);
//    printf("*Sum of all vertices in clusters: %d\n", test);
//    write_vertex_xml_file(vesicle,timestep_no,cstlist);
    cluster_list_free(cstlist);
    
    return TS_SUCCESS;