All,
I’m having a problem defining a variable which involves a vector. The error I’m getting is below.
ERROR: Invalid syntax in variable formula (…/variable.cpp:2262)
Last command: variable dumpfreq equal (round({runtime}/10))
Below is the relevant excerpt of the script. I’ve tested this in the August 31, 2018 version of LAMMPS and the error is still present. What am I doing wrong?
variable rho equal 1.497 # density of polymer in g/cc
variable rhoa equal {rho}/(10^8)^3 # density of polymer in g/A^3
variable lxf equal 100 # final length of simulation box in x-direction
variable lyf equal 50 # final length of simulation box in y-direction
variable masssys equal (density/(10^8)^3lxlylz) # Calculate mass of system in g
variable lzf equal {masssys}/({rhoa}{lxf}*{lyf}) # Calculate final length of sim box in z-direction in A
variable rate equal (10/10^6) # Calculate rate of deformation in A/fs
variable deltatx equal ((v_lxf-lx)/v_rate) # Calculate time in fs to deform x at the specified rate
variable deltaty equal ((v_lyf-ly)/v_rate) # Calculate time in fs to deform y at the specified rate
variable deltatz equal ((v_lzf-lz)/v_rate) # Calculate time in fs to deform z at the specified rate
Define vector of deltas
variable deltatvec vector [abs({deltatx}),abs({deltaty}),abs(${deltatz})]
variable runtime equal max(v_deltatvec)
Calculate dump frequency from runtime
variable dumpfreq equal (round({runtime}/10))
Calculate thermo frequency from runtime
variable thermofreq equal (round({runtime}/200))
I’m not sure why I’m getting an error. How should it be written to avoid the error?
Thanks,
Will