Skip to content

dblaschke-LANL/PyDislocDyn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyDislocDyn

PyDislocDyn is a suite of python programs designed to perform various calculations for basic research in dislocation dynamics in metals with various crystal symmetries in the continuum limit. In particular, one of its main purposes is to calculate dislocation drag from phonon wind. Additional features include the averaging of elastic constants for polycrystals, the calculation of the dislocation field including its limiting velocities, and the calculation of dislocation self-energy and line tension.
This code was first used for the computations leading to J. Phys. Chem. Solids 124 (2019) 24–35 (arxiv.org/abs/1804.01586) and Materials 12 (2019) 948 (arxiv.org/abs/1902.02451), as well as parts of Int. J. Plast. 131 (2020) 102750 (arxiv.org/abs/1912.08851), J. Mech. Phys. Solids 152 (2021) 104448 (arxiv.org/abs/2009.00167), Int. J. Plast. 144 (2021) 103030 (arxiv.org/abs/2101.10497), J. Appl. Phys. 130 (2021) 015901 (arxiv.org/abs/2104.08650), J. Phys.: Cond. Mat. 33 (2021) 503005 (arxiv.org/abs/2107.01220), Materials 16 (2023) 4019 (arxiv.org/abs/2303.10461), and Phys. Rev. B 108 (2023) 224102 (arxiv.org/abs/2305.06980). Additionally, it is able to reproduce the earlier results of LA-UR-16-24559 (doi.org/10.2172/1434423), J. Appl. Phys. 122 (2017) 145110 (arxiv.org/abs/1706.07132), and Phil. Mag. 98 (2018) 2397–2424 (arxiv.org/abs/1711.10555).

Author

Daniel N. Blaschke

License

PyDislocDyn is distributed according to the license.txt file. All contributions made by employees of Los Alamos National Laboratory are governed by that license.

C Number: C18073
doi: 10.11578/dc.20180619.15

Copyright (c) 2018, Triad National Security, LLC. All rights reserved.

The LANL development team asks that any forks or derivative works include appropriate attribution and citation of the LANL development team's original work.

Requirements

Optional:

  • numba >=0.53 (for speedup via just-in-time compilation of some subroutines),
  • joblib >=1.1 (for parallelization),
  • a Fortran 90 compiler to employ the alternative faster Fortran implementations of some subroutines via f2py; run 'python -m numpy.f2py -c subroutines.f90 -m subroutines' to use
    (or add appropriate options to build with OpenMP support, e.g. with gfortran and Python <=3.11: 'python -m numpy.f2py --f90flags=-fopenmp -lgomp -c subroutines.f90 -m subroutines';
    with Python >=3.12: 'python -m numpy.f2py --dep=openmp -c subroutines.f90 -m subroutines').
    A helper function, pydislocdyn.utilities.compilefortranmodule(), has been included to automate compilation of the Fortran submodule and to ensure it is placed in the correct location.
  • a recent version of LaTeX to build the manual (LA-UR-22-28074), pdf available at doi:10.2172/1880452

Installation

  • Download and unpack PyDislocDyn 1.3.0 or higher from https://github.com/dblaschke-LANL/PyDislocDyn/releases (or clone the latest master branch via:
    git clone https://github.com/dblaschke-LANL/PyDislocDyn.git ), then from within the PyDislocDyn folder (which contains the pyproject.toml file) simply run
    pip install .
    Note: installation is optional, i.e. pydislocdyn can also be run locally (in which case it will temporarily add itself to sys.path upon importing or running a frontend script).
  • then compile the Fortran submodule (optional) via
    python -c 'import pydislocdyn; pydislocdyn.utilities.compilefortranmodule()'
    Note: if you have chosen not to install PyDislocDyn, run the above command from within the PyDislocDyn folder,
    otherwise if PyDislocDyn is installed, make sure to change your current working directory so that it is not the one you ran 'pip install .' from.
    (Otherwise the local version will be imported instead of the installed one.)
    If compilation was successful, the following command will print 'True':
    python -c 'import pydislocdyn; print(pydislocdyn.usefortran)'
  • to uninstall PyDislocDyn, run
    pip uninstall pydislocdyn
    Note: the compiled Fortran module has to be deleted manually upon uninstalling (and pip will let the user know its location)

PyDislocDyn consists of:

Python module

  • pydislocdyn
    Defines functions to generate tensors of elastic constants and compliances, functions and classes to compute dislocation displacement gradient fields, self energy, and line tension, as well as functions to compute the drag coefficient from phonon wind. One of its submodules (pydislocdyn.metaldata) contains dictionaries storing input data taken from the references listed in that file, the most important ones being the 'CRC Handbook of Chemistry and Physics'; as well as 'Kaye and Laby Online'. In particular, this submodule contains elastic constants, densities, lattice constants, and thermal expansion coefficients at room temperature for various metals necessary to run the programs listed above.

Python programs / examples (using the module above)