MDStressLab++
Loading...
Searching...
No Matches
visualize.py File Reference

Generates 2D contour plots of stress components from .stress files. More...

Go to the source code of this file.

Namespaces

namespace  visualize
 

Functions

 visualize.read_file (filename)
 Reads a .stress file containing atomistic stress data.
 
 visualize.plot_contour (data, output_fname, component_index, component_label)
 Plots a 2D contour of the selected stress component.
 

Variables

dict visualize.STRESS_COMPONENTS
 Mapping from stress component names to (column index, label).
 
 visualize.filename = sys.argv[1]
 
 visualize.component_key = sys.argv[2].lower()
 
 visualize.component_index
 
 visualize.component_label
 
 visualize.base
 
 visualize._
 
str visualize.plt_fname = f"{base}_{component_key}.pdf"
 
 visualize.data = read_file(filename)
 

Detailed Description

Generates 2D contour plots of stress components from .stress files.

This script reads atomistic simulation output and visualizes a selected stress component (e.g., σyy) using a filled contour plot.

Input Format

The input file should be structured as follows:

125
Properties=pos:R:3:stress:R:6
x y z σ_xx σ_yy σ_zz σ_xy σ_xz σ_yz
...

Each data line must contain 9 floating-point values: the atomic position (x, y, z) followed by the six unique components of the symmetric Cauchy stress tensor.

Command-Line Usage

python visualize.py <filename.stress> <component: xx|yy|zz|xy|xz|yz>

Converts the selected stress component from internal units to GPa (by multiplying by 160.0), and saves a PDF contour plot.

Related Pages

Definition in file visualize.py.