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