目標設定
CIF2Cell[1]を使って,cifファイルをPOSCARファイルに一括変換する.
[1] https://github.com/torbjornbjorkman/cif2cell
流れ
- cif2cellのインストール.
- 各cifファイルが存在するディレクトリ階層に,cifファイル名と同じ名前のディレクトリを作成.
- mk_cif_num_name_dirs.py[2]
- 入力:cif/(というディレクトリ名のパス)
- 出力:なし
- mk_cif_num_name_dirs.py[2]
-
- で作成したディレクトリに,cif2cellを用いて作成したPOSCARファイルを保存.
- mk_poscar_by_c2c.py[2]
- 入力:cif/(というディレクトリ名のパス)
- 出力:POSCARファイル
- 出力先:各cifファイル名のついたディレクトリ
[2] https://github.com/k-morii-toridai/scripts_mk_poscar_by_cif2cell.git
1.の詳細ログ
pip install git+https://github.com/torbjornbjorkman/cif2cell.git
Collecting git+https://github.com/torbjornbjorkman/cif2cell.git
Cloning https://github.com/torbjornbjorkman/cif2cell.git to /tmp/pip-req-build-9sdtwubn
Running command git clone -q https://github.com/torbjornbjorkman/cif2cell.git /tmp/pip-req-build-9sdtwubn
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Collecting PyCifRW~=4.4.0
Downloading PyCifRW-4.4.6.tar.gz (1.1 MB)
|████████████████████████████████| 1.1 MB 1.8 MB/s eta 0:00:01
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing wheel metadata ... done
Requirement already satisfied: numpy in /home/morii_k/.local/lib/python3.8/site-packages (from PyCifRW~=4.4.0->cif2cell==2.1.0) (1.24.1)
Collecting ply
Downloading ply-3.11-py2.py3-none-any.whl (49 kB)
|████████████████████████████████| 49 kB 1.7 MB/s eta 0:00:01
Building wheels for collected packages: cif2cell, PyCifRW
Building wheel for cif2cell (PEP 517) ... done
Created wheel for cif2cell: filename=cif2cell-2.1.0-py3-none-any.whl size=2060209 sha256=d29ad5522b784fa81719ff9f38f6dd42c32f2f9312552fc62eaae0f8400a6c9e
Stored in directory: /tmp/pip-ephem-wheel-cache-d3j8ojam/wheels/15/d3/60/346b10b0ab63b24b8d607b84d03734de09f0056e063edb7e21
Building wheel for PyCifRW (PEP 517) ... done
Created wheel for PyCifRW: filename=PyCifRW-4.4.6-cp38-cp38-linux_x86_64.whl size=165885 sha256=f935c89edcb2d992a6c0985cebf3cb0e483502d51733b212705af4a98dac2289
Stored in directory: /home/morii_k/.cache/pip/wheels/75/d4/b5/96cd4f6e0eed2b4d7d2d36d45040eeff1bb2331328e36e492c
Successfully built cif2cell PyCifRW
Installing collected packages: ply, PyCifRW, cif2cell
Successfully installed PyCifRW-4.4.6 cif2cell-2.1.0 ply-3.11
cif2cellがインストールできたかを確認.
which cif2cell
~/.local/bin/cif2cell
cif2cellのインストールを確認した.
2.の詳細ログ
pwd
/mnt/ssd_elecom_black_c2c_480G
ls -CF
mysql/ cif/ 'System Volume Information'/ '$RECYCLE.BIN'/ cod-cifs-mysql.txz*
mkdir scripts
ls -CF
'$RECYCLE.BIN'/ 'System Volume Information'/ cif/ cod-cifs-mysql.txz* mysql/ scripts/
cd scripts/
pwd
/mnt/ssd_elecom_black_c2c_480G/scripts
sudo git clone https://github.com/k-morii-toridai/scripts_mk_poscar_by_cif2cell.git
[sudo] password for morii-k:
Cloning into 'scripts_mk_poscar_by_cif2cell'...
remote: Enumerating objects: 10, done.
remote: Counting objects: 100% (10/10), done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 10 (delta 1), reused 10 (delta 1), pack-reused 0
Receiving objects: 100% (10/10), 7.04 MiB | 8.30 MiB/s, done.
Resolving deltas: 100% (1/1), done.
Updating files: 100% (9/9), done.
ls -CF
scripts_mk_poscar_by_cif2cell
cd scripts_mk_poscar_by_cif2cell
ls -CF
mk_cif_num_name_dirs.py* mk_poscar_by_c2c.py* sample_mk_cif_num_name_dirs.py.txt*
mk_cif_num_name_dirs.ipynb* mk_poscar_by_c2c.ipynb* mk_poscar_by_c2c_test.ipynb*
cat sample_mk_cif_num_name_dirs.py.txt
# how to use
python3 mk_cif_num_name_dirs.py
# example
python3 mk_cif_num_name_dirs.py /mnt/ssd_elecom_black_c2c_480G/cif/
time python3 mk_cif_num_name_dirs.py /mnt/ssd_elecom_black_c2c_480G/cif/
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████| 507142/507142 [19:58<00:00, 423.00it/s]
real 20m57.009s
user 3m32.095s
sys 4m56.000s
3. の詳細ログ
pwd
/mnt/ssd_elecom_black_c2c_480G/scripts/scripts_mk_poscar_by_cif2cell
ls
mk_cif_num_name_dirs.ipynb mk_poscar_by_c2c.ipynb old sample_mk_poscar_by_c2c.py.txt
mk_cif_num_name_dirs.py mk_poscar_by_c2c.py sample_mk_cif_num_name_dirs.py.txt
cat sample_mk_poscar_by_c2c.py.txt
# how to use
python3 mk_poscar_by_c2c.py
# example
python3 mk_poscar_by_c2c.py /mnt/ssd_elecom_black_c2c_480G/cif/
```terminal
time python3 mk_poscar_by_c2c.py /mnt/ssd_elecom_black_c2c_480G/cif/
len(cif_file_path_list): 507142
len(poscar_folder_path_list): 507142
Now converting cif to POSCAR by cif2cell!!!
0%|▏ | 744/507142 [01:26<27:28:36, 5.12it/s]
3%|███▎ | 15252/507142 [31:32<12:38:50, 10.80it/s]
59%|██████████████████████████████████████████████████████████████▊ | 297911/507142 [12:29:01<6:21:24, 9.14it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████| 507142/507142 [21:08:09<00:00, 6.67it/s]
it took 76089.82674360275sec to run cif2cell all files.
real 1269m14.877s
user 6540m1.022s
sys 2299m50.411s