Added stretching energy to tspoststat
| | |
| | | cnt+=1 |
| | | return cnt |
| | | |
| | | def sum_stretching_energy(vesicle): |
| | | energy=0.0 |
| | | for i in range(0,vesicle.contents.tlist.contents.n): |
| | | ts.stretchenergy(vesicle,vesicle.contents.tlist.contents.tria[i]) |
| | | energy+=vesicle.contents.tlist.contents.tria[i].contents.energy |
| | | return energy |
| | | |
| | | def get_histogram_data(vesicle): |
| | | cstlist=ts.init_cluster_list() |
| | | ts.clusterize_vesicle(vesicle,cstlist) |
| | |
| | | 'l1':l1, |
| | | 'l2':l2, |
| | | 'l3':l3, |
| | | 'Nbw/Nb':count_bonds/vesicle.contents.blist.contents.n |
| | | 'Nbw/Nb':count_bonds/vesicle.contents.blist.contents.n, |
| | | 'StretchingE': sum_stretching_energy(vesicle), |
| | | } |
| | | return retval |
| | | |
| | |
| | | |
| | | |
| | | def poststat_directory(directory): |
| | | """Function reads existing data_tspoststat and checks if there are new VTUs in the directory that were not poststated. If there are, then they are added to the list""" |
| | | try: |
| | | csvdict=read_csv(os.path.join(directory,'data_tspoststat.csv')) |
| | | except FileNotFoundError: |
| | | #print("no file") |
| | | csvdict={'OuterLoop':['OuterLoop', 'Volume', 'Area', 'lamdba1', 'lambda2', 'lambda3', 'Nbw/Nb hbar']} |
| | | csvdict={'OuterLoop':['OuterLoop', 'Volume', 'Area', 'lamdba1', 'lambda2', 'lambda3', 'Nbw/Nb', 'hbar', 'StretchingE']} |
| | | filedict=get_vtu_dict(directory) |
| | | modified=False |
| | | for f in filedict: |
| | |
| | | '{:.17e}'.format(p['l2']), |
| | | '{:.17e}'.format(p['l3']), |
| | | '{:.17e}'.format(p['Nbw/Nb']), |
| | | '{:.17e}'.format(p['hbar'])] |
| | | '{:.17e}'.format(p['hbar']), |
| | | '{:.17e}'.format(p['StretchingE'])] |
| | | modified=True |
| | | if modified: |
| | | write_csv(os.path.join(directory,'data_tspoststat.csv'), csvdict) |
| | |
| | | #print(sorted(hist.items(), key=lambda x: int(x[0]))) |
| | | #ts.vesicle_free(vesicle) |
| | | #poststat_directory('/tmp/sim1/run0') |
| | | NUM_PROCESSES=3 |
| | | NUM_PROCESSES=2 |
| | | os.chdir('/home/samo/trisurf-server') |
| | | os.environ.setdefault("DJANGO_SETTINGS_MODULE","web_trisurf.settings") |
| | | django.setup() |
| | |
| | | ('znorm', c_double), |
| | | ('area', c_double), |
| | | ('volume', c_double), |
| | | ('energy', c_double), |
| | | ] |
| | | |
| | | class ts_triangle_list(Structure): |
| | | _fields_=[('n',c_uint),('tria', POINTER(POINTER(ts_triangle)))] |
| | | _fields_=[('n',c_uint),('a0',c_double),('tria', POINTER(POINTER(ts_triangle))),] |
| | | |
| | | |
| | | ts_cell._fields_=[ |
| | |
| | | ('pswitch',c_long), |
| | | ('constvolswitch',c_long), |
| | | ('constareaswitch',c_long), |
| | | ('stretchswitch',c_long), |
| | | ('xkA0',c_double), |
| | | ('constvolprecision',c_double), |
| | | ('multiprocessing',c_char_p), |
| | | ('brezveze0',c_long), |
| | |
| | | ts.cluster_list_free.argtype=[POINTER(ts_cluster_list)] |
| | | ts.cluster_list_free(cluster_list) |
| | | |
| | | def stretchenergy(vesicle, triangle): |
| | | ts.stretchenergy.argtype=[POINTER(ts_vesicle), POINTER(ts_triangle)] |
| | | ts.stretchenergy(vesicle,triangle) |
| | | |
| | | |
| | | |