Skip to content

fix(lmp): add pair_deepmd_index key to is_key function in dplr #4313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions source/lmp/fix_dplr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ static bool is_key(const string &input) {
keys.push_back("type_associate");
keys.push_back("bond_type");
keys.push_back("efield");
keys.push_back("pair_deepmd_index");
for (int ii = 0; ii < keys.size(); ++ii) {
if (input == keys[ii]) {
return true;
Expand Down
8 changes: 6 additions & 2 deletions source/lmp/tests/test_dplr.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,9 @@ def test_pair_deepmd_lr(lammps):
lammps.special_bonds("lj/coul 1 1 1 angle no")
lammps.kspace_style("pppm/dplr 1e-5")
lammps.kspace_modify(f"gewald {beta:.2f} diff ik mesh {mesh:d} {mesh:d} {mesh:d}")
lammps.fix(f"0 all dplr model {pb_file.resolve()} type_associate 1 3 bond_type 1")
lammps.fix(
f"0 all dplr model {pb_file.resolve()} type_associate 1 3 bond_type 1 pair_deepmd_index 0"
)
lammps.fix_modify("0 virial yes")
lammps.run(0)
for ii in range(8):
Expand Down Expand Up @@ -484,7 +486,9 @@ def test_min_dplr(lammps):
lammps.special_bonds("lj/coul 1 1 1 angle no")
lammps.kspace_style("pppm/dplr 1e-5")
lammps.kspace_modify(f"gewald {beta:.2f} diff ik mesh {mesh:d} {mesh:d} {mesh:d}")
lammps.fix(f"0 all dplr model {pb_file.resolve()} type_associate 1 3 bond_type 1")
lammps.fix(
f"0 all dplr model {pb_file.resolve()} type_associate 1 3 bond_type 1"
)
lammps.fix_modify("0 virial yes")
lammps.min_style("cg")
lammps.minimize("0 1.0e-6 2 2")
Expand Down
Loading