stress¶
- py4vasp.calculation.stress¶
- class py4vasp.calculation._stress.Stress(*args, **kwargs)¶
The stress describes the force acting on the shape of the unit cell.
The stress refers to the force applied to the cell per unit area. Specifically, VASP computes the stress for a given unit cell and relaxing to vanishing stress determines the predicted ground-state cell. The stress is 3 x 3 matrix; the trace indicates changes to the volume and the rest of the matrix changes the shape of the cell. You can impose an external stress with the tag PSTRESS.
When you relax the system or in a MD simulation, VASP computes and stores the stress in every iteration. You can use this class to read the stress for specific steps along the trajectory.
Examples
If you access a method of this class, the result will depend on the steps that you selected with the [] operator. Without any selection the results from the final step will be used.
>>> calc.stress.read()
To select the results for all steps, you don’t specify the array boundaries.
>>> calc.stress[:].read()
You can also select specific steps or a subset of steps as follows
>>> calc.stress[5].read() >>> calc.stress[1:6].read()
- print()¶
Print a string representation of this instance.
- read(*args, **kwargs)¶
Convenient wrapper around to_dict. Check that function for examples and optional arguments.
- selections()¶
Returns possible alternatives for this particular quantity VASP can produce.
The returned dictionary contains a single item with the name of the quantity mapping to all possible selections. Each of these selection may be passed to other functions of this quantity to select which output of VASP is used.
- Returns:
The key indicates this quantity and the values possible choices for arguments to other functions of this quantity.
- Return type:
dict
- to_dict()¶
Read the stress and associated structural information for one or more selected steps of the trajectory.
- Returns:
Contains the stress for all selected steps and the structural information to know on which cell the stress acts.
- Return type:
dict
Examples
If you access this method, the result will depend on the steps of the class that you selected with the [] operator. Without any selection the results from the final step will be used.
>>> calc.stress.to_dict()
To select the results for all steps, you don’t specify the array boundaries.
>>> calc.stress[:].to_dict()
You can also select specific steps or a subset of steps as follows
>>> calc.stress[5].to_dict() >>> calc.stress[1:6].to_dict()