Skip to contents

dseams reads one trajectory frame into the d-SEAMS engine and returns data frames. A frame is one configuration. The analyses below take that frame.

library(dseams)
dseams_example()
#> [1] "exampleTraj.lammpstrj"   "ice1h.lammpstrj"        
#> [3] "nucleation_f1.lammpstrj"

ice1h.lammpstrj is a 2x2x2 ice Ih cell (128 oxygen sites). exampleTraj.lammpstrj is one frame of a TIP4P mixture (250 waters; type 2 is oxygen and type 1 is hydrogen). nucleation_f1.lammpstrj is the first frame of an mW nucleation trajectory (4096 waters).

type = 0 guesses oxygen. A positive type keeps that LAMMPS species. A negative type keeps every atom.

A perfect crystal

Keep every atom. This dump is oxygen only, so the frame has 128 rows.

ice1h <- read_frame(dseams_example("ice1h.lammpstrj"), type = -1L)
ice1h
#> dseams frame 1 atoms 128
head(positions(ice1h))
#>          x    y     z
#> [1,]  9.09 1.83 12.41
#> [2,] 13.10 4.47 10.10
#> [3,] 14.33 5.39 12.39
#> [4,] 13.05 4.57 14.69
#> [5,] 10.46 0.91 14.62
#> [6,] 10.43 5.43 14.64

Coordinates are in the units of the file, here angstrom. CHILL+ labels every water hexagonal, and the hydrogen-bond network is six-membered rings only. graph = "cutoff" bonds every pair closer than the cutoff (3.5 angstrom). The default ring graph is the mutual four-neighbour list, so the crystal census names "cutoff" explicitly.

ice <- chill_plus(ice1h)
table(ice$name)
#> 
#> hexagonal 
#>       128
primitive_rings(ice1h, graph = "cutoff", max_depth = 6L)
#>   size   n
#> 1    6 256
cages(ice1h)
#> cages hexagonal 128 cubic 0 both 0 water 0

name is one of nine labels. hexagonal is ice Ih and cubic is ice Ic. interfacial is ice-like but not cubic or hexagonal. clathrate is clathrate and interClathrate is interfacial clathrate. water is liquid or amorphous. unclassified matched none of those. reCubic and reHex are cubic and hexagonal ice reclassified with the q6 order parameter.

Cage membership is disjoint: hexagonal only, cubic only, both, or water. On this cell every oxygen is in a hexagonal cage.

symmetry() compares each neighbour shell with ideal ice. The code is 0 for ice Ih, 1 for ice Ic, 2 for stacking-disordered ice, and -1 otherwise. On this cell every oxygen is code 0.

table(symmetry(ice1h))
#> 
#>   0 
#> 128
summary(steinhardt(ice1h, order_l = 6L)$ql)
#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
#>  0.6214  0.6251  0.6262  0.6259  0.6269  0.6283

ql is the local Steinhardt parameter. qlbar is the Lechner-Dellago average of the same degree over the neighbour shell.

A mixed frame

Type 2 is the oxygen in exampleTraj.lammpstrj.

frame <- read_frame(dseams_example("exampleTraj.lammpstrj"), type = 2L)
frame
#> dseams frame 1 atoms 250
ice <- chill_plus(frame)
table(ice$name)
#> 
#> interClathrate          water 
#>              9            241
table(chill_plus(frame, graph = "mutual")$name)
#> 
#>      clathrate interClathrate          water 
#>              1              7            242

graph = "cutoff", the default for chill_plus(), is the distance list: 9 interfacial clathrate and 241 water. graph = "mutual" keeps the mutual four nearest neighbours inside the cutoff plus 1.5 angstrom: 1 clathrate, 7 interfacial clathrate, and 242 water.

print() on a CHILL+ result counts the labels. It does not print the rows. Select the columns into a plain data frame when you want the atoms:

kept <- ice[ice$name != "water", ]
data.frame(atom = kept$atom, label = kept$label, name = kept$name)
#>   atom label           name
#> 1   70     5 interClathrate
#> 2   94     5 interClathrate
#> 3  151     5 interClathrate
#> 4  280     5 interClathrate
#> 5  361     5 interClathrate
#> 6  370     5 interClathrate
#> 7  556     5 interClathrate
#> 8  661     5 interClathrate
#> 9  691     5 interClathrate

The ring census and the order parameters are data frames in the same way. The default ring graph is the mutual list. At depth 6 this frame has 224 six-membered rings.

primitive_rings(frame, max_depth = 6L)
#>   size   n
#> 1    3   5
#> 2    4 282
#> 3    5   9
#> 4    6 224
q3 <- steinhardt(frame, order_l = 3L)
summary(q3$ql)
#>    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
#>  0.1557  0.3192  0.3717  0.3749  0.4231  0.7139
head(q4_q6(frame))
#> q4 q6, 6 atoms, mean q6 0.4086172

q4_q6() returns both degrees, and their neighbour averages q4bar and q6bar, on the cutoff shell. signature_cages() counts closed cages of one ring census. "512" is twelve pentagons, the small cage of structure I. The two numbers are the cage count and the number of atoms in those cages.

signature_cages(frame, "512")
#> [1] 0 0
cages(frame)
#> cages hexagonal 0 cubic 0 both 0 water 250

Rotation between two frames

jump_tau90() returns the time step dt when any water’s H-H vector rotates by at least 90 degrees between two frames, and NaN when none does. Both frames must contain oxygen and hydrogen. In exampleTraj.lammpstrj those species are types 2 and 1. The same frame compared with itself has not rotated:

both <- read_frame(dseams_example("exampleTraj.lammpstrj"), type = -1L)
jump_tau90(both, both, dt = 1, oxygen_type = 2L, hydrogen_type = 1L)
#> [1] NaN