diff --git a/source/lmp/compute_deeptensor_atom.cpp b/source/lmp/compute_deeptensor_atom.cpp index 6af57f0b3c..0de523e1bf 100644 --- a/source/lmp/compute_deeptensor_atom.cpp +++ b/source/lmp/compute_deeptensor_atom.cpp @@ -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"); }