Skip to content

Commit

Permalink
lmp: add unit_style requirement for compute deeptensor/atom (#2790)
Browse files Browse the repository at this point in the history
The input of the model should be Angstron so that the unit style can
only be metal or real.

---------

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
njzjz and pre-commit-ci[bot] committed Sep 6, 2023
1 parent b1d87db commit 9712c13
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions source/lmp/compute_deeptensor_atom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ using namespace LAMMPS_NS;

ComputeDeeptensorAtom::ComputeDeeptensorAtom(LAMMPS *lmp, int narg, char **arg)
: Compute(lmp, narg, arg), dp(lmp), tensor(nullptr) {
if (!(strcmp(update->unit_style, "metal") == 0 ||
strcmp(update->unit_style, "real") == 0)) {
error->all(
FLERR,
"Compute deeptensor/atom requires metal or real unit; please set it by "
"\"units metal\" or \"units real\"");
}

if (narg < 4) {
error->all(FLERR, "Illegal compute deeptensor/atom command");
}
Expand Down

0 comments on commit 9712c13

Please sign in to comment.