forked from d-SEAMS/PydSEAMSlib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
chillPlus.py
101 lines (87 loc) · 2.03 KB
/
chillPlus.py
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import bbdir.cyoda as cyoda
trajectory = "subprojects/seams-core/input/traj/mW_cubic.lammpstrj"
solCloud = cyoda.PointCloudDouble()
iceList = []
# Get the frame
resCloud = cyoda.readLammpsTrjO(
filename=trajectory,
targetFrame=1,
typeO=1, # oxygenAtomType
isSlice=False,
coordLow=[0, 0, 0],
coordHigh=[50, 0, 0],
)
# Calculate the neighborlist by ID
nList = cyoda.neighListO(
rcutoff=3.5,
yCloud=resCloud,
typeI=1, # oxygenAtomType
)
# Calculate Cij (cloud,slice)
resCloud = cyoda.getCorrelPlus(
yCloud=resCloud,
nList=nList,
isSlice=False,
)
# Write out data (cloud,slice,name)
resCloud = cyoda.getIceTypePlus(
yCloud=resCloud,
nList=nList,
path="runOne/",
firstFrame=1,
isSlice=False,
outputFileName="chillPlus.txt",
)
# Dump the rescloud which currently has CHILL Plus classifications
cyoda.writeDump(
yCloud=resCloud,
path="runOne/",
outFile="waterChillP.lammpstrj",
)
# Average Q6 (cloud,slice)
avgQ6 = cyoda.getq6(
yCloud=resCloud,
nList=nList,
isSlice=False,
)
# Modification (cloud,q6)
resCloud = cyoda.reclassifyWater(
yCloud=resCloud,
q6=avgQ6,
)
# Post reclassification writeOut
cyoda.printIceType(
yCloud=resCloud,
path="runOne/",
firstFrame=1,
isSlice=False,
outputFileName="chillPlus.txt",
)
# Dump the rescloud which now has the supaa CHILL Plus Trajectory
cyoda.writeDump(
yCloud=resCloud,
path="runOne/",
outFile="waterSupaaP.lammpstrj",
)
# Get the largest ice cluster. Here, iceNeighbourList is the neighbour list by index.
cyoda.clusterAnalysis(
path="runOne/",
iceCloud=solCloud,
yCloud=resCloud,
nList=nList,
iceNeighbourList=iceList,
cutoff=3.5,
firstFrame=1,
bopAnalysis="q6",
)
# Recenter the cluster such that the centroid is at the center of the simulation box
cyoda.recenterClusterCloud(
iceCloud=solCloud,
nList=iceList,
)
# Dump the recentered largest ice cluster
cyoda.writeDump(
yCloud=resCloud,
path="runOne/",
outFile="largestIce.lammpstrj",
)