LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
[lammps-users] Unable to assign scalar value of compute to a variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lammps-users] Unable to assign scalar value of compute to a variable


From: "Chilakalapudi, Syamal Praneeth (INT)" <syamal.chilakalapudi@...1550...>
Date: Tue, 14 Nov 2017 09:17:01 +0100

Dear All,

I am trying to assign the value of the radius of gyration compute to a variable, but I get this error:
Compute used in variable between runs is not current.

I have followed the instructions mentioned in the LAMMPS documentation and some responses from Steve on the archives.
(Referring to Variable Accuracy paragraph in Variable References section: http://lammps.sandia.gov/doc/variable.html)

  1. Even after giving a 0-timestep run to initialize the compute, I am still getting errors. Please see the following lines:

    <LAMMPS initialization and atomic setup>
    <Minimization, thermo info, fixes and dumps>

    compute        g1 all gyration
    run            0
    variable       Rg equal c_g1
    print          "Initial R of gyration is = ${Rg}"
    run            100000

    -----------------------------
    Part of the output (being shown verbatim):

    ERROR: Compute used in variable between runs is not current (../variable.cpp:1300)
    Last command: Initial R of gyration is = ${Rg

  2. I also need your help understanding these lines on the above mentioned webpage: "If it (a variable) contains references to a
    compute or fix, and these values were calculated on the last timestep of a preceding run, then they will be accessed and used
    by the variable and the result will be accurate."

    Will the compute automatically be evaluated at the last time step? Or should I write code to evaluate the compute at t = runtime-1?
    The quoted statement and the LAMMPS Docs solution presented in item #1 of this email contradict my understanding that
    merely defining a compute doesn't perform a computation.

Looking forward to hearing your suggestions and criticism,

Thanks,
Praneeth


--
Karlsruhe Institute of Technology (KIT),
Institute of Nanotechnology (INT)
 
Syamal Praneeth Chilakalapudi
 
Building 640, Campus North,
Hermann-von-Helmholtz-Platz 1,
76344 Eggenstein-Leopoldshafen, Germany
KIT is a research university in the Helmholtz Association