LAMMPS output files
LAMMPS is a popular molecular dynamics software. It can output data in a variety of formats. pySNOW has functions to read lammps outputs in two formats: - lammps dump style format, - lammps data format.
snow.io.lammps
read_lammps_data(file_path)
Read structure from a LAMMPS data file at a certain path
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_path
|
str
|
Path to the lammps data file from |
required |
Returns:
| Name | Type | Description |
|---|---|---|
elements |
list
|
chemical symbols of the atoms in the system |
coords |
ndarray
|
coordinates of the atoms in the system |
Source code in snow/io/lammps.py
read_order_lammps_dump(filename, id_index=0, type_index=1, coords_indexes=[2, 3, 4], scaled_coords=True)
Extract a movie ( Tuple[np.ndarray, np.ndarray] ) from a lammps dump file.
Atoms are not written in a consistent order in dump files, so you generally need to reorder them. You can choose the columns to read the information about id, type, and coords from the lammps dump file. Default is to 'atomic' style, which has the shape 'id type xs ys zs'.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
filename for the lammps-dump file to extract atoms from. |
required |
id_index
|
int
|
index of the column that contains ids of your atoms in the lammps dump - default to 0 |
0
|
type_index
|
int
|
index of the column that contains the type of atoms in the dump (in lammps these are mapped to numbers) |
1
|
coords_indexes
|
list
|
list of indexes of the columns that contain the positions of the atoms |
[2, 3, 4]
|
scaled_coords
|
bool to check if coordinates are scaled (written in terms of the box sizes length). Default to True, which is lammps' default. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
el_list |
list[ndarray]
|
list of arrays with the chemical species in the system. In lammps these are mapped to a number, so these will actually be an array of numbers. Eventually, users can convert these to chemical symbols once they know the mapping |
coords_list |
list[ndarray]
|
list of arrays of coordinates of atoms in the system |
Source code in snow/io/lammps.py
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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |