htesp.elastic

Module to perform elastic calculations

Functions

deformation(mpid, obj, dft, orig_prefix, ...)

Function to create deformed structures utilizing pymatgen.analysis.elastic class.

force_isif(incar_path[, value])

Rewrite incar_path so that it carries exactly one ISIF entry.

main([argv])

Entry point: elastic.py input or elastic.py compute_elastic.

process_material(mpid, orig_prefix, mode)

Handle deformation and elastic computations for one material.

qe_stress(scf_out)

Return the last stress tensor of a QE run, in GPa.

run_vasp_process(what[, cwd])

Run vasp_process.py <what> without a shell, optionally in cwd.

htesp.elastic.run_vasp_process(what, cwd=None)[source]

Run vasp_process.py <what> without a shell, optionally in cwd.

htesp.elastic.force_isif(incar_path, value=2)[source]

Rewrite incar_path so that it carries exactly one ISIF entry.

Replaces sed -i '/ISIF/d' INCAR followed by echo >>, which matched ISIF anywhere on a line instead of as the key.

htesp.elastic.qe_stress(scf_out)[source]

Return the last stress tensor of a QE run, in GPa.

pw.x prints total   stress followed by three rows of six numbers: the first three columns are the tensor in Ry/bohr^3 and the last three the same tensor in kbar.

Parameters:

scf_outstr

Path of the pw.x output file.

Returns:

numpy.ndarray

3x3 stress tensor in GPa, in the sign convention pymatgen’s ElasticTensor expects.

htesp.elastic.deformation(mpid, obj, dft, orig_prefix, deformed_struc)[source]

Function to create deformed structures utilizing pymatgen.analysis.elastic class.

Parameters:

mpidstr

Materials id.

objobject

Object of MpConnect class.

dftstr

Density Functional Theory (DFT) method used, e.g., ‘vasp’, ‘qe’.

orig_prefixstr

Prefix for the original undeformed structure.

deformed_strucobject

Object containing deformed structures.

Returns:

None

Example:

>>> from mpconnect import MpConnect
>>> from pymatgen import Structure
>>> from pymatgen.io.vasp import Poscar
>>> obj = MpConnect()
>>> mpid = "mp-1234"
>>> orig_prefix = "Si2"
>>> deformed_struc = ...  # Object containing deformed structures
>>> # obtained with pymatgen.analysis.elasticity.DeformedStructureSet
>>> deformation(mpid, obj, "vasp", orig_prefix, deformed_struc)
htesp.elastic.process_material(mpid, orig_prefix, mode)[source]

Handle deformation and elastic computations for one material.

Parameters:

mpidstr

Materials id.

orig_prefixstr

Prefix for the undeformed structure.

modestr

Either input (write the deformed inputs) or compute_elastic (read the finished runs back and fit the elastic tensor).

Returns:

None

htesp.elastic.main(argv=None)[source]

Entry point: elastic.py input or elastic.py compute_elastic.

Parameters:

argvlist, optional

Command-line arguments without the program name. Defaults to sys.argv[1:]; the first token is the mode.

Returns:

None