I want to fix layers in the slab durig calculation of energy minimization. I have 14 layers slab and I want to fix last 7 layers but dont know how to fix it in lammps.
Please let me know how can I do it.
Thanks!
Ali
I want to fix layers in the slab durig calculation of energy minimization. I have 14 layers slab and I want to fix last 7 layers but dont know how to fix it in lammps.
Please let me know how can I do it.
Thanks!
Ali
You can immobilize a group of atoms by not time integrating them (i.e., not
using fix nve, nvt, npt, etc).
Ray
This is the subject of several discussions on this mailing list.
If you are running simulations under NVT or NVE conditions, what Ray
said should work fine. In that case, you would not use "fix all nvt
...". Instead use the "group" command to define a group of atoms
which you want to move (for example named "mobile"), and then use "fix
mobile nvt ...".
But there is some ongoing disagreement about what to do under NPT
conditions. For a recent discussion of this topic, see this post:
http://sourceforge.net/p/lammps/mailman/message/32377195/
Cheers
Andrew
Also, the "all_atom_examples/nanotube+water/" and
"CG_misc/translocation" examples in the "tools/moltemplate/examples"
directory show some examples how to do this under NVT and NPT
conditions. (Again, not everybody agrees this is the correct way to
handle immobile objects under NPT conditions, and I am not convinced
either.)
(These examples also demonstrate different ways to build slab-shaped objects.)
http://www.moltemplate.org/videos/nanotube+water/nanotube+water_t=0-285ps.avi
http://www.moltemplate.org/videos/translocation/walls+solvent+polymer_t=0-60ps.avi
Cheers
Also, the "all_atom_examples/nanotube+water/" and
"CG_misc/translocation" examples in the "tools/moltemplate/examples"
directory show some examples how to do this under NVT and NPT
conditions. (Again, not everybody agrees this is the correct way to
handle immobile objects under NPT conditions, and I am not convinced
either.)
looking at the various arguments made about the topic of immobilizing
parts of a system with a variable cell, it sounds a lot like a "pick 2 out
of 3" kind of deal. ultimately, what you want are contradicting
requirements:
- you want the cell volume to change without changing atom positions in
fractional coordinates of the reference vectors
- you don't want the immobile atoms to move in cartesian coordinates.
- you don't want any changes in the relative distances and angles of the
immobile atoms in cartesian coordinates.
for a slab configuration, a lot of the problems can be avoided by not
using fix npt, and do a fixed pressure confinement in the direction
orthogonal to the slab. e.g. with fix aveforce. for this you need a
reference force, but that is easily computed from the relations that
pressure is (average) force per unit area.
if you *have* to use fix npt, then all one can do is to try and minimize
the error by increasing the system size and placing the immobile object(s)
into or close to the center of the box (or whatever reference point for the
volume change is chosen).
axel.
Also, the "all_atom_examples/nanotube+water/" and
"CG_misc/translocation" examples in the "tools/moltemplate/examples"
directory show some examples how to do this under NVT and NPT
conditions. (Again, not everybody agrees this is the correct way to
handle immobile objects under NPT conditions, and I am not convinced
either.)looking at the various arguments made about the topic of immobilizing parts
of a system with a variable cell, it sounds a lot like a "pick 2 out of 3"
kind of deal. ultimately, what you want are contradicting requirements:
- you want the cell volume to change without changing atom positions in
fractional coordinates of the reference vectors
- you don't want the immobile atoms to move in cartesian coordinates.
- you don't want any changes in the relative distances and angles of the
immobile atoms in cartesian coordinates.
The "dilate" option allows the user to specify a subset of atoms whose
coordinates are rescaled. This feature definitely works. Hopefully,
it makes the correct adjustments to the virial taking this into
account. (That seemed to be the case when I tested LAMMPS back in
2011 using "neigh-modify exclude". But I haven't run rigorous tests
recently.)
for a slab configuration, a lot of the problems can be avoided by not using
fix npt, and do a fixed pressure confinement in the direction orthogonal to
the slab. e.g. with fix aveforce. for this you need a reference force, but
that is easily computed from the relations that pressure is (average) force
per unit area.
That's an cool idea. Would the simulation be non-periodic in that
direction? (That would introduce some other artifacts, but perhaps
that would be preferable than using a combination of LAMMPS fixes when
you don't understand exactly what they do.)
if you *have* to use fix npt, then all one can do is to try and minimize the
error by increasing the system size and placing the immobile object(s) into
or close to the center of the box (or whatever reference point for the
volume change is chosen).
Although this is not something I'm working on right now, but if I have
any better ideas, I'll post them.
Cool.
Andrew
>
>>
>> Also, the "all_atom_examples/nanotube+water/" and
>> "CG_misc/translocation" examples in the "tools/moltemplate/examples"
>> directory show some examples how to do this under NVT and NPT
>> conditions. (Again, not everybody agrees this is the correct way to
>> handle immobile objects under NPT conditions, and I am not convinced
>> either.)
>
>
> looking at the various arguments made about the topic of immobilizing
parts
> of a system with a variable cell, it sounds a lot like a "pick 2 out of
3"
> kind of deal. ultimately, what you want are contradicting requirements:
> - you want the cell volume to change without changing atom positions in
> fractional coordinates of the reference vectors
> - you don't want the immobile atoms to move in cartesian coordinates.
> - you don't want any changes in the relative distances and angles of the
> immobile atoms in cartesian coordinates.The "dilate" option allows the user to specify a subset of atoms whose
coordinates are rescaled. This feature definitely works. Hopefully,
yes, but this option does not fulfill the first condition and more
importantly, with this option the amount a mobile atom is moved relative to
its closest immobile atom depends on their relative location inside the box
(or rather relative to the point around which the box is dilated). so it
*will* introduce an inconsistency.
it makes the correct adjustments to the virial taking this into
account. (That seemed to be the case when I tested LAMMPS back in
2011 using "neigh-modify exclude". But I haven't run rigorous tests
recently.)> for a slab configuration, a lot of the problems can be avoided by not
using
> fix npt, and do a fixed pressure confinement in the direction orthogonal
to
> the slab. e.g. with fix aveforce. for this you need a reference force,
but
> that is easily computed from the relations that pressure is (average)
force
> per unit area.That's an cool idea. Would the simulation be non-periodic in that
direction? (That would introduce some other artifacts, but perhaps
that would be preferable than using a combination of LAMMPS fixes when
you don't understand exactly what they do.)
a slab system is inherently non-periodic. what kind of artifacts are you
thinking about?
>
> for a slab configuration, a lot of the problems can be avoided by not
> using
> fix npt, and do a fixed pressure confinement in the direction orthogonal
> to
> the slab. e.g. with fix aveforce. for this you need a reference force,
> but
> that is easily computed from the relations that pressure is (average)
> force
> per unit area.That's an cool idea. Would the simulation be non-periodic in that
direction? (That would introduce some other artifacts, but perhaps
that would be preferable than using a combination of LAMMPS fixes when
you don't understand exactly what they do.)a slab system is inherently non-periodic. what kind of artifacts are you
thinking about?
In that case, you might have to switch to using short-range electrostatics.
(or using kspace_style msm). (You also get a solvent-vacuum boundary,
instead of two solvent-slab boundaries).
Either way, I like this idea a lot though, and I might use it.
I confess I (finally) re-read the new documentation carefully at
regarding the "dilate" option, apparently, if you set up the
simulation carefully, atoms which are excluded from the dilate group
(and presumably belong to rigid bodies) have their center-of-mass
coordinates rescaled (preserving the distance between atoms withing
the rigid bodies). So all the coordinates do get modified in some way
and the resulting movies look reasonable (when viewed in VMD).
Anyway, there is a long description of multiple ways to run these
kinds of hybrid rigid & non-rigid NPT simulations. Apparently the way
I have been advocating doing this is wrong. (I was using fix
rigid/npt with fix npt. I will update the moltemplate examples soon.)
"If your simlulation is a hybrid model with a mixture of rigid bodies
and non-rigid particles (e.g. solvent) there are several ways these
rigid fixes can be used in tandem with fix nve, fix nvt, fix npt, and
fix nph."
...
"If you with to perform NPT or NPH dynamics (barostatting), you cannot
use both fix npt and fix rigid/npt (or the nph variants). This is
because there can only be one fix which monitors the global pressure
and changes the simulation box dimensions. So you have 3 choices:
1) Use fix rigid/npt for the rigid bodies. Use the dilate all option
so that it will dilate the positions of the non-rigid particles as
well. Use fix nvt (or any other thermostat) for the non-rigid
particles.
2) Use fix npt for the group of non-rigid particles. Use the dilate
all option so that it will dilate the center-of-mass positions of the
rigid bodies as well. Use fix rigid/nvt for the rigid bodies.
3) Use fix press/berendsen to compute the pressure and change the box
dimensions. Use fix rigid/nvt for the rigid bodies. Use fix nvt (or
any other thermostat) for the non-rigid particles.
In all case, the rigid bodies and non-rigid particles both contribute
to the global pressure and the box is scaled the same by any of the
barostatting fixes.
You could even use the 2nd and 3rd options for a non-hybrid simulation
consisting of only rigid bodies, assuming you give fix npt an empty
group, though it's an odd thing to do. The barostatting fixes (fix npt
and fix press/berensen) will monitor the pressure and change the box
dimensions, but not time integrate any particles. The integration of
the rigid bodies will be performed by fix rigid/nvt."
I will try this eventually and report back!
Cheers
Andrew
I confess I (finally) re-read the new documentation carefully at
LAMMPS Molecular Dynamics Simulator
regarding the "dilate" option, apparently, if you set up the
simulation carefully, atoms which are excluded from the dilate group
(and presumably belong to rigid bodies) have their center-of-mass
coordinates rescaled (preserving the distance between atoms withing
the rigid bodies). So all the coordinates do get modified in some way
and the resulting movies look reasonable (when viewed in VMD).
Ugh. I did it again.
My apologies for posting so many messages without reading this
documentation carefully!
Correction:
Atoms belonging to rigid bodies have their center-of-mass coordinates
rescaled, but to get this to work you have to use "dilate all".
(instead of excluding some atoms from the dilate group).
Hi.