LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
[lammps-users] Combining Atom Style and Python Style Variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lammps-users] Combining Atom Style and Python Style Variables

From: Brenda Rubenstein <rubenstein.brenda@...24...>
Date: Tue, 19 Dec 2017 11:49:58 -0500

Dear LAMMPS Listserv, 
    I was observing a thread about using both atom style and python style variables and had similar questions myself. What kind of syntax can be used for combining atom style and python style variables? More specifically, I would like to calculate the forces on all of the atoms in my simulations. These forces are computed using a python script based upon a very specific potential energy surface. What is the syntax to pass an atom style variable to a python script and then to have an atom style variable returned? It seems as though I can readily send atom style variables to my python script, but they don't appear to return properly. Here is some of the syntax I am currently using: 

variable         values python someFunc

python           someFunc input 1 v_z return v_values format ff file

This is the test python function in (which is in the same directory): 

def someFunc(args):

    for stuff in args:

      args[stuff-1] += 2

    print args

    return args

I would like to get this to work before inserting my actual potential/force functions. The python function has obviously been tested. Any ideas about why such a call does not currently work (when actually called) or how to combine atom and python style variables would be greatly appreciated! Is the ff format incorrect?  

Dr. Brenda Rubenstein
Assistant Professor of Chemistry, Brown University