Aditya Wibawa Sakti 2 years ago
parent b16ab9e31c
commit b482cc2368
  1. BIN
      .README.md.swp
  2. 48
      cmmde_gui/geom.xyz
  3. 30
      cmmde_gui/gui.py

Binary file not shown.

@ -1,38 +1,10 @@
Al12 O18 8
1.0 Diisi judulpun tidak masalah
4.805028 0.000000 0.000000 C -1.09158 0.31253 0.00000
-2.402514 4.161276 0.000000 C 0.40641 0.34539 0.00000
0.000000 0.000000 13.116254 O 0.99388 1.41528 -0.00000
Al O O 1.11593 -0.80223 0.00000
12 18 H -1.50826 1.34248 0.00000
direct H -1.45092 -0.22036 0.90489
0.000000 0.000000 0.147904 Al H -1.45092 -0.22036 -0.90489
0.333333 0.666667 0.018763 Al H 0.67957 -1.66578 0.00000
0.333333 0.666667 0.314571 Al
0.666667 0.333333 0.185429 Al
0.666667 0.333333 0.481237 Al
0.000000 0.000000 0.352096 Al
0.000000 0.000000 0.647904 Al
0.333333 0.666667 0.518763 Al
0.333333 0.666667 0.814571 Al
0.666667 0.333333 0.685429 Al
0.666667 0.333333 0.981237 Al
0.000000 0.000000 0.852096 Al
0.306146 0.000000 0.250000 O
0.666667 0.027187 0.083333 O
0.000000 0.306146 0.250000 O
0.693854 0.693854 0.250000 O
0.972813 0.639479 0.083333 O
0.360521 0.333333 0.083333 O
0.972813 0.333333 0.583333 O
0.333333 0.360521 0.416667 O
0.666667 0.639479 0.583333 O
0.360521 0.027187 0.583333 O
0.639479 0.972813 0.416667 O
0.027187 0.666667 0.416667 O
0.639479 0.666667 0.916667 O
0.000000 0.693854 0.750000 O
0.333333 0.972813 0.916667 O
0.027187 0.360521 0.916667 O
0.306146 0.306146 0.750000 O
0.693854 0.000000 0.750000 O

@ -29,7 +29,7 @@ def cmmde_gui():
# Terminal widget # Terminal widget
TextArea= pn.widgets.TextAreaInput(value = "Computational Molecular and Material Design Environment\n Authors:\n Universitas Pertamina\n Institut Teknologi Sumatera\n Masyarakat Komputasi Indonesia\n\nSupported by:\n Konsorsium Pengembangan Sains Komputasi", TextArea= pn.widgets.TextAreaInput(value = "Computational Molecular and Material Design Environment\n Authors:\n Universitas Pertamina\n Institut Teknologi Sumatera\n Masyarakat Komputasi Indonesia\n\nSupported by:\n Konsorsium Pengembangan Sains Komputasi\n",
height = 500, disabled=True height = 500, disabled=True
) )
# CMMDE software options # CMMDE software options
@ -52,7 +52,7 @@ def cmmde_gui():
# File input (if you don't want to draw the structure) # File input (if you don't want to draw the structure)
FileInput = pn.widgets.FileInput(title='Input structure',accept='.xyz, .vasp, CONTCAR, POSCAR, .pdb') FileInput = pn.widgets.FileInput(title='Input structure',accept='.xyz,.vasp,.pdb')
def fileinput(event): def fileinput(event):
if FileInput.value is not None: if FileInput.value is not None:
FileInput.save("geom.xyz") FileInput.save("geom.xyz")
@ -75,11 +75,13 @@ def cmmde_gui():
job_list = [job[i] for i in job_btn.value] job_list = [job[i] for i in job_btn.value]
jobs = ",".join(job_list) jobs = ",".join(job_list)
if editor == JSMEEditor(value=" "):
geom = save(FileInput.filename) if editor.value == "":
FileInput.save("geom.xyz")
geom = "geom.xyz"
else: else:
geom = editor.value geom = editor.value
TextArea.value = TextArea.value + "\n" + "Mempersiapkan Struktur 3 Dimensi!" TextArea.value = TextArea.value + "\n" + "Mempersiapkan Struktur 3 Dimensi!"
cmd = subprocess.run(["cmmde.py","-i","{}".format(geom),"-s","{}".format(software[software_btn.value]),"-j","{}".format(jobs),"-m","{}".format(method[method_btn.value]),"-c","{}".format(charge.value),"-mult","{}".format(mult.value)],capture_output=True,text=True) cmd = subprocess.run(["cmmde.py","-i","{}".format(geom),"-s","{}".format(software[software_btn.value]),"-j","{}".format(jobs),"-m","{}".format(method[method_btn.value]),"-c","{}".format(charge.value),"-mult","{}".format(mult.value)],capture_output=True,text=True)
#terminal.subprocess.run("cmmde.py","-i{}".format(editor.value),"-s{}".format(software[software_btn.value]), "-j{}".format(jobs), "-m{}".format(method[method_btn.value])) #terminal.subprocess.run("cmmde.py","-i{}".format(editor.value),"-s{}".format(software[software_btn.value]), "-j{}".format(jobs), "-m{}".format(method[method_btn.value]))
@ -169,10 +171,16 @@ def cmmde_gui():
layer_input = pn.widgets.TextInput(name="Layer",placeholder="Example: 2") layer_input = pn.widgets.TextInput(name="Layer",placeholder="Example: 2")
slabbuilder_btn = pn.widgets.Button(name="Build it!",button_type="primary") slabbuilder_btn = pn.widgets.Button(name="Build it!",button_type="primary")
Material_input = pn.widgets.TextInput(name="Material name") Material_input = pn.widgets.TextInput(name="Material name")
Material_upload = pn.widgets.FileInput(title='Input structure')
def materialinput(event):
if Material_upload.value is not None:
Material_upload.save("POSCAR")
Material_upload.param.watch(materialinput,'value')
# Generate material folder button # Generate material folder button
materialdir_btn = pn.widgets.Button(name="Generate work directory",type="primary") materialdir_btn = pn.widgets.Button(name="Generate work directory",type="primary")
TextWarning = pn.widgets.StaticText()
def materialgen(event): def materialgen(event):
Folder = workdir + "/" + id_input.value + "/" + Material_input.value Folder = workdir + "/" + id_input.value + "/" + Material_input.value
isExist = os.path.exists(Folder) isExist = os.path.exists(Folder)
@ -185,9 +193,9 @@ def cmmde_gui():
materialdir_btn.on_click(materialgen) materialdir_btn.on_click(materialgen)
def slab_builder(event): def slab_builder(event):
Folder = workdir + "/" + id_input.value + "/" + Molecule_input.value Folder = workdir + "/" + id_input.value + "/" + Material_input.value
os.chdir(Folder) os.chdir(Folder)
os.system("mv geom.xyz POSCAR") # os.system("mv geom.xyz POSCAR")
hkl = hkl_input.value hkl = hkl_input.value
size = size_input.value size = size_input.value
layer = layer_input.value layer = layer_input.value
@ -257,8 +265,8 @@ def cmmde_gui():
return pn.template.MaterialTemplate( return pn.template.MaterialTemplate(
site="CMMDE-GUI", site="CMMDE-GUI",
title="CMMDE Editor", title="CMMDE Editor",
main=[editor, TextArea, pn.Tabs(xyzviewer)], main=[TextArea, editor, xyzviewer],
sidebar=[pn.Card(id_input,title="User Information",collapsed=True),pn.Card(Molecule_input,charge,mult,checkdir_btn,TextWarning,pn.Card(FileInput,title="Upload molecule",collapsed=True),title="Molecule Information",collapsed=True),pn.Card(Material_input, materialdir_btn, pn.Card(FileInput,title="Unit cell",collapsed=True),hkl_input,size_input,layer_input,pn.Row(slabbuilder_btn,visual_btn),pn.Row(download_xyz,download_slab),title="Surface Builder",collapsed=True),pn.Card(pn.Card(software_btn,job_btn,method_btn,pn.Row(Run_btn,Progress_btn),pn.Row(Checkcalc_btn,visual_btn),title="General calculation",collapsed=True),title="Main Calculation",collapsed=True),pn.Card(post_software_btn,post_btn,post_method_btn,pn.Row(runpost_btn,Progress_btn),pn.Row(Checkcalc_btn,visual_btn),title="Post-Calculation",collapsed=True)], sidebar=[pn.Card(id_input,title="User Information",collapsed=True),pn.Card(Molecule_input,charge,mult,checkdir_btn,TextWarning,pn.Card(FileInput,title="Upload molecule",collapsed=True),title="Molecule Information",collapsed=True),pn.Card(Material_input, materialdir_btn,TextWarning, pn.Card(FileInput,title="Unit cell",collapsed=True),hkl_input,size_input,layer_input,pn.Row(slabbuilder_btn,visual_btn),pn.Row(download_xyz,download_slab),title="Surface Builder",collapsed=True),pn.Card(software_btn,job_btn,method_btn,pn.Row(Run_btn,Progress_btn),pn.Row(Checkcalc_btn,visual_btn),title="Main Calculation",collapsed=True),pn.Card(post_software_btn,post_btn,post_method_btn,pn.Row(runpost_btn,Progress_btn),pn.Row(Checkcalc_btn,visual_btn),title="Post-Calculation",collapsed=True)],
header_background=accent, accent_base_color=accent header_background=accent, accent_base_color=accent
) )

Loading…
Cancel
Save