Name

Stress — Class for calculating the stress of a configuration.

Synopsis

Namespace: NanoLanguage
Stress(
configuration,
fix_strain
)

Description

Constructor for the Stress object.

Stress Arguments

configuration

Configuration with a calculator that supports stress calculations.

Type: BulkConfiguration or DeviceConfiguration.

Default: None
fix_strain

Additional constraint parameter.

Type: FixStrain | None

Default: None

Stress Methods

A Stress object provides the following methods:

  • evaluate(): Return the stress as a physical quantity.

  • nlprint(stream): Print a formatted string with the stress.

    stream

    The stream the stress should be written to.

    Type: A stream that supports strings being written to using 'write'.

    Default: sys.stdout

Usage Examples

Calculate and print the stress tensor of a compressed GaAs crystal

# Set up configuration
bulk_configuration = BulkConfiguration(
    bravais_lattice=FaceCenteredCubic(5.4*Angstrom),
    elements=[Gallium, Arsenic],
    cartesian_coordinates=[[ 0.      ,  0.      ,  0.      ],
                         [ 1.413425,  1.413425,  1.413425]]*Angstrom
    )

calculator = LCAOCalculator(
    numerical_accuracy_parameters=NumericalAccuracyParameters(
    k_point_sampling=(4, 4, 4))
    )

bulk_configuration.setCalculator(calculator)

#calculate the stress
stress = Stress(bulk_configuration)
nlprint(stress)

stress.py

Notes

Stress is given by the derivative of the total energy, E, with respect to a strain  \epsilon_{\alpha \beta},

\displaystyle

\sigma_{\alpha \beta} = \frac{1}{V}\frac{dE}{d\epsilon_{\alpha \beta}}.

In this equation, V, is the volume of the system and the strain tensor displaces positions by

\displaystyle

R^\epsilon_\alpha = \sum_\beta(\delta_{\alpha \beta} + \epsilon_{\alpha \beta})  R_\beta.

Stress has unit energy per volume element, i.e. eV/Ang**3.