|
MDStressLab++
|
Overview of visualization utilities.
This page documents the Python script used for generating contour plots of atomistic stress fields from simulation output files with .stress format.
This will read the stress component σyy from data.stress, convert it to GPa, and generate a contour plot in data_yy.pdf. The script assumes the units of stress are eV/Å \(^3\).
When a Cauchy stress object is written, MDStressLab also writes:
These files use the same OVITO-style header convention:
and
Momentum and mass density are only produced for Cauchy stress grids. Piola stress has no kinetic contribution in MDStressLab, so no density fields are written for Piola stress objects.
Structured grids can also be written in a LAMMPS dump grid-style format using Stress::write_voxel_grid(). This format is intended for direct grid visualization in OVITO and avoids treating grid points as particles. The caller supplies the structured grid dimensions and orthogonal bounds used to generate the grid; MDStressLab verifies that nx*ny*nz matches the number of stress grid points.
The script driver MDStressLab++_in writes these voxel-grid files for Cauchy sphere calculations in addition to the legacy .stress, .momentum_density, and .mass_density outputs.
The DIMENSION field is inferred from the number of active grid directions: nx x ny x 1 is written as a two-dimensional grid, while nx x ny x nz with all counts greater than one is written as a three-dimensional grid. The dump-grid bounds are shifted by half a grid spacing along active directions so that OVITO/LAMMPS cell centers coincide with the MDStressLab grid-point coordinates. In inactive directions, the lower and upper bounds collapse to the plane coordinate of the grid.
The stress tensor is written to:
with grid-cell columns:
For Cauchy stress objects, the same call also writes:
with grid-cell columns PX PY PZ and RHO, respectively. The legacy .stress, .momentum_density, and .mass_density files are still written by Stress::write() for regression testing and simple post-processing.