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}"*
<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_zc*z[{a}] + v_cc"</i>
*print "{thisplanevalue}"*

corresponding log entry:

*variable maxplanevalue equal “v_yc**y[1] + v_zc*z[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_zc*z[{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\}"
variable minplanevalue equal "v\_yc\*y\[1\] \+ v\_zc\*z\[1\] \+ v\_cc"
variable minatom equal 1
variable tn equal {totalatoms}+1

variable a loop ${tn}

label loopn

print "\{a\}"
variable thisplanevalue equal "v\_yc\*y\[{a}] + v_zc*z[\{a\}\] \+ v\_cc"
print "{thisplanevalue}"

corresponding log entry:

variable maxplanevalue equal "v_yc*y[1] + v_zc*z[1] + v_cc"

variable maxatom equal 1

print "\{maxplanevalue\}"
223457\.004536763
variable minplanevalue equal "v\_yc\*y\[1\] \+ v\_zc\*z\[1\] \+ v\_cc"
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
variable thisplanevalue equal "v\_yc\*y\[{a}] + v_zc*z[\{a\}\] \+ v\_cc"
print "{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.