From 79faa39102c5fcaa3b1d0b86176182ba5820ab26 Mon Sep 17 00:00:00 2001 From: Waikit Chan <37867949+BaozCWJ@users.noreply.github.com> Date: Thu, 20 Jun 2019 21:22:16 +0800 Subject: [PATCH 01/11] Delete ovito_file_convert.py --- auto_test/lib/ovito_file_convert.py | 49 ----------------------------- 1 file changed, 49 deletions(-) delete mode 120000 auto_test/lib/ovito_file_convert.py diff --git a/auto_test/lib/ovito_file_convert.py b/auto_test/lib/ovito_file_convert.py deleted file mode 120000 index aa88fa457..000000000 --- a/auto_test/lib/ovito_file_convert.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env ovitos -''' -This Script is adapted from Alexander Stukowski, the author of OVITO. -See: http://forum.ovito.org/index.php?topic=131.0 for details. -''' -import os -import sys -import argparse -import numpy as np - -from ovito.io import * - -supp_ofmt = ['lammps_dump', 'lammps_data', 'vasp'] -supp_exts = ['dump', 'lmp', 'poscar/POSCAR'] - -parser = argparse.ArgumentParser() -parser.add_argument("-m", "--ofmt", type=str, - help="the output format, supported: " + str(supp_ofmt)) -parser.add_argument("INPUT", type=str, - help="the input file") -parser.add_argument("OUTPUT", type=str, - help="the output file, supported ext: " + str(supp_exts)) -args = parser.parse_args() - -fin = args.INPUT -fout = args.OUTPUT -if args.ofmt is not None : - ofmt = args.ofmt -else : - ext = fout.split('.')[-1] - if ext == 'dump' : - ofmt = 'lammps_dump' - elif ext == 'lmp' : - ofmt = 'lammps_data' - elif ext == 'poscar' or ext == 'POSCAR' : - ofmt = 'vasp' -if not ofmt in supp_ofmt : - raise RuntimeError ("output format " + ofmt + " is not supported. use one of " + str(supp_ofmt)) - -columns = None -if ofmt == "lammps_dump" : - columns=["Particle Identifier", "Particle Type", "Position.X", "Position.Y", "Position.Z"] - -node = import_file(fin) -if columns is not None : - export_file(node, fout, ofmt, columns = columns) -else : - export_file(node, fout, ofmt) - From 5564b6358383afe7f33e00c8276de4c7f555f3cc Mon Sep 17 00:00:00 2001 From: Waikit Chan <37867949+BaozCWJ@users.noreply.github.com> Date: Thu, 20 Jun 2019 21:22:36 +0800 Subject: [PATCH 02/11] Create ovito_file_convert.py --- auto_test/lib/ovito_file_convert.py | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 auto_test/lib/ovito_file_convert.py diff --git a/auto_test/lib/ovito_file_convert.py b/auto_test/lib/ovito_file_convert.py new file mode 100644 index 000000000..21ad0dcdd --- /dev/null +++ b/auto_test/lib/ovito_file_convert.py @@ -0,0 +1,48 @@ +#!/usr/bin/env ovitos +''' +This Script is adapted from Alexander Stukowski, the author of OVITO. +See: http://forum.ovito.org/index.php?topic=131.0 for details. +''' +import os +import sys +import argparse +import numpy as np + +from ovito.io import * + +supp_ofmt = ['lammps_dump', 'lammps_data', 'vasp'] +supp_exts = ['dump', 'lmp', 'poscar/POSCAR'] + +parser = argparse.ArgumentParser() +parser.add_argument("-m", "--ofmt", type=str, + help="the output format, supported: " + str(supp_ofmt)) +parser.add_argument("INPUT", type=str, + help="the input file") +parser.add_argument("OUTPUT", type=str, + help="the output file, supported ext: " + str(supp_exts)) +args = parser.parse_args() + +fin = args.INPUT +fout = args.OUTPUT +if args.ofmt is not None : + ofmt = args.ofmt +else : + ext = fout.split('.')[-1] + if ext == 'dump' : + ofmt = 'lammps_dump' + elif ext == 'lmp' : + ofmt = 'lammps_data' + elif ext == 'poscar' or ext == 'POSCAR' : + ofmt = 'vasp' +if not ofmt in supp_ofmt : + raise RuntimeError ("output format " + ofmt + " is not supported. use one of " + str(supp_ofmt)) + +columns = None +if ofmt == "lammps_dump" : + columns=["Particle Identifier", "Particle Type", "Position.X", "Position.Y", "Position.Z"] + +node = import_file(fin) +if columns is not None : + export_file(node, fout, ofmt, columns = columns) +else : + export_file(node, fout, ofmt) From d4104409ea7f78284ac166b82190db5c5bbb7080 Mon Sep 17 00:00:00 2001 From: Waikit Chan <37867949+BaozCWJ@users.noreply.github.com> Date: Thu, 20 Jun 2019 22:11:41 +0800 Subject: [PATCH 03/11] Update machine.json --- auto_test/machine.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auto_test/machine.json b/auto_test/machine.json index d23e425b9..d879f1e59 100644 --- a/auto_test/machine.json +++ b/auto_test/machine.json @@ -5,7 +5,7 @@ "hostname" : "localhost", "port" : 22, "username": "username", - "password": "password", + "password": "password", "work_path" : "the path of workplace", "_comment" : "that's all" }, @@ -28,7 +28,7 @@ "hostname" : "localhost", "port" : 22, "username": "username", - "password": "password", + "password": "password", "work_path" : "the path of workplace", "_comment" : "that's all" }, From 39596cb2727f0fe6df796a15d6e73682d7c8a63c Mon Sep 17 00:00:00 2001 From: Waikit Chan <37867949+BaozCWJ@users.noreply.github.com> Date: Thu, 20 Jun 2019 22:27:20 +0800 Subject: [PATCH 04/11] Update README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index c8481cb32..8b7596c1b 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,9 @@ # dpgen The deep potential generator +## generator +## auto_test +In this step, we assume that you have prepared some graph files like `graph.*.pb` and the particular pseudopotential `POTCAR`. +Then you only need one command to achieve automatic testing of physical properties. +``` +python run.py param.json machine.json +``` From 4dff664a74b7a5445fa986a8ca49f6a309686a66 Mon Sep 17 00:00:00 2001 From: Waikit Chan <37867949+BaozCWJ@users.noreply.github.com> Date: Thu, 20 Jun 2019 22:29:39 +0800 Subject: [PATCH 05/11] Update README.md --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8b7596c1b..a98790a26 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ # dpgen The deep potential generator -## generator -## auto_test +>## generator +>## auto_test In this step, we assume that you have prepared some graph files like `graph.*.pb` and the particular pseudopotential `POTCAR`. Then you only need one command to achieve automatic testing of physical properties. ``` python run.py param.json machine.json ``` +>>### How to write `param.json` + +>>### How to write `machine.json` From 0b8ffd3c90a660de3d84ed6f98aba08aece2634d Mon Sep 17 00:00:00 2001 From: Waikit Chan <37867949+BaozCWJ@users.noreply.github.com> Date: Thu, 20 Jun 2019 22:44:49 +0800 Subject: [PATCH 06/11] Update README.md --- README.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a98790a26..91cf1503d 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,21 @@ -# dpgen +dpgen Manual +======== + +# Table of contents +- [About dpgen](#About-dpgen) +- [genenrator](#generator) +- [auto_test](#auto_test) + - [How to write `param.json`](##How-to-write-`param.json`) + - [How to write `machine.json`](##How-to-write-`machine.json`) +# About dpgen The deep potential generator ->## generator ->## auto_test -In this step, we assume that you have prepared some graph files like `graph.*.pb` and the particular pseudopotential `POTCAR`. +# generator +# auto_test +At this step, we assume that you have prepared some graph files like `graph.*.pb` and the particular pseudopotential `POTCAR`. Then you only need one command to achieve automatic testing of physical properties. ``` python run.py param.json machine.json ``` ->>### How to write `param.json` +## How to write `param.json` ->>### How to write `machine.json` +## How to write `machine.json` From 250906de2052535a771b330397eae2111b59290d Mon Sep 17 00:00:00 2001 From: Waikit Chan <37867949+BaozCWJ@users.noreply.github.com> Date: Thu, 20 Jun 2019 22:47:23 +0800 Subject: [PATCH 07/11] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 91cf1503d..21f48f601 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ - [auto_test](#auto_test) - [How to write `param.json`](##How-to-write-`param.json`) - [How to write `machine.json`](##How-to-write-`machine.json`) +- [Troubleshooting](#Troubleshooting) # About dpgen The deep potential generator # generator @@ -19,3 +20,5 @@ python run.py param.json machine.json ## How to write `param.json` ## How to write `machine.json` + +# Troubleshooting From eb028fa4559b7bdab353a334128175e000c60109 Mon Sep 17 00:00:00 2001 From: Waikit Chan <37867949+BaozCWJ@users.noreply.github.com> Date: Thu, 20 Jun 2019 22:51:47 +0800 Subject: [PATCH 08/11] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 21f48f601..f2283cce9 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ Then you only need one command to achieve automatic testing of physical properti python run.py param.json machine.json ``` ## How to write `param.json` +We take Cu as an example to show the parameter settings of `param.json`. ## How to write `machine.json` From b6796ca93968549eead90935a7a503fd93cc87d1 Mon Sep 17 00:00:00 2001 From: Waikit Chan <37867949+BaozCWJ@users.noreply.github.com> Date: Thu, 20 Jun 2019 22:52:28 +0800 Subject: [PATCH 09/11] Update param.json --- auto_test/param.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auto_test/param.json b/auto_test/param.json index acba2ca1c..29fc50ff9 100644 --- a/auto_test/param.json +++ b/auto_test/param.json @@ -4,8 +4,8 @@ "Cu" : "/somewhere/POTCAR" }, "conf_dir":"the folder of configuration", - "task_type":1, - "task":2, + "task_type":"deepmd", + "task":"eos", "vasp_params": { "ecut": 520, From 4f4c970b15436311654a786139eceefc84e0e432 Mon Sep 17 00:00:00 2001 From: Waikit Chan <37867949+BaozCWJ@users.noreply.github.com> Date: Thu, 20 Jun 2019 23:13:23 +0800 Subject: [PATCH 10/11] Update README.md --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index f2283cce9..bb2f4b53f 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,19 @@ python run.py param.json machine.json ## How to write `param.json` We take Cu as an example to show the parameter settings of `param.json`. +The first part is the fundamental setting for particular alloy system. +``` + "_comment": "models", + "potcar_map" : { + "Cu" : "/somewhere/POTCAR", + "Mg" : "/elsewhere/POTCAR" + }, + "conf_dir":"the folder of configuration", + "task_type":"deepmd", + "task":"eos", +``` +You need to add the specified paths of necessary `POTCAR` files in "potcar_map". The different `POTCAR` paths are separated by commas. + ## How to write `machine.json` # Troubleshooting From edbcdc1d5c4b548e1c672ba90f3fa6a9034b0b6e Mon Sep 17 00:00:00 2001 From: Waikit Chan <37867949+BaozCWJ@users.noreply.github.com> Date: Thu, 20 Jun 2019 23:25:34 +0800 Subject: [PATCH 11/11] Update README.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bb2f4b53f..30c2e4ac8 100644 --- a/README.md +++ b/README.md @@ -25,14 +25,18 @@ The first part is the fundamental setting for particular alloy system. "_comment": "models", "potcar_map" : { "Cu" : "/somewhere/POTCAR", - "Mg" : "/elsewhere/POTCAR" + "Zr" : "/elsewhere/POTCAR" }, "conf_dir":"the folder of configuration", "task_type":"deepmd", "task":"eos", ``` You need to add the specified paths of necessary `POTCAR` files in "potcar_map". The different `POTCAR` paths are separated by commas. - +Then you also need to add the folder path of particular configuration, which contains `POSCAR` file. For your convenience, we recommend that you use `gen_confs.py` to generate configurations by the following command. +``` +python gen_confs.py Cu +``` +It will store the various configurations of the given element or alloy in **confs** folder. ## How to write `machine.json` # Troubleshooting