Skip to content
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

lmp: add unit_style requirement for compute deeptensor/atom #2790

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@

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(

Check warning on line 31 in source/lmp/compute_deeptensor_atom.cpp

View check run for this annotation

Codecov / codecov/patch

source/lmp/compute_deeptensor_atom.cpp#L30-L31

Added lines #L30 - L31 were not covered by tests
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