Added functionf for spherical harmonics
| | |
| | | } |
| | | return retval |
| | | |
| | | def single_vtu_ulm2(vesicle): |
| | | R0=ts.getR0(vesicle) |
| | | print(type(R0)) |
| | | print(R0) |
| | | ts.preparationSh(vesicle, R0) |
| | | ts.calculateUlmComplex(vesicle) |
| | | strng = ts.Ulm2Complex2String(vesicle).decode('ascii') |
| | | print(strng) |
| | | retval=strng.split(' ') |
| | | # ts.freeUlm2String(strng) |
| | | return retval |
| | | |
| | | def read_csv(filename): |
| | | with open(filename,'r') as f: |
| | |
| | | except FileNotFoundError: |
| | | #print("no file") |
| | | csvdict={'OuterLoop':['OuterLoop', 'Volume', 'Area', 'lamdba1', 'lambda2', 'lambda3', 'Nbw/Nb', 'hbar', 'StretchingE', 'avgFx', 'avgFy', 'avgFz', 'BendingEonlyC0']} |
| | | try: |
| | | os.unlink(os.path.join(directory,'ulm2.csv')) |
| | | except: |
| | | print("No need to delete ulm2.csv") |
| | | ulm2dict={'OuterLoop':['OuterLoop','ulm_0^0^2', 'ulm_1^-1^2', 'ulm_1^0^2', 'ulm_1^1^2', '...']} |
| | | filedict=get_vtu_dict(directory) |
| | | modified=False |
| | | for f in filedict: |
| | | if f not in csvdict: |
| | | vesicle= ts.parseDump(filedict[f]) |
| | | p=single_vtu_poststat(vesicle) |
| | | ulm2=single_vtu_ulm2(vesicle) |
| | | hist=get_histogram_data(vesicle) |
| | | with open(os.path.join(directory, "histogram_{:06d}.csv".format(int(f))), 'w') as histf: |
| | | histf.write('Number_of_vertices_in cluster Number_of_clusters\n') |
| | |
| | | self.dirlist=dirlist |
| | | def run(self): |
| | | for d in self.dirlist: |
| | | clean_poststat_directory(d) |
| | | #clean_poststat_directory(d) |
| | | poststat_directory(d) |
| | | print("Directory {} done".format(d)) |
| | | print("All done for this process") |
| | |
| | | ts.stretchenergy.argtype=[POINTER(ts_vesicle), POINTER(ts_triangle)] |
| | | ts.stretchenergy(vesicle,triangle) |
| | | |
| | | |
| | | def get_absolute_ulm2(vesicle,l,m): |
| | | ts.get_absolute_ulm2.argtype=[POINTER(ts_vesicle), c_double, c_double] |
| | | ts.get_absolute_ulm2.restype=c_double |
| | | ret=ts.get_absolute_ulm2(vesicle,l,m) |
| | | return ret |
| | | |
| | | def getR0(vesicle): |
| | | ts.getR0.argtype=[POINTER(ts_vesicle)] |
| | | ts.getR0.restype=c_double |
| | | r0=ts.getR0(vesicle) |
| | | return r0 |
| | | |
| | | def preparationSh(vesicle,r0): |
| | | ts.preparationSh.argtypes=[POINTER(ts_vesicle), c_double] |
| | | ts.preparationSh(vesicle,r0) |
| | | |
| | | def calculateUlmComplex(vesicle): |
| | | ts.calculateUlmComplex.argtype=[POINTER(ts_vesicle)] |
| | | ts.calculateUlmComplex(vesicle) |
| | | |
| | | |
| | | def Ulm2Complex2String(vesicle): |
| | | ts.Ulm2Complex2String.argtype=[POINTER(ts_vesicle)] |
| | | ts.Ulm2Complex2String.restype=c_char_p |
| | | string=ts.Ulm2Complex2String(vesicle) |
| | | return string |
| | | |
| | | def freeUlm2String(string): |
| | | ts.freeUlm2String.argtype=[c_char_p] |
| | | ts.freeUlm2String(string) |
| | | |
| | | |
| | | #This function seems not to exist!!! |
| | | #def solve_for_ulm2(vesicle): |
| | | # ts.solve_for_ulm2.argtype=[POINTER(ts_vesicle)] |
| | | # ts.solve_for_ulm2(vesicle) |
| | | |
| | | def mean_curvature_and_energy(vesicle): |
| | | ts.mean_curvature_and_energy.argtype=[POINTER(ts_vesicle)] |
| | | ts.mean_curvature_and_energy(vesicle) |
| | | |