-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from BaozCWJ/master
Fix
- Loading branch information
Showing
4 changed files
with
45 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,42 @@ | ||
# dpgen | ||
<span style="font-size:larger;">dpgen Manual</span> | ||
======== | ||
|
||
# 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`) | ||
- [Troubleshooting](#Troubleshooting) | ||
# About dpgen | ||
The deep potential generator | ||
# 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` | ||
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", | ||
"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 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters