[lammps-users] global variables

Dear LAMMPS users,

I was wondering if there was a way to implement a global variable in lammps that can be used by different fixes in the simulation. For instance, some calculated parameter in the form of an array that is calculated by one fix and used by another.

thanks
Jaime Sanchez

Dear LAMMPS users,

dear jaime,

I was wondering if there was a way to implement a global variable in
lammps that can be used by different fixes in the simulation. For
instance, some calculated parameter in the form of an array that is
calculated by one fix and used by another.

global variables are almost always a very bad idea (no
consistent state and no concurrent access, especially in
parallel runs).

a solution for your problem would probably be designing a class
that has a defined API to store and access the properties you're
interested in and have the different classes/fixes that need it
store a reference/pointer to it and then communicate via the
defined API. this will also allow a clean implementation of the
parallelization/distribution of the information across the nodes.

but then again, since LAMMPS is GPL you can implement it in any
way you like, but if you want to get your code integrated into
the distribution, you'd have to follow whatever steve prefers.

cheers,
  axel.

Dear LAMMPS users,

I have a question about the trajectory files generated by LAMMPS. When I use VMD to visualize the *.dump or *.dcd files, the bonds across the periodic boundary are displayed in a wrong way since VMD reads the real coordinate of those atoms involved without wrapping. Is there any way to fix this problem? Also comes the similar problem when one counters the nonbonded interaction such as hydrogen bonds, how to account this boundary effect?

Thanks in advance!

cheers,
Zhenlong Li
PhD student
Macromolecular Department
Case Western Reserve University

You can use the "dynamic bonds" drawing method under the

Representations tab in VMD to visualize the bonds across

periodic boundaries. The VMD user's guide should have information about
atom/segment selection.

Christina

If your question is “how do I unwrap the molecules from the periodic boundary conditions?”, use the dump tool in Pizza.py. It will allow you to unwrap the molecules using the integer box count and write a new dump file with unwrapped coordinates.

http://www.cs.sandia.gov/~sjplimp/pizza.html

Joanne Budzien

Post-doc, Org.1814: Computational Materials Science and Engineering
Sandia National Laboratories
PO Box 5800
Albuquerque, NM 87185-1411

Voice: (505) 844-0959
Fax: (505) 844-9781
Email: jlbudzi@…3…

If your question is �how do I unwrap the molecules from the periodic
boundary conditions?�, use the dump tool in Pizza.py. It will allow you to
unwrap the molecules using the integer box count and write a new dump file
with unwrapped coordinates.

http://www.cs.sandia.gov/~sjplimp/pizza.html

alternatively VMD ships with the PBCtools plugin, which has
been significantly updated for the recent 1.8.6 release:
http://www.ks.uiuc.edu/Research/vmd/plugins/pbctools/

cheers,
  axel.

Thanks, Christina and Joanne. I guess this unwraping tool is exactly what I want.

with best wishes

Zhenlong Li
PhD student
Macromolecular Department
Case Western Reserve University

A fix is just a class which can compute what you are calling
a global variable. But have it stored within the class. Then some
other fix you write can access it however you wish (a function
call to that class, or directly access it as a "friend" class, etc).

Some fixes do compute a scalar or vector quantity that
is accessed by thermodynamics via the fix::thermo(n) call,
e.g. when you have a keyword like f_ID[n] in your thermo_style custom
list. So I suppose your fix could have a thermo() routine that
another of your fixes could call to get at a set of values you choose.

Steve