-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
5,898 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Set a branch name to trigger deployment | ||
pull_request: | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-22.04 | ||
permissions: | ||
contents: write | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true # Fetch Hugo themes (true OR recursive) | ||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | ||
|
||
- name: Setup Hugo | ||
uses: peaceiris/actions-hugo@v2 | ||
with: | ||
hugo-version: '0.110.0' | ||
|
||
- name: Build | ||
run: hugo --minify | ||
|
||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
# If you're changing the branch from main, | ||
# also change the `main` in `refs/heads/main` | ||
# below accordingly. | ||
if: github.ref == 'refs/heads/main' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./public |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
#!/usr/bin/env python | ||
''' | ||
Relaxes structure using ASE while retaining symmetry. Requires ASE>=3.23 | ||
Relaxes both atoms and cell coordinates simultaneously. | ||
Author: [email protected] | ||
''' | ||
from typing import Dict, Optional | ||
import ase.optimize | ||
from ase.constraints import ExpCellFilter | ||
from ase.spacegroup.symmetrize import FixSymmetry | ||
from ase.io.trajectory import Trajectory | ||
from asimtools.calculators import load_calc | ||
from asimtools.utils import get_atoms | ||
|
@@ -22,9 +21,9 @@ def optimize( | |
) -> Dict: | ||
"""Relaxes cell (and atoms) using ase.constraints.ExpCellFilter while retaining symmetry | ||
:param calc_id: calc_id in calc_input.yaml | ||
:param calc_id: calc_id specification | ||
:type calc_id: str | ||
:param image: image specification | ||
:param image: Image specification, see :func:`asimtools.utils.get_atoms` | ||
:type image: Dict | ||
:param optimizer: Any optimizer from ase.optimize, defaults to 'BFGS' | ||
:type optimizer: str, optional | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
Author: [email protected] | ||
''' | ||
from typing import Dict | ||
from typing import Dict, Optional | ||
from pathlib import Path | ||
import subprocess | ||
import logging | ||
|
@@ -15,14 +15,34 @@ | |
|
||
def lammps( | ||
template: str, | ||
image: Dict = None, | ||
image: Optional[Dict] = None, | ||
prefix: str = '', | ||
atom_style: str = 'atomic', | ||
variables: Dict = None, | ||
variables: Optional[Dict] = None, | ||
lmp_cmd: str = 'lmp', | ||
masses: bool = True, | ||
) -> Dict: | ||
''' | ||
"""Runs a lammps script based on a specified template, variables can be | ||
specified as arguments to be defined in the final LAMMPS input file if | ||
placeholders are put in the template | ||
:param template: path to lammps input template file | ||
:type template: str | ||
:param image: Image specification, see :func:`asimtools.utils.get_atoms`, defaults to None | ||
:type image: Dict, optional | ||
:param prefix: Prefix to be added to input file, defaults to '' | ||
:type prefix: str, optional | ||
:param atom_style: LAMMPS style in which to write image to Lammps data input e.g. full, atomic etc., defaults to 'atomic' | ||
:type atom_style: str, optional | ||
:param variables: Dictionary of variables to be defined into the lammps input, defaults to None | ||
:type variables: Dict, optional | ||
:param lmp_cmd: Command with which to run LAMMPS, defaults to 'lmp' | ||
:type lmp_cmd: str, optional | ||
:param masses: Whether to specify atomic masses in LAMMPS data input, requires ASE>3.23.0, defaults to True | ||
:type masses: bool, optional | ||
:return: LAMMPS out file names | ||
:rtype: Dict | ||
""" ''' | ||
Runs a lammps simulation based on a template lammps input script | ||
''' | ||
if variables is None: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
#!/usr/bin/env python | ||
''' | ||
Describe the asimmodule briefly here. If this is a asimmodule that runs multiple steps, | ||
describe it here using reStructuredText to generate autodocs | ||
Cite the papers where the method/asimmodule was first introduced here as well | ||
Calculates surface energies of slabs defined by args specified for | ||
pymatgen.core.surface.generate_all_slabs() | ||
Author: [email protected] | ||
''' | ||
|
@@ -38,16 +36,32 @@ def get_surface_energy(slab, calc, bulk_e_per_atom): | |
return converged, surf_en, slab_en, area | ||
|
||
def surface_energies( | ||
image: Dict, | ||
calc_id: str, | ||
image: Dict, | ||
millers: Union[str,Sequence] = 'all', | ||
atom_relax_args: Optional[Dict] = None, | ||
generate_all_slabs_args: Optional[Dict] = None, | ||
) -> Dict: | ||
''' | ||
Calculates surface energies of slabs defined by args specified for | ||
"""Calculates surface energies of slabs defined by args specified for | ||
pymatgen.core.surface.generate_all_slabs() | ||
''' | ||
:param calc_id: calc_id specification | ||
:type calc_id: str | ||
:param image: Image specification, see :func:`asimtools.utils.get_atoms` | ||
:type image: Dict | ||
:param millers: List of miller indices to consider in the form 'xyz', | ||
defaults to 'all' | ||
:type millers: Union[str,Sequence], optional | ||
:param atom_relax_args: Args to pass to | ||
:func:`asimtools.asimmodules.geometry_optimization.atom_relax.atom_relax`, | ||
defaults to None | ||
:type atom_relax_args: Optional[Dict], optional | ||
:param generate_all_slabs_args: Args to pass to | ||
:func:`pymatgen.core.surface.generate_all_slabs`, defaults to None | ||
:type generate_all_slabs_args: Optional[Dict], optional | ||
:return: _description_ | ||
:rtype: Dict | ||
""" | ||
|
||
calc = load_calc(calc_id) | ||
bulk = get_atoms(**image) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
#!/usr/bin/env python | ||
''' | ||
Describe the asimmodule briefly here. If this is a asimmodule that runs multiple steps, | ||
describe it here using reStructuredText to generate autodocs | ||
Cite the papers where the method/asimmodule was first introduced here as well | ||
Calculates the monovacancy formation energy from a bulk structure | ||
Author: [email protected] | ||
''' | ||
|
@@ -23,6 +20,24 @@ def vacancy_formation_energy( | |
atom_relax_args: Optional[Dict] = None, | ||
repeat: Optional[Sequence] = None | ||
) -> Dict: | ||
"""Calculates the monovacancy formation energy from a bulk structure | ||
:param calc_id: calc_id specification | ||
:type calc_id: str | ||
:param image: Image specification, see :func:`asimtools.utils.get_atoms` | ||
:type image: Dict | ||
:param vacancy_index: Index of atom to remove, defaults to 0 | ||
:type vacancy_index: int, optional | ||
:param atom_relax_args: Args to pass to | ||
:func:`asimtools.asimmodules.geometry_optimization.atom_relax.atom_relax`, | ||
defaults to None | ||
:type atom_relax_args: Optional[Dict], optional | ||
:param repeat: Repeat to apply to image to create supercell, defaults to | ||
None | ||
:type repeat: Optional[Sequence], optional | ||
:return: Empty dictionary | ||
:rtype: Dict | ||
""" | ||
|
||
calc = load_calc(calc_id) | ||
bulk = get_atoms(**image).repeat(repeat) | ||
|
Oops, something went wrong.