Skip to content

Commit 0bdb269

Browse files
authored
Merge pull request brucefan1983#982 from Kick-H/master
Create `README.md` in `potentials/DP` and modify the `tools/vim`
2 parents a0e321a + c7904c0 commit 0bdb269

File tree

4 files changed

+94
-32
lines changed

4 files changed

+94
-32
lines changed

potentials/DP/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# `DP` model for `GPUMD`
2+
3+
## Necessary instructions
4+
5+
- This is a test version.
6+
- Only potential function files ending with `.pb` in deepmd are supported, that is, the potential function files of the tensorflow version generated using `dp --tf` freeze.
7+
8+
## Installation Dependencies
9+
10+
- You must ensure that the new version of `DP` is installed and can run normally. This program contains `DP`-related dependencies.
11+
- The installation environment requirements of `GPUMD` itself must be met.
12+
13+
## Run Test
14+
15+
This `DP` interface requires two files: a setting file and a `DP` potential file. The first file is very simple and is used to inform `GPUMD` of the atom number and types. For example, the `dp.txt` is shown in here for use the `potential dp.txt DP_POTENTIAL_FILE.pb` command in the `run.in` file:
16+
17+
```dp 2 O H```
18+
19+
## Notice
20+
21+
The type list of setting file and potential file must be the same.
22+
23+
## References
24+
25+
- [Installation for `GPUMD-DP`](https://github.com/Kick-H/GPUMD/blob/master/doc/installation.rst)
26+
- [Tutorials for `GPUMD-DP`](https://github.com/brucefan1983/GPUMD-Tutorials/tree/main/examples/14_DP)
27+
- [`DeePMD-kit`](https://github.com/deepmodeling/deepmd-kit)

tools/vim/README.md

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,36 @@
1-
=== Vim Syntax Highlighting ===
2-
===============================
1+
# Vim Syntax Highlighting
32

4-
Will enable syntax highlighting for the GPUMD script syntax in vim.
5-
The scripts name with run.in or phonon.in.
6-
One can easily add new ones.
3+
Will enable syntax highlighting for the `GPUMD` script syntax in vim. The scripts name with run.in. One can easily add new ones.
74

8-
=To enable the highlighting:
9-
============================
10-
=Here is an alternate method for VIM Version 7.2 and later:
5+
## To enable the highlighting
116

12-
(0) Create/edit ~/.vimrc to contain:
13-
syntax on
14-
(1) Create directories ~/.vim/syntax and ~/.vim/ftdetect
15-
(2) Copy gpumd.vim to ~/.vim/syntax/gpumd.vim
16-
(3) Copy filetype.vim to ~/.vim/ftdetect/gpumd.vim
7+
Here is an alternate method for VIM Version 7.2 and later:
8+
9+
1. Create/edit `~/.vimrc` to contain:
10+
```
11+
let mysyntaxfile = "~/.vim/mysyntax.vim"
12+
syntax on
13+
" do not create <TAB> characters
14+
set expandtab
15+
```
16+
2. Create directories `~/.vim/syntax` and `~/.vim/ftdetect`;
17+
3. Create file `~/.vim/mysyntax.vim` to contain:
18+
```
19+
augroup syntax
20+
au BufNewFile,BufReadPost run.in so ~/.vim/syntax/gpumd.vim
21+
au BufNewFile,BufReadPost nep.in so ~/.vim/syntax/gpumd.vim
22+
augroup END
23+
```
24+
4. Copy `gpumd.vim` to `~/.vim/syntax/gpumd.vim`
25+
5. Copy `filetype.vim` to `~/.vim/ftdetect/gpumd.vim`
26+
27+
## contact
28+
29+
30+
31+
-----
32+
33+
- updated by Ke Xu, 2025-4-17
34+
- updated by Ke Xu, 2023-5-30
35+
- updated by Ke Xu, 2021
1736

18-
Ke Xu <[email protected]> 2021

tools/vim/gpumd.vim

Lines changed: 31 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,77 @@
11
" Vim syntax file
22
" Language: GPUMD Simulation Script File
3-
" Latest Revision: 2023-5-30
3+
" Latest Revision: 2025-4-17
44

55
syn clear
66

7+
"-------------------------
8+
" GPUMD core syntax definition
9+
"-------------------------
710
syn keyword GPUMDpot potential
8-
syn keyword GPUMDsetup change_box ensemble velocity correct_velocity time_step neighbor fix deform
9-
syn keyword GPUMDdump dump_thermo dump_position dump_netcdf dump_restart dump_velocity dump_force active dump_exyz dump_beads dump_observer
10-
syn keyword GPUMDcompute plumed compute compute_shc compute_dos compute_sdc compute_hac compute_hnemd compute_gkma compute_hnema compute_phonon compute_cohesive compute_elastic compute_hnemdec compute_msd compute_viscosity
11+
syn keyword GPUMDsetup replicate velocity correct_velocity potential dftd3 change_box deform
12+
syn keyword GPUMDsetup ensemble fix time_step plumed mc electron_stop add_force add_efield active
13+
syn keyword GPUMDdump dump_netcdf dump_position dump_restart dump_thermo dump_velocity dump_shock_nemd
14+
syn keyword GPUMDdump dump_exyz dump_beads dump_observer dump_dipole dump_polarizability dump_force
15+
syn keyword GPUMDcompute compute compute_cohesive compute_dos compute_elastic
16+
syn keyword GPUMDcompute compute_gkma compute_hac compute_hnema compute_hnemd compute_hnemdec
17+
syn keyword GPUMDcompute compute_phonon compute_sdc compute_msd compute_shc compute_viscosity compute_lsqt compute_rdf
1118
syn keyword GPUMDrun minimize run
12-
syn keyword GPUMDspecial temperature potential force virial jp jk group num_dos_points f_bin_size bin_size precision observe
13-
syn keyword GPUMDensemble nve nvt_ber nvt_nhc nvt_bdp nvt_lan nvt_bao npt_ber npt_scr heat_nhc heat_bdp heat_lan pimd rpmd trpmd sd
1419

15-
syn keyword NEPsets zbl n_max basis_size l_max neuron force_delta population
20+
"-------------------------
21+
" NEP related syntax definition
22+
"-------------------------
23+
syn keyword NEPsets zbl use_typewise_cutoff_zbl use_typewise_cutoff n_max basis_size l_max neuron force_delta population
1624
syn keyword NEPkws cutoff batch
1725
syn keyword NEPinput version model_type type type_weight
1826
syn keyword NEPrun generation prediction
1927
syn keyword NEPlambda lambda_1 lambda_2 lambda_e lambda_f lambda_v lambda_shear
2028

29+
"-------------------------
30+
" GPUMD syntax rules (strings/numbers/comments)
31+
"-------------------------
2132
syn region GPUMDString start=+'+ end=+'+ oneline
2233
syn region GPUMDString start=+"+ end=+"+ oneline
23-
2434
syn match GPUMDNumber "\<[0-9]\+[ij]\=\>"
2535
syn match GPUMDFloat "\<[0-9]\+\.[0-9]*\([edED][-+]\=[0-9]\+\)\=[ij]\=\>"
2636
syn match GPUMDFloat "\.[0-9]\+\([edED][-+]\=[0-9]\+\)\=[ij]\=\>"
2737
syn match GPUMDFloat "\<[0-9]\+[edED][-+]\=[0-9]\+[ij]\=\>"
28-
2938
syn match GPUMDComment "#\(.*&\s*\n\)*.*$"
3039

40+
"-------------------------
41+
" NEP syntax rules (strings/numbers/comments)
42+
"-------------------------
3143
syn region NEPString start=+'+ end=+'+ oneline
3244
syn region NEPString start=+"+ end=+"+ oneline
33-
3445
syn match NEPNumber "\<[0-9]\+[ij]\=\>"
3546
syn match NEPFloat "\<[0-9]\+\.[0-9]*\([edED][-+]\=[0-9]\+\)\=[ij]\=\>"
3647
syn match NEPFloat "\.[0-9]\+\([edED][-+]\=[0-9]\+\)\=[ij]\=\>"
3748
syn match NEPFloat "\<[0-9]\+[edED][-+]\=[0-9]\+[ij]\=\>"
38-
3949
syn match NEPComment "#\(.*&\s*\n\)*.*$"
4050

51+
"-------------------------
52+
" Highlight link definition
53+
"-------------------------
4154
if !exists("did_GPUMD_syntax_inits")
4255
let did_GPUMD_syntax_inits = 1
4356
hi link GPUMDdump Function
4457
hi link GPUMDpot Typedef
4558
hi link GPUMDsetup Typedef
4659
hi link GPUMDcompute Define
4760
hi link GPUMDrun Statement
48-
hi link GPUMDspecial special
49-
hi link GPUMDensemble ensemble
5061
hi link GPUMDString String
5162
hi link GPUMDNumber Number
5263
hi link GPUMDFloat Float
53-
hi link NEPrun Statement
54-
hi link NEPlambda special
55-
hi link NEPrun Define
56-
hi link NEPkws Typedef
64+
hi link GPUMDComment Comment
65+
5766
hi link NEPsets Function
67+
hi link NEPkws Typedef
68+
hi link NEPinput Define
69+
hi link NEPrun Statement
70+
hi link NEPlambda Special
5871
hi link NEPString String
5972
hi link NEPNumber Number
6073
hi link NEPFloat Float
61-
74+
hi link NEPComment Comment
6275
endif
6376

6477
let b:current_syntax = "GPUMD"

tools/vim/vimrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
let mysyntaxfile = "~/.vim/mysyntax.vim"
2+
syntax on
3+
" do not create <TAB> characters
4+
set expandtab

0 commit comments

Comments
 (0)