Python Organic Crystal Simulation Environment
Project description
Python Organic Crystal Simulation Environment (PYOCSE)
This is a public repository that aims to automate the simulation of organic crystals with a primary emphasis on the mechanical properties of organic crystals. Currently, we focus on two components:
- Automate the geneation of structural model and force field (through
ambertoolsoropenff) - Design different workflows to simulate the properties of organic crystals under mechanical loads (powered by
lammps)
Python Setup
git clone this repository and then go to the root directory
conda env create -n pyocse
conda activate pyocse
pip install .
If you want to update the existing ocse enviroment
conda activate pyocse
conda env update --file environment.yml
LAMMPS Setup:
make yes-MOLECULE
make yes-EXTRA-MOLECULE
make yes-KSPACE
make mpi -j 12
Examples
- Add your structure to the database
# Find your structure from https://www.ccdc.cam.ac.uk/structures/Search?
tag = {
"csd_code": 'ACSALA',
"ccdc_number": 1101020,
"smiles": "CC(=O)OC1=CC=CC=C1C(O)=O",
}
# Load the pyxtal structure
from pyxtal import pyxtal
xtal = pyxtal(molecular=True)
xtal.from_seed(str(tag['ccdc_number'])+'.cif',
molecules=[str(tag['smiles'])+'.smi'])
xtal.tag = tag
print(xtal)
# Deposit your structure
from pyxtal.db import make_entry_from_pyxtal, database
entry = make_entry_from_pyxtal(xtal)
db = database('dataset/mech.db')
db.add(entry)
- 3D periodic boundary condictions (shearing/tensile/compression)
from pyocse.build import Builder
from pyxtal.db import database
import numpy as np
import os
# Set the crystal model
data = [
('ACSALA', [[1,0,0], [0,1,0], [0,0,1]]),
]
style = 'openff' #'gaff'
db = database('dataset/mech.db')
# Define your desired dimension
dim = [100, 40, 40]
# Prepare the lammps input files
for d in data:
(code, matrix) = d
matrix = np.array(matrix)
print(code)
xtal = db.get_pyxtal(code)
smiles = [mol.smile for mol in xtal.molecules]
bu = Builder(smiles=smiles, style=style)
bu.set_xtal(xtal, para_min=10.0)
# Directory
folder = code + '-' + style
if not os.path.exists(folder): os.makedirs(folder)
cwd = os.getcwd()
os.chdir(folder)
# Example 1: tensile, assuming z direction
task1 = {'type': 'tensile',
'temperature': 300,
'pressure': 1.0,
'max_strain': 0.1,
'rate': 1e+8,
}
bu.set_slab(bu.xtal, bu.xtal_mol_list, matrix=matrix, dim=dim)
print('Supercell: ', bu.ase_slab.get_cell_lengths_and_angles())
bu.set_task(task1)
bu.lammps_slab.write_lammps()
# Just for a quick view from VESTA
bu.ase_slab.write('test.xyz', format='extxyz')
os.chdir(cwd)
You can check the details in misc/uniaxial.py
Contacts:
- Qiang Zhu (qzhu8@uncc.edu)
- Shinnosuke Hattori (shinnosuke.hattori@sony.com)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyocse-0.1.3.tar.gz.
File metadata
- Download URL: pyocse-0.1.3.tar.gz
- Upload date:
- Size: 95.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c837ac595a374e46335df23935925ba3f7872f0a06bf835e1e10618eca81408f
|
|
| MD5 |
8a76be804a378669f871856db1d6e26b
|
|
| BLAKE2b-256 |
225a6309ee1bdb595554ae916678edc497b65368a0eef2db2c0622e268f7aeff
|
File details
Details for the file pyocse-0.1.3-py3-none-any.whl.
File metadata
- Download URL: pyocse-0.1.3-py3-none-any.whl
- Upload date:
- Size: 114.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
057a423908b0f157b3f3fae6388add6dc2ddbb16451845683375a2672e4cd217
|
|
| MD5 |
f67682f4f0267d9b958cf568b2d76140
|
|
| BLAKE2b-256 |
5573ed618d79594e1ed6ef993ae900ffd78d3a02d6ec0a649f79233d2bff5a87
|