From 50055f387e95a3af6f43c8f840132f26eecb1829 Mon Sep 17 00:00:00 2001 From: Takahiro OHKUBO Date: Sun, 23 Apr 2023 14:57:52 +0900 Subject: [PATCH] =?UTF-8?q?Readme.org=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Readme.html | 199 ++++++++++++++++++++------------------------ coeffploter.py | 2 +- example/testplot.py | 40 --------- 3 files changed, 89 insertions(+), 152 deletions(-) delete mode 100755 example/testplot.py diff --git a/Readme.html b/Readme.html index 82528f4..c22a9d7 100644 --- a/Readme.html +++ b/Readme.html @@ -3,14 +3,14 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + dump2sq - - - - - - - - - + + + + + + - + -
+

dump2sq

-
+

Table of Contents

-
+
@@ -281,9 +258,9 @@

-
-

はじめに

-
+
+

はじめに

+

複数の時間ステップからなる時間ステップの構造データから、動径分布関数 \(g(r)\) 、積算配位数 \(CN(r)\) 、構造因子 \(S(Q)\) を計算するプログラムです。 @@ -306,16 +283,16 @@ Triclinicなセルでも計算できます。原子ペア毎の\(S(Q)\) を計

-
-

入力ファイル

-
+
+

入力ファイル

+

拡張子で入力ファイルのformatを判断しています。

-
-

LAMMPS

-
+
+

LAMMPS

+

dumpコマンドで生成したファイルで、拡張子は.trajectryです。1ス テップ目で原子のならび決めて、2ステップ目以降は、同じ原子の並びとし @@ -324,22 +301,22 @@ dumpコマンドで生成したファイルで、拡張子は.trajectryです。 のため、以下のようにdumpとdump_modifyで元素記号の出力し、idでsortし ておく必要があります。

-
+
 dump              1 all custom 10 hoge.lammpstrj id type element x y z
 dump_modify       1 element Si O sort id
 
-
-

XYZ

-
+
+

XYZ

+

xyz形式で、拡張子は.xyzまたは.10です。す。1行目に原子数、2行目に Step数と、格子定数を記述しておきます。alpha, beta, gammaがない場合 は、90, 90, 90とします。3行目以降にデータがならびます。2ステップ目 以降も同じ形式でデータを並べます。

-
+
 420
 Step      225837   18.4116484 18.4116484 18.4116484 90 90 90
 Si    10.560073  17.438902  6.614775
@@ -353,41 +330,41 @@ O     17.812448   0.110128  0.3462461
 
-
-

出力ファイル

-
+
+

出力ファイル

+

4つのファイルに拡張子を追加して出力します。basenameは、指定しなけれ ば、インプットファイルと同じになります。

-
-

積算配位数

-
+
+

積算配位数

+

拡張子はcnです。原子ペア毎の \(CN(r)\) が保存されています。

-
-

動径分布関数

-
+
+

動径分布関数

+

拡張子はgrです。原子ペア毎の \(g(r)\) と全原子 \(G(r)\) が保存されています。

-
-

構造因子

-
+
+

構造因子

+

拡張子はsqです。原子ペア毎の \(S(Q)\) とX線と中性子で観測される \(S(Q)\) が保存されています。

-
-

原子散乱因子と中性子散乱長

-
+
+

原子散乱因子と中性子散乱長

+

拡張子はcoeffです。中性子散乱長と原子散乱因子を出力します。原子散乱 因子は、xcoeff.fから抽出しています。中性子散乱長は、NISTのデータを @@ -397,9 +374,9 @@ O 17.812448 0.110128 0.3462461

-
-

インストール

-
+
+

インストール

+

プログラムはCで作成しています。Cのコンパイラを準備してmakeしてください。 ダウンロードして単にmakeしてください。 @@ -409,25 +386,25 @@ O 17.812448 0.110128 0.3462461 dump2sq-1.0.tar.gz

-
+
 make
 
-
-

使い方

-
+
+

使い方

+

並列計算のために、環境変数をセットしてスレッド数を指定しておく。

-
+
 export OMP_NUM_THREADS=4
 

example以下のglass.lammpstrjを引数で渡して実行してみます。

-
+
 dump2sq example/glass.lammpstrj
 

@@ -435,7 +412,7 @@ dump2sq example/glass.lammpstrj さの半分としています。プログラムが実行されると、次のように出力されて、 4つのファイルが出力されます。

-
+
 basename: example/glass
 Maximum cell length = 17.284100
 Rmax = 8.642050
@@ -464,7 +441,7 @@ example/glass.sq was generated.
 値です。GRmaxは、セルサイズを超えても計算できますが、物理的な意味は
 ないでしょう。
 

-
+
 ./dump2sq -h
 usage: dump2sq [options] inputfile
 inputfile format
@@ -484,22 +461,22 @@ options:
 
-
-

misc

-
+
+

misc

+
-
-

coeffploter.py

-
+
+

coeffploter.py

+

元素を指定して、原子散乱因子と中性子散乱長をプロットする。

-
-

gr2sq.py

-
+
+

gr2sq.py

+

Qの刻みを変えて再計算するために、dump2sqで生成したgrファイルから S(Q)を計算しなおす。結晶のパターンを計算するために、\(2\theta\) で\(Q\) @@ -515,8 +492,8 @@ defaultで波長は、CuのK alpha線の1.54183 Åとしている。

Author: 大窪 貴洋

-

Created: 2022-08-31 水 19:16

+

Created: 2023-04-23 日 14:57

Validate

- \ No newline at end of file + diff --git a/coeffploter.py b/coeffploter.py index 2186b49..549f2d5 100755 --- a/coeffploter.py +++ b/coeffploter.py @@ -1053,7 +1053,7 @@ for a in args.atoms: ax[1].plot(df["Q"], df[f"b {a}"], label=a) ax[0].legend(loc='lower left', bbox_to_anchor=(1, 1), ncol=4) ax[0].set_xlabel("$Q/{\\rm \\AA^{-1}}$") -ax[0].set_ylabel("$F$, XRD") +ax[0].set_ylabel("$f$, XRD") ax[1].set_xlabel("$Q/{\\rm \\AA^{-1}}$") ax[1].set_ylabel("$b$, ND") diff --git a/example/testplot.py b/example/testplot.py deleted file mode 100755 index d9c6233..0000000 --- a/example/testplot.py +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env python -import numpy as np -import matplotlib.pyplot as plt - -# total ND -fig, ax = plt.subplots(nrows=2, sharex=True) -d = np.loadtxt("test.sq") -ax[0].plot(d[:, 0], d[:, -1], "-", label="dump2sq") -d = np.loadtxt("rmcp_total_nd.sq") -ax[0].plot(d[:, 0], d[:, 1], "-", label="rmc") -ax[0].legend(loc="best") - -# total XRD -d = np.loadtxt("test.sq") -ax[1].plot(d[:, 0], d[:, -2], "-", label="dump2sq") -d = np.loadtxt("rmcp_total_xrd.sq") -ax[1].plot(d[:, 0], d[:, 1], "-", label="rmc") -ax[1].legend(loc="best") - - - -# ppcf -rmc = np.loadtxt("rmcp.ppcf") -dum = np.loadtxt("test.gr") -fig, ax = plt.subplots(nrows=rmc.shape[1]-1, sharex=True) -for i in range(1, rmc.shape[1]): - ax[i-1].plot(dum[:, 0], dum[:, i], label="dump2sq") - ax[i-1].plot(rmc[:, 0], rmc[:, i], label="rmp") - -# ppcf -rmc = np.loadtxt("rmcp.psq") -dum = np.loadtxt("test.sq") -fig, ax = plt.subplots(nrows=rmc.shape[1]-1, sharex=True) -for i in range(1, rmc.shape[1]): - ax[i-1].plot(dum[:, 0], dum[:, i], label="dump2sq") - ax[i-1].plot(rmc[:, 0], rmc[:, i], label="rmp") - - - -plt.show()