アルゴンの結晶構造について
WebElements Periodic Table » Argon » crystal structures
This WebElements periodic table page contains crystal structures for the element argon
アルゴンの結晶構造作成プログラム
cat make_crystal_structure.py
stdout:
import sys
class Atom:
def __init__(self, x, y, z):
self.x = x
self.y = y
self.z = z
self.type = 1
def add_ball(r):
atoms = []
r = r
s = 5.256 # lattice constant (Å)
h = 0.5 * s
for ix in range(-r, r+1):
for iy in range(-r, r+1):
for iz in range(-r, r+1):
x = ix * s
y = iy * s
z = iz * s
atoms.append(Atom(x, y, z))
atoms.append(Atom(x, y+h, z+h))
atoms.append(Atom(x+h, y, z+h))
atoms.append(Atom(x+h, y+h, z))
print(f"{len(atoms)} atoms")
return atoms
def save_file(filename, atoms, r):
with open(filename, "w") as f:
f.write("Position Data\n\n")
f.write("{} atoms\n".format(len(atoms)))
f.write("1 atom types\n\n")
s = 5.256
f.write(f"{-r*s} {r*s} xlo xhi\n")
f.write(f"{-r*s} {r*s} ylo yhi\n")
f.write(f"{-r*s} {r*s} zlo zhi\n")
f.write("\n")
f.write("Atoms\n\n")
for i, a in enumerate(atoms):
f.write("{} {} {} {} {}\n".format(i+1, a.type, a.x, a.y, a.z))
print("Generated {}".format(filename))
args = sys.argv
r = int(args[1])
save_file(f"config.atoms", add_ball(r=r), r=r)
アルゴンの結晶構造作成
コマンド:
python3 make_crystal_structure.py <number of grid iterations>
実行ログ:
python3 make_crystal_structure.py 2
stdout:
500 atoms
Generated config.atoms
可視化して検証
OVITOをインストール
OVITO ??? Scientific data visualization and analysis software
???? Scientific data visualization and analysis software for particle-based simulation models
OVITOを用いて可視化
config.atomsをOVITOで開く.
アルゴンの結晶構造が作成できたようだ.
コメント