18 stable releases
2.1.3 | Sep 19, 2023 |
---|---|
2.1.1 | Dec 20, 2022 |
2.0.7 | Nov 30, 2022 |
0.1.2 | Oct 17, 2022 |
#162 in Math
54KB
1.5K
SLoC
Castep-model-generator-backend
A rust-written backend lib for edit and generation of lattice 3D-models compatible with CASTEP
and Materials Studio
.
Related projects
Introduction
This library is 100% written in rust
. Currently, it has the following features:
- Place any molecules into a lattice, with necessary information provided:
- The number and identities of atoms used to coordinate with the lattice.
- The geometry information to determine the molecule direction in 3d space.
- Export the seedfiles for
CASTEP
task, supported by castep-model-core - Parallel batch processing for model edit, molecule placement onto the lattice, and exports, supported by
rayon
.- The detailed workflow for iteration is implemented by yourself.
- Configurable with
YAML
format files.
Configuration with YAML
files
This lib is designed to be controlled with specific YAML
files.
You can also hardcode the necessary information in your crate.
Project-level: The YAML
file for project level control provides the following fields:
base_model_loc
: path to the base modelmsi
file. This lattice model is used for the consequent batch editing and adsorbate placement.element_table_loc
: path to the element tableYAML
file. It will include the elements that will be involved in your project.adsorbate_table_loc
: path to the adsorbate informationYAML
file. It records the necessary information to deal with the placement of adsorbates.potentials_loc
: path to theCASTEP
potential files directory.export_loc
: path to export your results.coord_sites
: An array recording the target coordination sites that will be used in your lattice models. It has the following format for example:
Thecoord_sites: - name: c1 atom_id: 41 - name: c2 atom_id: 42
name
field is for naming your exported models. Theatom_id
field is consistent with the id inmsi
file, which is one-indexed.coord_cases
: You will describe the possible coordination cases between the lattice and adsorbates. Currently, the library is designed to handle cases with coordination atoms up to two. For example:coord_cases: - name: double cases: [[41,42], [42,54], [54,53], [53,52], [41, 40], [41, 73], [42, 73]] - name: single cases: [[41, null], [42, null], [54, null], [53, null], [52, null], [40, null], [73, null]]
Adsorbate information
This YAML
file describes the necessary information about the adsorbate, which is key to the placement workflow of adsorbates onto the lattice.
Example structures:
directory: C2_pathways_ads
Adsorbates:
- name: CO
coordAtomIds: [1]
stemAtomIds: [1,2]
# planeAtomIds missing since it has only two atoms
# plane_angle missing since it has only two atoms
stem_coord_angle: 90.0
bSym: false
upperAtomId: 2
atomNums: 2
pathName: ethylene
- name: CHO
coordAtomIds: [1]
stemAtomIds: [2, 3]
planeAtomIds: [1, 2, 3]
plane_angle: 90.0
stem_coord_angle: 90.0
bSym: false
upperAtomId: 2
atomNums: 3
pathName: ethylene
The directory
field tells the code where to locate the adsorbate msi
files. The pathName
field helps the code to find the adsorbate: Currently this lib is designed to find the adsorbate according to the path: ./{directory}/{pathName}_path/{adsorbate_name}.msi
.
Dependencies
~10MB
~200K SLoC