diff --git a/atomrdf/workflow/pyiron/vasp.py b/atomrdf/workflow/pyiron/vasp.py index 4b795ff..4732283 100644 --- a/atomrdf/workflow/pyiron/vasp.py +++ b/atomrdf/workflow/pyiron/vasp.py @@ -99,17 +99,50 @@ def identify_method(job, method_dict): method_dict['method'] = method method_dict['dof'] = dof - encut = mdict['ENCUT'] - method_dict['encut'] = encut - + inputs = [] + inputs.append( + { + "label": "EnergyCutoff", + "value": encut, + "unit": "EV", + } + ) + indf = job.input.to_dict()['kpoints/data_dict'] params = indf['Parameter'] vals = indf['Value'] kpoint_type = vals[2] kpoint_grid = vals[3] - method_dict['kpoint_type'] = kpoint_type - method_dict['kpoint_grid'] = kpoint_grid + + if kpoint_type == 'Monkhorst-pack': + inputs.append( + { + "label": "MonkhorstPackKPointMesh", + "value": kpoint_grid, + } + ) + elif kpoint_type == 'Gamma': + inputs.append( + { + "label": "GammaCenteredKPointMesh", + "value": kpoint_grid, + } + ) + elif kpoint_type in ['Reciprocal', 'Cartesian']: + inputs.append( + { + "label": "ExplicitKPointMesh", + "value": kpoint_grid, + } + ) + else: + inputs.append( + { + "label": "KPointMesh", + "value": kpoint_grid, + } + ) indf = job.input.to_dict()['potcar/data_dict'] xc = indf['Value'][0] @@ -153,39 +186,19 @@ def extract_calculated_quantities(job, method_dict): ) outputs.append( { - "label": "TotalVolume", - "value": np.round(job.output.volume[-1], decimals=5), - "unit": "ANGSTROM3", - "associate_to_sample": True, - } - ) - structure = job.get_structure(frame=-1) - lx = np.linalg.norm(structure.cell[0]) - ly = np.linalg.norm(structure.cell[1]) - lz = np.linalg.norm(structure.cell[2]) - - outputs.append( - { - "label": "SimulationCellLength_x", - "value": np.round(lx, decimals=4), - "unit": "ANGSTROM", + "label": "PotentialEnergy", + "value": np.round(job.output.energy_pot[-1], decimals=5), + "unit": "EV", "associate_to_sample": True, } ) outputs.append( { - "label": "SimulationCellLength_y", - "value": np.round(ly, decimals=4), - "unit": "ANGSTROM", + "label": "Volume", + "value": np.round(job.output.volume[-1], decimals=5), + "unit": "ANGSTROM3", "associate_to_sample": True, } ) - outputs.append( - { - "label": "SimulationCellLength_z", - "value": np.round(lz, decimals=4), - "unit": "ANGSTROM", - "associate_to_sample": True, - } - ) + method_dict['outputs'] = outputs \ No newline at end of file diff --git a/examples/workflow_examples/02_vasp.ipynb b/examples/workflow_examples/02_vasp.ipynb index 5f31989..b29758b 100644 --- a/examples/workflow_examples/02_vasp.ipynb +++ b/examples/workflow_examples/02_vasp.ipynb @@ -22,7 +22,7 @@ { "data": { "application/vnd.jupyter.widget-view+json": { - "model_id": "fe747ff19deb48f78e4a3641d148c6c1", + "model_id": "7d2179bc22d84ea8a30013374dbdad2c", "version_major": 2, "version_minor": 0 }, @@ -43,7 +43,7 @@ "metadata": {}, "outputs": [], "source": [ - "pr = Project('wfy1')" + "pr = Project('wfy1e')" ] }, { @@ -63,7 +63,7 @@ "output_type": "stream", "text": [ "fccSi fccSi\n", - "job was stored with the job ID 468\n" + "job was stored with the job ID 1199\n" ] } ], @@ -117,14 +117,14 @@ " \n", " \n", " 0\n", - " 468\n", + " 1199\n", " finished\n", " Si\n", " fccSi\n", " /fccSi\n", " None\n", - " /mnt/c/Users/menon/Documents/repos/projects-iuc17/atomRDF/examples/workflow_examples/wfy1/\n", - " 2024-05-08 16:32:24.518895\n", + " /mnt/c/Users/menon/Documents/repos/projects-iuc17/atomRDF/examples/workflow_examples/wfy1e/\n", + " 2024-10-21 11:32:41.253871\n", " None\n", " None\n", " pyiron@cmleo26#1\n", @@ -138,14 +138,14 @@ "" ], "text/plain": [ - " id status chemicalformula job subjob projectpath \\\n", - "0 468 finished Si fccSi /fccSi None \n", + " id status chemicalformula job subjob projectpath \\\n", + "0 1199 finished Si fccSi /fccSi None \n", "\n", - " project \\\n", - "0 /mnt/c/Users/menon/Documents/repos/projects-iuc17/atomRDF/examples/workflow_examples/wfy1/ \n", + " project \\\n", + "0 /mnt/c/Users/menon/Documents/repos/projects-iuc17/atomRDF/examples/workflow_examples/wfy1e/ \n", "\n", " timestart timestop totalcputime computer hamilton \\\n", - "0 2024-05-08 16:32:24.518895 None None pyiron@cmleo26#1 Vasp \n", + "0 2024-10-21 11:32:41.253871 None None pyiron@cmleo26#1 Vasp \n", "\n", " hamversion parentid masterid \n", "0 None None None " @@ -162,13 +162,33 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "job = pr.load('fccSi')" ] }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "(array([-4.87738472]), array([-4.87738472]))" + ] + }, + "execution_count": 12, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "job.output.energy_tot, job.output.energy_pot" + ] + }, { "cell_type": "code", "execution_count": 6, @@ -683,7 +703,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.1.-1" + "version": "3.11.10" } }, "nbformat": 4,