Python wrapper for running instances of trisurf-ng
Samo Penic
2019-07-15 7f64589f9f172b7965a086bcceed8c47a51daca7
commit | author | age
8c3c29 1 #!/usr/bin/python3
SP 2 from trisurf import tsmgr
3 from trisurf import trisurf
4 from trisurf import statistics
d2f7b0 5 from trisurf import analyses
8c3c29 6
SP 7 print("Running trisurf version "+ tsmgr.getTrisurfVersion())
8 Runs=[]
9 Nshell=25
10
11 #--------- F = 0 ------------
12 #kapa_list=[10,20,30,40,50]
13 #p=[5,10,15,20,25]
14
15 #N=5*Nshell**2+2
16 #Nc_list=[int(N*pp/100)  for pp in p]
17
18 #for kapa in kapa_list:
19 #    for Nc in Nc_list:
20 #        run=trisurf.Runner(tape='tape_Nc'+str(Nc)+'_k'+str(kapa))
21 #        run.setMaindir(("N", "k", "V", "_Nc", "_c","_w"),  ("nshell","xk0","constvolswitch","number_of_vertices_with_c0","c0", "w"))
22 #        run.setSubdir("run0")
23 #        Runs.append(run)
24
25 #----------------------------
26 #--------- F = 0 ------------
27 kapa_list=[15,16,17,18,19,20,21,22]
28 #p=[5,7.5,10,12.5]
29 p=[8,8.5,9,9.5,10.5,11,11.5,12]
30
31 N=5*Nshell**2+2
32 Nc_list=[int(N*pp/100)  for pp in p]
33 #print(Nc_list)
34
35 #spremenil sem, ker nimam vseh podatkov!!!
36 kapa_list=[15,16,18,19,20,21,21,22]
37 Nc_list=[156,234,312,390]
38
39 for kapa in kapa_list:
40     for Nc in Nc_list:
41         #print('tape_Nc'+str(Nc)+'_k'+str(kapa))
42         run=trisurf.Runner(tape='tape_Nc'+str(Nc)+'_k'+str(kapa))
43         run.setMaindir(("N", "k", "V", "_Nc", "_c","_w"),  ("nshell","xk0","constvolswitch","number_of_vertices_with_c0","c0", "w"))
44         run.setSubdir("run0")
45         Runs.append(run)
46
47
d2f7b0 48 #Here is how we wrap functions
SP 49 def plotvolume(run, **kwargs):
50     from trisurf import analyses
51     analyses.plotColumnFromPostProcess(run,column='Volume',**kwargs)
8c3c29 52
d2f7b0 53 def plotbondrate(run, **kwargs):
SP 54     from trisurf import analyses
55     analyses.plotColumnFromPostProcess(run,column='VertexMoveSucessRate',filename='statistics.csv',**kwargs)
8c3c29 56
d55834 57 def runningavgc0(run, **kwargs):
SP 58     from trisurf import analyses
59     analyses.plotrunningavginteractive(run, scalar_field='spontaneous_curvature', **kwargs)
8c3c29 60
SP 61 #start manager with configured runs
d55834 62 tsmgr.start(Runs, analyses={'demo':analyses.demo,'runningavg':analyses.plotrunningavginteractive, 'plothbar':analyses.plotColumnFromPostProcess, 'plotvol':plotvolume, 'plotbondrate':plotbondrate, 'runningavgC0':runningavgc0})
8c3c29 63
d2f7b0 64 #here is how we combine statistics of multiple runs
8c3c29 65 #statistics.combine([Runs[1],Runs[2]])