XYZ Format¶
read_xyz¶
Reads a file in the xyz format.
| Parameter | Description |
|---|---|
file |
file name (required) |
bounds_mode |
bounding box mode, default FILE_BOUNDS (bounds read from the file) |
enlarge_bounds |
empty layer added around the domain, default 0 |
pbc_adjust_xform |
adjusts the domain transformation |
Format of a file of nb particles:
nb
box_size_x box_size_y box_size_z
type_0 pos_x_0 pos_y_0 pos_z_0
type_1 pos_x_1 pos_y_1 pos_z_1
...
type_nb-1 pos_x_nb-1 pos_y_nb-1 pos_z_nb-1
Two particles of the same type in the domain [[0,0,0],[10,10,10]]:
add_xyz adds the particles of an xyz file to an existing simulation, and reads files with several particle types.
write_xyz¶
Writes a text file (.xyz) with the selected fields.
| Parameter | Description |
|---|---|
fields |
fields to write, e.g. [ id, velocity, radius ] |
filename |
output file |
units |
units of the fields, e.g. { velocity: "m/s", radius: "m" } |
Note
The first line contains the number of particles, the second line the "lattice" description, useful with Ovito.
Example: replace the MPI-IO checkpoints by xyz files.
scripts/post_processing/profile_pos_vel.py is a minimal, easily modifiable script that computes the averages of the
position and velocity components of these files and writes mean_r_v.pdf: