pymatgen.analysis.elasticity.strain module

class Deformation[source]

Bases: pymatgen.analysis.elasticity.tensors.SquareTensor

Subclass of SquareTensor that describes the deformation gradient tensor

Create a Deformation object. Note that the constructor uses __new__ rather than __init__ according to the standard method of subclassing numpy ndarrays.

Parameters:deformation_gradient (3x3 array-like) – the 3x3 array-like representing the deformation gradient
apply_to_structure(structure)[source]

Apply the deformation gradient to a structure.

Parameters:structure (Structure object) – the structure object to be modified by the deformation
check_independent()[source]

checks to determine whether the deformation matrix represents an independent deformation, raises a ValueError if not. If so, returns the indices of the deformation gradient entry representing the independent component

classmethod from_index_amount(matrixpos, amt)[source]

Factory method for constructing a Deformation object from a matrix position and amount

Parameters:
  • matrixpos (tuple) – tuple corresponding the matrix position to have a perturbation added
  • amt (float) – amount to add to the identity matrix at position matrixpos
green_lagrange_strain

calculates the euler-lagrange strain from the deformation gradient

class DeformedStructureSet(rlxd_str, nd=0.01, ns=0.08, num_norm=4, num_shear=4, symmetry=False)[source]

Bases: object

class that generates a set of independently deformed structures that can be used to calculate linear stress-strain response

constructs the deformed geometries of a structure. Generates m + n deformed structures according to the supplied parameters.

Parameters:
  • rlxd_str (structure) – structure to undergo deformation, if fitting elastic tensor is desired, should be a geometry optimized structure
  • nd (float) – maximum perturbation applied to normal deformation
  • ns (float) – maximum perturbation applied to shear deformation
  • m (int) – number of deformation structures to generate for normal deformation, must be even
  • n (int) – number of deformation structures to generate for shear deformation, must be even
as_strain_dict()[source]

Returns dictionary of deformed structures indexed by independent strain objects in accordance with legacy behavior of elasticity package

symm_reduce(symm_ops, deformation_list, tolerance=0.01)[source]

Checks list of deformation gradient tensors for symmetrical equivalents and returns a new list with reduntant ones removed

Parameters:
  • symm_ops (list of SymmOps) – list of SymmOps objects with which to check the list of deformation tensors for duplicates
  • deformation_list (list of Deformations) – list of deformation gradient objects to check for duplicates
  • tolerance (float) – tolerance for assigning equal defo. gradients
class IndependentStrain[source]

Bases: pymatgen.analysis.elasticity.strain.Strain

Class for independent strains intended for use with old Materials Project elasticity workflow. Note that the default constructor constructs from a deformation matrix, rather than an array representing the strain, to emulate the legacy behavior.

Create an Independent Strain object. Note that the constructor uses __new__ rather than __init__ according to the standard method of subclassing numpy ndarrays. Note also that, unlike the Strain class, the default constructor of IndependentStrain takes the deformation gradient as input, rather than an array representing the Green-Lagrange strain.

Parameters:deformation_gradient (3x3 array-like) – the 3x3 array-like representing the deformation gradient
i
j
class Strain[source]

Bases: pymatgen.analysis.elasticity.tensors.SquareTensor

Subclass of SquareTensor that describes the Green-Lagrange strain tensor.

Create a Strain object. Note that the constructor uses __new__ rather than __init__ according to the standard method of subclassing numpy ndarrays. Note also that the default constructor does not include the deformation gradient

Parameters:strain_matrix (3x3 array-like) – the 3x3 array-like representing the Green-Lagrange strain
deformation_matrix

returns the deformation matrix

classmethod from_deformation(deformation)[source]

Factory method that returns a Strain object from a deformation gradient

Parameters:deformation (3x3 array-like) –
independent_deformation

determines whether the deformation matrix represents an independent deformation, raises a value error if not. Returns the index of the deformation gradient corresponding to the independent deformation

von_mises_strain

Equivalent strain to Von Mises Stress

convert_strain_to_deformation(strain, tol=1e-05)[source]