ElasticConstants

class ElasticConstants(configuration, optimizer=None, max_forces=None, max_steps=None, max_step_length=None, eta_max=None, n_eta=None, enable_symmetry=None, fit_order=None)

Class to calculate the elastic constants of a bulk material. Uses finite strain and calculates the elastic constants from the linear stress response.

Parameters:
  • configuration (BulkConfiguration.) – The BulkConfiguration for which the elastic constants should be calculated.

  • optimizer (FIRE | LBFGS | NoOptimization) – The optimizer method used for optimizing the internal coordinates after each strain. Set this to NoOptimization to disable optimization of the strained cell.
    Default: LBFGS

  • max_forces (PhysicalQuantity of type force) – The force threshold for the geometry optimization.
    Default: 0.005 * eV / Ang

  • max_steps (int) – The maximum number of steps used by the optimizer.
    Default: 200

  • max_step_length (PhysicalQuantity of type length) – The maximum step length the optimizer may take.
    Default: 0.2 * Ang

  • eta_max (float) – The maximum strain that can be be applied to the cell. Must be positive.
    Default: 0.005

  • n_eta (int) – The total number of different strain magnitudes for each strain vector. Must be larger than 1.
    Default: 3

  • enable_symmetry (bool) – Flag to select if only the independent elastic constants are calculated for each crystal system, or if all 21 constants are calculated.
    Default: True if the configuration has standard orientation, False otherwise.

  • fit_order (int) – The order of the polynomial fit of the stress-strain dependency. Must be in the interval 1 to (n_eta - 1).
    Default: 1

bulkModulusHill()
Returns:

The Hill type bulk modulus.

Return type:

PhysicalQuantity of type pressure

bulkModulusReuss()
Returns:

The Reuss type bulk modulus.

Return type:

PhysicalQuantity of type pressure

bulkModulusVoigt()
Returns:

The Voigt type bulk modulus.

Return type:

PhysicalQuantity of type pressure

enableSymmetry()
Returns:

True if only the independent elastic constants are calculated for each crystal system, and False if all 21 constants are calculated

Return type:

bool

etaMax()
Returns:

The maximum strain that can be be applied to the cell.

Return type:

float

evaluate()
Returns:

The elastic constants as a shape (6, 6) array.

Return type:

PhysicalQuantity of type pressure

fitOrder()
Returns:

The order of the polynomial fit of the stress-strain dependency.

Return type:

int

maxForces()
Returns:

The force threshold for the geometry optimization.

Return type:

PhysicalQuantity of type force

metatext()
Returns:

The metatext of the object or None if no metatext is present.

Return type:

str | None

nEta()
Returns:

The total number of different strain magnitudes for each strain vector.

Return type:

int

nlprint(stream=None)

Print a string containing an ASCII table useful for plotting the AnalysisSpin object.

Parameters:

stream (python stream) – The stream the table should be written to.
Default: NLPrintLogger()

poissonRatio()
Returns:

The Poisson ratios in various directions as a shape (3, 3) array.

Return type:

numpy.array

setMetatext(metatext)

Set a given metatext string on the object.

Parameters:

metatext (str | None) – The metatext string that should be set. A value of “None” can be given to remove the current metatext.

shearModulusHill()
Returns:

The Hill type shear modulus.

Return type:

PhysicalQuantity of type pressure

shearModulusReuss()
Returns:

The Reuss type shear modulus.

Return type:

PhysicalQuantity of type pressure

shearModulusVoigt()
Returns:

The Voigt type shear modulus.

Return type:

PhysicalQuantity of type pressure

uniqueString()

Return a unique string representing the state of the object.

youngsModulus()
Returns:

The Young’s moduli.

Return type:

PhysicalQuantity of type pressure

Usage Examples

Calculate the elastic constants of bulk silicon using the Stillinger-Weber potential [1], print the results, and save the object to an nc file:

# Set up bulk configuration
bulk_configuration = BulkConfiguration(
    bravais_lattice=FaceCenteredCubic(5.4306*Angstrom),
    elements=[Silicon, Silicon],
    fractional_coordinates=[[ 0.  ,  0.  ,  0.  ],
                            [ 0.25,  0.25,  0.25]])

# Define the calculator
calculator = TremoloXCalculator(parameters=StillingerWeber_Si_1985())
bulk_configuration.setCalculator(calculator)
bulk_configuration.update()

# Calculate the elastic constants
elastic = ElasticConstants(bulk_configuration,
                           optimizer=LBFGS(),
                           max_forces=0.001*eV/Angstrom,
                           eta_max=0.002,
                           n_eta=3,
                           enable_symmetry=True,
                           fit_order=1)
# Print the results
nlprint(elastic)
# Save the elastic constants analysis object
nlsave('elastic_constants.nc', elastic)

elastic_constants.py

Notes

  • Set optimizer=None if the atoms in the strained cell should not be optimized before calculating the Stress. If the cell only contians one atom, the optimization is automatically disabled.

  • Other properties, such as bulk modulus, shear modulus, Young’s modulus, or Poisson ratios can be calculated from the elastic constants. To view these results use the method nlprint.

  • An ElasticConstants calcualtion can be performed using any calculator that supports the calculation of Stress.

  • Before calculating the elastic constants of a given BulkConfiguration, the cell vectors should be optimized using the OptimizeGeometry function.