Resolving the issues with restoring vesicles from vtu and fixing the volume. Dump to vtu has been repaired.
| | |
| | | // exit(1); |
| | | |
| | | //write_vertex_xml_file(vesicle,1000); |
| | | fprintf(stderr,"constvol=%ld, precision=%e\n", tape->constvolswitch, tape->constvolprecision); |
| | | run_simulation(vesicle, tape->mcsweeps, tape->inititer, tape->iterations, start_iteration); |
| | | write_master_xml_file(command_line_args.output_fullfilename); |
| | | write_dout_fcompat_file(vesicle,"dout"); |
| | |
| | | |
| | | /* outputs additional data into paraview xml file */ |
| | | ts_bool xml_trisurf_data(FILE *fh, ts_vesicle *vesicle){ |
| | | |
| | | ts_double cvol_write=0, carea_write=0; |
| | | ts_string *data=(ts_string *)malloc(sizeof(ts_sprintf)); |
| | | data->string=(char *)malloc(5120000*sizeof(char)); /*TODO: warning, can break if the string is to long */ |
| | | data->beg=0; |
| | |
| | | xml_trisurf_vtx_neigh(data,vesicle->vlist); |
| | | xml_trisurf_vtx_tristar(data,vesicle->vlist); |
| | | xml_trisurf_nucleus(data,vesicle); |
| | | xml_trisurf_constvolarea(data,V0,A0); |
| | | if(vesicle->tape->constvolswitch==0) |
| | | cvol_write=vesicle->volume; |
| | | else |
| | | cvol_write=V0; |
| | | if(vesicle->tape->constareaswitch==0) |
| | | carea_write=vesicle->area; |
| | | else |
| | | carea_write=A0; |
| | | xml_trisurf_constvolarea(data,cvol_write,carea_write); |
| | | #ifdef COMPRESSION |
| | | char *compressed; |
| | | ts_uint nbytes=ts_compress_string64(data->string, data->beg-1, &compressed); //suppress null character at the end with by substracting 1 |
| | |
| | | cell_occupation(vesicle); |
| | | dump_state(vesicle,i); |
| | | if(i>=inititer){ |
| | | vesicle_volume(vesicle); //calculates just volume. |
| | | vesicle_area(vesicle); //calculates area. |
| | | 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); |
| | | vesicle_volume(vesicle); //calculates just volume. |
| | | vesicle_area(vesicle); //calculates area. |
| | | r0=getR0(vesicle); |
| | | if(vesicle->sphHarmonics!=NULL){ |
| | | preparationSh(vesicle,r0); |
| | |
| | | |
| | | if(vesicle->tape->constvolswitch==2){ |
| | | /*check whether the dvol is gt than epsvol */ |
| | | //fprintf(stderr,"DVOL=%1.16e\n",dvol); |
| | | //fprintf(stderr,"DVOL=%1.16e, V0=%1.16e, vesicleVolume=%1.16e, |volume+dvol-V0|=%1.16e\n",dvol, V0, vesicle->volume, fabs(vesicle->volume+dvol-V0)); |
| | | if(fabs(vesicle->volume+dvol-V0)>epsvol){ |
| | | //restore old state. |
| | | vtx=memcpy((void *)vtx,(void *)&backupvtx[0],sizeof(ts_vertex)); |
| | |
| | | } |
| | | |
| | | } else |
| | | //fprintf(stderr, "success\n"); |
| | | // vesicle_volume(vesicle); |
| | | // fprintf(stderr,"Volume before=%1.16e\n", vesicle->volume); |
| | | if(vesicle->tape->constvolswitch == 1){ |