Non digit character between brackets in variable

Dear all

While I was doing some operations that involve variables, I got the error “Non digit character between brackets in variable”. I was unable to debug it. I think the following snippet will be enough to find it:

code snippet:

variable maxplanevalue equal “v_ycy[1] + v_zcz[1] + v_cc”
variable maxatom equal 1
print "{maxplanevalue}"* <i>variable minplanevalue equal "v_yc*y[1] + v_zc*z[1] + v_cc"</i> *variable minatom equal 1* *variable tn equal {totalatoms}+1
variable a loop ${tn}

label loopn
print "{a}"* <i>variable thisplanevalue equal "v_yc*y[{a}] + v_zcz[{a}] + v_cc"</i> *print "{thisplanevalue}"*

corresponding log entry:

variable maxplanevalue equal “v_ycy[1] + v_zcz[1] + v_cc”
variable maxatom equal 1
print "{maxplanevalue}"* *223457.004536763* <i>variable minplanevalue equal "v_yc*y[1] + v_zc*z[1] + v_cc"</i> *variable minatom equal 1* *variable tn equal {totalatoms}+1
variable tn equal 13972+1
variable a loop ${tn}
variable a loop 13973

label loopn
print "{a}"* *1* <i>variable thisplanevalue equal "v_yc*y[{a}] + v_zcz[{a}] + v_cc"</i> *print "{thisplanevalue}"*
ERROR: Non digit character between brackets in variable (…/variable.cpp:2808)

Could you please help me finding out the error?

Thank you
Jeeno Jose

Dear all

While I was doing some operations that involve variables, I got the error
"Non digit character between brackets in variable". I was unable to debug
it. I think the following snippet will be enough to find it:

code snippet:

variable maxplanevalue equal "v_yc*y[1] + v_zc*z[1] + v_cc"
variable maxatom equal 1
print "\{maxplanevalue\}&quot; variable minplanevalue equal &quot;v\_yc\*y\[1\] \+ v\_zc\*z\[1\] \+ v\_cc&quot; variable minatom equal 1 variable tn equal {totalatoms}+1
variable a loop ${tn}

label loopn
print "\{a\}&quot; variable thisplanevalue equal &quot;v\_yc\*y\[{a}] + v_zc*z[\{a\}\] \+ v\_cc&quot; print &quot;{thisplanevalue}"

corresponding log entry:

variable maxplanevalue equal "v_yc*y[1] + v_zc*z[1] + v_cc"
variable maxatom equal 1
print "\{maxplanevalue\}&quot; 223457\.004536763 variable minplanevalue equal &quot;v\_yc\*y\[1\] \+ v\_zc\*z\[1\] \+ v\_cc&quot; variable minatom equal 1 variable tn equal {totalatoms}+1
variable tn equal 13972+1
variable a loop ${tn}
variable a loop 13973

label loopn
print "\{a\}&quot; 1 variable thisplanevalue equal &quot;v\_yc\*y\[{a}] + v_zc*z[\{a\}\] \+ v\_cc&quot; print &quot;{thisplanevalue}"
ERROR: Non digit character between brackets in variable
(../variable.cpp:2808)

Could you please help me finding out the error?

please note that the script language in LAMMPS is not a full-fledged
script language (like python, perl, tcl, etc) and has limitations.
it should work, when you remove the blanks in the expressions and the
(then no longer required) quotation marks.

axel.