add support for internal style variables to info command

This commit is contained in:
Axel Kohlmeyer 2019-06-10 18:21:17 -04:00
parent b9e10d55e2
commit 72b295d7f4
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
1 changed files with 6 additions and 2 deletions

View File

@ -67,7 +67,7 @@
namespace LAMMPS_NS {
// same as in variable.cpp
enum {INDEX,LOOP,WORLD,UNIVERSE,ULOOP,STRING,GETENV,
SCALARFILE,ATOMFILE,FORMAT,EQUAL,ATOM,PYTHON};
SCALARFILE,ATOMFILE,FORMAT,EQUAL,ATOM,VECTOR,PYTHON,INTERNAL};
enum {COMPUTES=1<<0,
DUMPS=1<<1,
@ -106,7 +106,7 @@ static const int STYLES = ATOM_STYLES | INTEGRATE_STYLES | MINIMIZE_STYLES
static const char *varstyles[] = {
"index", "loop", "world", "universe", "uloop", "string", "getenv",
"file", "atomfile", "format", "equal", "atom", "python", "(unknown)"};
"file", "atomfile", "format", "equal", "atom", "vector", "python", "internal", "(unknown)"};
static const char *mapstyles[] = { "none", "array", "hash" };
@ -599,6 +599,10 @@ void Info::command(int narg, char **arg)
int ndata = 1;
fprintf(out,"Variable[%3d]: %-10s, style = %-10s, def =",
i,names[i],varstyles[style[i]]);
if (style[i] == INTERNAL) {
fprintf(out,"%g\n",input->variable->dvalue[i]);
continue;
}
if ((style[i] != LOOP) && (style[i] != ULOOP))
ndata = input->variable->num[i];
for (int j=0; j < ndata; ++j)