Hi all,
Please excuse me if any of this is laid out clearly in the documentation, but I am very new to LAMMPS and MD and have a few basic questions regarding a simple test simulation and have been having trouble teasing out some of the nuances:
At present, I have one molecule of species A (has 5 atoms) in a bath of many molecules (all species B). I am able to create all the molecules (atoms), assign initial velocities, and run the simulation. My goal is to track the energy of A over time in order to simulate collisional energy transfer. The forcefield and interactions are governed using reax/c.
-
Is there a way to keep the one A at the center of a periodic box without imposing any constraints on the behavior of the molecule/atoms? That is, I would like the box to track A with the box center following it.
-
I would like to start the molecule A at a high energy relative to the bath. Can I assign initial vibrational or rotational energy to the molecule A or am I limited to specifying a high temperature in the velocity command? As currently implemented I am assigning a velocity at low temperature to the bath and a high temperature velocity to the molecule A. I guess this is also a question about whether molecules can be treated as single units or if I need to assign energy to at the level of individual atoms.
-
Last, I am having trouble with computing and outputting the energy of A. I believe I need to compute the energy per atom:
“compute EnergyAll all pe/atom”
and then sum the components that make up my molecule.
a) When I try to accomplish this next step as
“compute EnergyM all reduce sum c_EnergyAll[1] c_EnergyAll[2] c_EnergyAll[3] c_EnergyAll[4] c_EnergyAll[5]”
I get the error: “ERROR: Compute reduce compute does not calculate a per-atom array (…/compute_reduce.cpp:196)”
b) if I alternatively try to call out the individual energies and print them:
“variable EnC equal c_EnergyAll[1]”
Then the error is “ERROR: Indexed per-atom vector in variable formula without atom map (…/variable.cpp:3873)”
I’m assuming that since I create the molecule A first that the first five indices are its atoms. Is there an explicit mapping that I need to create?
Thank you all,
I can help with point 3, I guess. It is probably easiest to make a group containing just the atoms of your molecule, and then you can do a compute EnergyM pe.
Compute reduce takes either a vector or array, and reduces it into either a scalar or a vector, so your a) should have been just compute EnergyM all reduce sum c_EnergyAll.
To print the energies per atom, you need to add an atom map (so that LAMMPS can internally resolve the indexing I think), with a command like
atom_modify map hash
Hi all,
Please excuse me if any of this is laid out clearly in the documentation,
but I am very new to LAMMPS and MD and have a few basic questions regarding
a simple test simulation and have been having trouble teasing out some of
the nuances:
At present, I have one molecule of species A (has 5 atoms) in a bath of
many molecules (all species B). I am able to create all the molecules
(atoms), assign initial velocities, and run the simulation. My goal is to
track the energy of A over time in order to simulate collisional energy
transfer. The forcefield and interactions are governed using reax/c.
1) Is there a way to keep the one A at the center of a periodic box
without imposing any constraints on the behavior of the molecule/atoms?
That is, I would like the box to track A with the box center following it.
If the box is fully periodic in all 3 directions, then the one A can always
be in the center of the box. It is just a matter of shifting the one A
molecule, or the box boundaries, when you visualize the simulation. Based
on the kind of your dump file, you can write post process programs to do
the shift automatically.
2) I would like to start the molecule A at a high energy relative to the
bath. Can I assign initial vibrational or rotational energy to the molecule
A or am I limited to specifying a high temperature in the velocity command?
As currently implemented I am assigning a velocity at low temperature to
the bath and a high temperature velocity to the molecule A. I guess this is
also a question about whether molecules can be treated as single units or
if I need to assign energy to at the level of individual atoms.
You can use fix move rotate keyword to rotate your molecule A, provided you
apply this fix to group A atoms only and figure out where the rotational
axis is.
3) Last, I am having trouble with computing and outputting the energy of
A. I believe I need to compute the energy per atom:
"compute EnergyAll all pe/atom"
and then sum the components that make up my molecule.
a) When I try to accomplish this next step as
"compute EnergyM all reduce sum c_EnergyAll[1] c_EnergyAll[2]
c_EnergyAll[3] c_EnergyAll[4] c_EnergyAll[5]"
I get the error: "ERROR: Compute reduce compute does not calculate a
per-atom array (../compute_reduce.cpp:196)"
Please follow Stefan's advices
Ray
Hi all,
Please excuse me if any of this is laid out clearly in the documentation, but I am very new to LAMMPS and MD and have a few basic questions regarding a simple test simulation and have been having trouble teasing out some of the nuances:
At present, I have one molecule of species A (has 5 atoms) in a bath of many molecules (all species B). I am able to create all the molecules (atoms), assign initial velocities, and run the simulation. My goal is to track the energy of A over time in order to simulate collisional energy transfer. The forcefield and interactions are governed using reax/c.
1) Is there a way to keep the one A at the center of a periodic box without imposing any constraints on the behavior of the molecule/atoms? That is, I would like the box to track A with the box center following it.
that is better done in postprocessing. the pbctools plugin in VMD for
example has a feature that allows wrapping and re-centering a
trajectory.
it will help, if you also write out the image flags.
2) I would like to start the molecule A at a high energy relative to the bath. Can I assign initial vibrational or rotational energy to the molecule A or am I limited to specifying a high temperature in the velocity command? As currently implemented I am assigning a velocity at low temperature to the bath and a high temperature velocity to the molecule A. I guess this is also a question about whether molecules can be treated as single units or if I need to assign energy to at the level of individual atoms.
doing this with assigning initial kinetic energy, rarely works. what
you can do with LAMMPS, however, is to use different thermostat
algorithms on different groups of atoms, and each of them can have a
different target temperature. equilibrate your system under such
conditions for a while and then switch to whatever seems reasonable.
in response to the second part of the question, almost all features in
LAMMPS operate on individual atoms without any knowledge what whether
they belong to a molecule or note. for ReaxFF, actually all molecule
assignments and bond-order determination is implicit, and dynamical.
axel.
1) Is there a way to keep the one A at the center of a periodic box without imposing any
constraints on the behavior of the molecule/atoms? That is, I would like the box to track A
with the box center following it.
You can accomplish this nicely using fix recenter:
fix 1 MolA recenter INIT INIT INIT shift all
Thank you
The format you suggested was actually my first attempt as well.
I do have a group containing only the molecule A atoms (‘hot’):
“compute EnergyM hot pe” results in the error “ERROR: Compute pe must use group all (…/compute_pe.cpp:38)”
However, I was able to get what I needed out by using the following pair of commands
“”"
compute HotEs hot pe/atom
compute EnergyM hot reduce sum c_HotEs
“”"