Trisurf Monte Carlo simulator
Samo Penic
2016-06-02 08a4a2072e2248696eeb2a5cf93a8bcb90390596
commit | author | age
38cb4a 1 #!/usr/bin/python3
9f5ff5 2 from trisurf import tsmgr
SP 3 from trisurf import trisurf
67749c 4 from trisurf import statistics
3d0247 5
a3f6b7 6
SP 7 print("Running trisurf version "+ tsmgr.getTrisurfVersion())
8
3d0247 9 #Simple example how to start simulation from a previos snapshot
9f5ff5 10 run1=trisurf.Runner(snapshot='snapshot.vtu')
SP 11 run1.setMaindir(("N","k","V","Np","Nm"),("nshell","xk0","constvolswitch","npoly","nmono"))
12 run1.setSubdir("run0")
13
2f74e4 14
3d0247 15 #Example how to start simulation from tape. Extra argument in runArgs will be passed to trisurf executable (meaning that simulation will always start from the beginning (bipyramid) ignoring the fact that some states may have been calculated already)
9f5ff5 16 run2=trisurf.Runner(tape='tape', runArgs=['--force-from-tape'])
SP 17 run2.setMaindir(("N","k","V","Np","Nm"),("nshell","xk0","constvolswitch","npoly","nmono"))
18 run2.setSubdir("run1")
19
3d0247 20 #Example of programatical setup of 4 runs
SP 21 pRun=[]
22 for i in range(0,4): #0,1,2,3
23     tpRun=trisurf.Runner(tape='tape')
24     tpRun.setMaindir(("N","k","V","Np","Nm"),("nshell","xk0","constvolswitch","npoly","nmono"))
25     tpRun.setSubdir("programatical_"+str(i))
26     pRun.append(tpRun)
9f5ff5 27
SP 28
3d0247 29 #obligatory final configuration step: combine all runs
SP 30 Runs=[run1,run2]+pRun
31 #start manager with configured runs
bc0dc5 32 tsmgr.start(Runs)
SP 33 #statistics.combine([run1,run2])