GB code

GB code: A grain boundary generation code - Published in JOSS (2018)

https://github.com/oekosheri/gb_code

Science Score: 93.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 16 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org, zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

crystallography grain-boundaries high-throughput-computing linear-algebra python
Last synced: 4 months ago · JSON representation

Repository

A grain boundary generation code

Basic Info
  • Host: GitHub
  • Owner: oekosheri
  • License: mit
  • Language: Python
  • Default Branch: master
  • Homepage:
  • Size: 5.27 MB
Statistics
  • Stars: 73
  • Watchers: 4
  • Forks: 41
  • Open Issues: 7
  • Releases: 3
Topics
crystallography grain-boundaries high-throughput-computing linear-algebra python
Created over 7 years ago · Last pushed over 2 years ago
Metadata Files
Readme License

README.md

GB_code DOI DOI

This python package helps you create orthogonal grain boundary supercells for atomistic calculations. The code is based on the coincident site lattice (CSL) formulations for cubic materials (sc, bcc, fcc, diamond). I intend to extend it to hcp structures soon. The code produces a final structure to be read in LAMMPS or VASP.
It has been designed to be simple to use and instructive with a special attention to GB plane orientation which is often lacking in other grain boundary creation codes. For more details please read the paper.

Overview

There are two main scripts: cslgenerator.py_ and gbgenerator.py_ which you need to use in this order to produce the final grain boundary (GB) structure. These scripts are both modules (a collection of functions/classes) and can be executed from the command line. In this README I will explain the steps to use the code in the Terminal and I have also attached two jupyter notebooks (UsageofGB_code.ipynb, DichromaticpatternCSL.ipynb) in the Test directory which describe how the code can be accessed and used in the notebooks by various examples. These notebooks have extra functionality. The former is for the general usage of the code with some tips to locate GBs of interest, the latter depicts how CSL construction can be used for different purposes. You can use this link or Binder for an interactive Jupyter notebook environment provided by Binder. To use it locally, you will need python> 3.5.1 and numpy > 1.14 for the main scripts and additionally matplotlib and pandas to use the auxilliary Jupyter notebooks.

Installation guide

For installation simply clone or download the code in your terminal and in the main directory of the package type: ```

pip install . ``` This will copy the modules to your active python site-packages, thereby making them importable in any python script and will put the scrpits in the python bin, thereby making them executable in the shell.

Usage

To pick a grain boundary 5 degrees of freedom need to be fixed: rotation axis, rotation angle and GB plane orientation. We start by choosing only an axis, say a low index [1, 1, 1] and list the possibilities for the angle (sigma). Once you pick these and additionally a basis, a CSL minimal cell will be created and you can see a list of possible GB plane orientations within the CSL that you can pick from. In the jupyter notebooks, UsageofGB_code.ipynb, example criteria have been shown to help pinpoint the boundary plane of interest.

The first code cslgenerator.py_ runs in two modes:

First mode: "python CSLgenerator.py u v w [limit]" -----> Where the u v w are the indices of the rotation axis such as 1 0 0, 1 1 1, 1 1 0 and so on. The limit is the maximum Sigma of interest. (the limit by default: 100)

ex:

```

csl_generator.py 1 1 1 50

List of possible CSLs for [1 1 1] axis sorted by Sigma Sigma: 1 Theta: 0.00 Sigma: 3 Theta: 60.00 Sigma: 7 Theta: 38.21 Sigma: 13 Theta: 27.80 Sigma: 19 Theta: 46.83 Sigma: 21 Theta: 21.79 Sigma: 31 Theta: 17.90 Sigma: 37 Theta: 50.57 Sigma: 39 Theta: 32.20 Sigma: 43 Theta: 15.18 Sigma: 49 Theta: 43.57

Choose a basis, pick a sigma and use the second mode! ``` Once you pick one of these angles (sigma boundaries) you should use the second mode, decide on a basis, for ex: diamond, and list the GB planes of interest:

Second mode: "python CSLgenerator.py u v w basis sigma [limit]" -----> Where basis is either fcc, bcc, diamond or sc. You read the sigma of interest from the first mode run. The limit here refers to CSL GB inclinations. The bigger the limit, the higher the indices of CSL planes. (the limit by default: 2)

ex:

```

csl_generator.py 1 1 1 diamond 13

----------List of possible CSL planes for Sigma 13--------- GB1-------------------GB2-------------------Type----------Number of Atoms [ 2 1 -2] [ 1 2 -2] Mixed 3744 [-1 -1 -1] [-1 -1 -1] Twist 1248 [1 1 1] [1 1 1] Twist 1248 [-1 2 -2] [-2 2 -1] Mixed 3744 [ 1 -2 2] [ 2 -2 1] Mixed 3744 [-2 -1 2] [-1 -2 2] Mixed 3744 [-3 -2 1] [-2 -3 1] Mixed 2912 [ 0 -3 1] [ 1 -3 0] Mixed 2080 [ 1 3 -4] [-1 4 -3] Symmetric Tilt 1248 ... ``` Which you can write to a file if you wish.

Your chosen axis, basis and sigma will be written to an iofile (a yaml file) which will be read by gbgenerator.py. You must customize the iofile and then run the gbgenerator.py code after to get the atomic structure of the GB. This is how the io_file looks like right now:

```

input parameters for gb_generator.py

CSL plane of interest that you read from the output of csl_generator as GB1

GB_plane: [1, 1, 1]

lattice parameter in Angstrom

lattice_parameter: 4

atoms that are closer than this fraction of the lattice parameter will be removed

either from grain1 (g1) or from grain2 (g2). If you choose 0 no atoms will be removed

overlap_distance: 0.0

decide which grain the atoms should be removed from

which_g: g1

decide whether you want rigid body translations to be done on the GB_plane or not (yes or no)

When yes, for any GB aside from twist GBs, the two inplane

CSL vectors will be divided by integers a and b to produce a*b initial

configurations. The default values produce 50 initial structures

if you choose no for rigid_trans, you do not need to care about a and b.

twist boundaries are handled internally

rigid_trans: no a: 10 b: 5

dimensions of the supercell in: [l1,l2,l3], where l1 isthe direction along the GB_plane normal

and l2 and l3 are inplane dimensions

dimensions: [1,1,1]

File type, either VASP or LAMMPS input

File_type: LAMMPS

The following is your csl_generator output. YOU DO NOT NEED TO CHANGE THEM!

axis: [1, 1, 1] m: 7 n: 1 basis: diamond ``` - GBplane: must be chosen from the list that was provided after running the second mode of cslgenerator.py. Here for ex: [2, 1, -2]. Change the default plane to your chosen one. - lattice_parameter: is self-explanatory.

To minimize the grain boundary energy, microscopic degrees of freedom must be taken into account. Therefore here we allow for (1) atom removal by finding atoms that are too close to one another and (2) rigid body translations on the GB plane. (1) will be achieved by

  • overlapdistance: a fraction of lattice parameter. See the description in iofile. By default 0.0.
  • which_g: g1 or g2.

(2) will be achieved by

  • rigidtrans: yes or no. If no, the following a and b will be disregarded. For any grain boundary type except the twist boundary, the smallest inplane unit that must be scanned comprises the unitcell formed by the smallest orthogonal CSL vectors on the GB plane. These vectors will be divided by the following a and b integers to produce a grid upon which the boundary will be translated. Here a is used for the larger inplane vector and b for the smaller one. So by defalut I produce _5 * 10 = 50 initial structures to be minimized for finding the lowest energy structure. The higher your chosen a and b, the denser the grid. For the twist grain boundary the smallest unit that needs to be scanned is the unitcell created by the DSC vectors (the smallest repeat vectors of the CSL) and the code will handle it internally.
  • a: 10
  • b: 5

You can choose a combination of atom removal and rigid body translation for finding the minimum energy GB.

  • dimensions: The supercell dimensions according to the io_file. Make sure you always choose a large enough l1 dimension that the GB and its periodic image do not interact. By default [1,1,1].

  • File_type: choose either LAMMPS or VASP. By default LAMMPS.

As an example, we change the default gbplane to [2, 1, -2], overlapdistance to 0.3 and rigidtrans to 'yes' in the iofile. To produce the GB of interest we go on with: gbgenerator.py_ ```

gbgenerator.py iofile <<------ 32 atoms are being removed! ------>> <<------ 50 GB structures are being created! ------>> ``` The following is one of these 50 GBs visualized by Ovito: The color code distinguishes the diamond bulk structure as blue. The color changes gradually to green as we approach the GB atoms. In the middle lies the central GB and on both up and bottom of the cell you have halves of an equivalent GB (the periodic image).

  • A note on the microscopic degrees of freedom:

In the absence of a consensus on how to find the global minimum energy GB structure I have used atom removal and/or rigid body translations according to the description above to find the minimized structure. For rigid body translations, the smallest translation vector to guarantee the minimum energy structure is not well defined, therefore you can make the mesh as dense as you wish by choosing larger a and b values. By trial and error in fcc elemental cases (such as Al and Cu) I have come to the rule of thumb conclusion of 50 to 100 initial structures that need to be minimized to find the minimum energy GB. In the end you must find a crossover between the accuracy you need and the computational cost of running minimization on several input structures. If you are a more rigorous user, you can just create the GB structure with no atom removal or rigid body translations and run a more involved minimum energy search routine.

  • A note on the minimization procedure in LAMMPS:

I often do a three stage minimization at 0K followed by an MD annealing simulation in LAMMPS. The 0K miminimization is composed of: A conjugate gradient minimization of the energy of atoms, the simulation box and then atoms again; similar to a procedure explained here. For the annealing simulations I use an nvt ensemble followed by damped dynamics. Depending on the GB structure and your final purpose you can run annealing simulations for different time spans.

Questions/Contributions

If you have any questions, raise an issue or contact me. This project is currently under development and at the moment I am not accepting contributions from other users. Should this change in the future I'll provide detailed information on how to contribute to the project.

Citation

Feel free to use the code anyway you like, if you find it useful please cite the paper: - Hadian et al., (2018). GB code: A grain boundary generation code. Journal of Open Source Software, 3(29), 900 https://doi.org/10.21105/joss.00900 DOI

License

MIT.

Owner

  • Login: oekosheri
  • Kind: user
  • Company: rwth aachen university

Materials modelling and machine learning scientist

JOSS Publication

GB code: A grain boundary generation code
Published
September 23, 2018
Volume 3, Issue 29, Page 900
Authors
R. Hadian ORCID
Max-Planck-Institut fuer Eisenforschung, Duesseldorf, Germany
B. Grabowski ORCID
Max-Planck-Institut fuer Eisenforschung, Duesseldorf, Germany
J. Neugebauer
Max-Planck-Institut fuer Eisenforschung, Duesseldorf, Germany
Editor
Lorena A Barba ORCID
Tags
grain boundary crystallography CSL atomistic simulations (VASP LAMMPS)

GitHub Events

Total
  • Watch event: 17
  • Fork event: 5
Last Year
  • Watch event: 17
  • Fork event: 5

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 198
  • Total Committers: 2
  • Avg Commits per committer: 99.0
  • Development Distribution Score (DDS): 0.01
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
oekosheri s****n@g****m 196
Arfon Smith a****n 2

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 10
  • Total pull requests: 7
  • Average time to close issues: 12 days
  • Average time to close pull requests: 4 months
  • Total issue authors: 5
  • Total pull request authors: 6
  • Average comments per issue: 0.6
  • Average comments per pull request: 0.43
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • trallard (5)
  • SUN123RAY (2)
  • TongaoY (1)
  • ghost (1)
  • jinlhr542 (1)
Pull Request Authors
  • arfon (2)
  • jan-janssen (1)
  • nnn911 (1)
  • dependabot[bot] (1)
  • hammondkd (1)
  • liamhuber (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (1)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 38 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 1
    (may contain duplicates)
  • Total versions: 2
  • Total maintainers: 1
pypi.org: gb-code

A GB generation code

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 38 Last month
Rankings
Forks count: 7.2%
Stargazers count: 9.5%
Dependent packages count: 10.1%
Average: 18.4%
Dependent repos count: 21.6%
Downloads: 43.5%
Maintainers (1)
Last synced: 4 months ago
conda-forge.org: gb-code

This python package helps you create orthogonal grain boundary supercells for atomistic calculations. The code is based on the coincident site lattice (CSL) formulations for cubic materials (sc, bcc, fcc, diamond).

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Forks count: 31.5%
Dependent repos count: 34.0%
Average: 39.5%
Stargazers count: 41.4%
Dependent packages count: 51.2%
Last synced: 4 months ago

Dependencies

requirements.txt pypi
  • matplotlib ==2.2.2
  • numpy ==1.14.3
  • pandas ==0.23.0
setup.py pypi