I am shrinking a volume, and thus am using the NPT ensemble. It works if I use NVT, and I’ve been doing that with fixed boundaries. But with NPT, I need to use periodic boundaries. But I run into issues, even without the volume shrinking. Here are the commands:
units lj
dimension 3
processors * * *
boundary p p p
neighbor 1.2 bin
neigh_modify every 1 delay 0
timestep 0.005
atom_style hybrid angle ellipsoid
read_data 3-data.chrom
pair_style soft 1.12246
pair_coeff * * 10 1.1224620
bond_style harmonic
bond_coeff 1 100 1.1
bond_coeff 2 100 1.8000000
angle_style cosine/periodic
angle_coeff 1 3 1 1
thermo 500
fix 82 all balance 25 1.015 shift xyz 20 1.00
#NOTE THIS SPOT
dump 2 all custom 1 mdd.lammpstrj id type x y z
#BOLDED
fix 178 all npt temp 1.0 1.0 1.0 iso 1.0 1.0 1.0
fix 1 all langevin 1.0 1.0 50 100 angmom 10
#ENDBOLDED
run 10000
This gives either
ERROR on proc 0: Neighbor list overflow, boost neigh_modify one (src/npair_half_bin_newton.cpp:157)
Or it kills the process if neighbor bin is too small.
Ultimately, I`d like to put this in, where it says “NOTE THIS SPOT”:
variable baseBw equal 0
variable baseTw equal 1000
variable ratew equal 9.264000
variable radiusDownw equal "v_baseTw - step*dt*v_ratew"
variable radiusUpw equal "v_baseBw + step*dt*v_rate"
fix 550 all indent 13 plane z v_radiusUpw lo
fix 560 all indent 13 plane z v_radiusDownw hi
variable base equal 5.000000
variable rate equal -0.100000
variable radius equal "v_base + step*dt*v_rate"
fix 5 all indent 10 cylinder z 414 414 v_radius side in
variable prefactor equal ramp(0.0,10.0)
fix 6 all adapt 1 pair soft a * * v_prefactor
This has worked with NVT. However, given that I’m shrinking the volume, I think that NPT is more appropriate. But this leads to the above issues. I’m wondering might be the issue.
Also, when I replace the bolded part with:
fix 1 all nve/dotc/langevin 1.0 1.0 50.0 100 angmom 10
(which I used before)
The simulation proceeds, even with the periodic boundary conditions (and using neighbor 4.7 bin).
A non-periodic simulation box is fundamentally different from a periodic simulation box. In a non-periodic simulation box, particles near the boundary faces have a fundamentally different local environment from particles in the middle of the box; but a periodic simulation box is homogeneous in this aspect and a particle should have the same local environment everywhere (up to random fluctuations).
So it doesn’t make sense to me that you can interchange “fixed” and “periodic” boundaries. Furthermore, you do not need fix npt if you are explicitly setting how your box deforms. It is the other way around: using a barostatted integrator (which is what fix npt is, not a thermodynamic ensemble) means you can only directly control pressure, and then it’s up to the barostat to set the simulation box size, not you.
It’s worth noting that the error message you listed has an explicit solution right there: you just need to put (say) neigh_modify one 5000 (or some suitably larger number) to ask LAMMPS to use larger neighborlist memory blocks. But the way you describe your simulations makes me think there are deeper issues of correctness to consider.
In both cases the most likely cause is that your system has shrunk too much, which is a consequence of your choice of force field settings. The default settings for neighborlist pages are suitable for most “normal” molecular or atomic systems, even at higher densities. If you exceed those, it means you are far from those “normal” settings. If this is what you desired, then you have to follow the advice and have to modify the neighbor list settings.
If there is insufficient repulsion, your system will become too dense. If you want to shrink your system, you would usually have a desired target density. In that case fix npt is not a suitable choice, but rather fix deform in combination with fix nvt or fix nve+langevin would be the preferred choice.
The rest of your description reads very confusing and - in part - makes little sense to me.
a neighbor list skin of 1.2 is huge for reduced units, a skin of 4.7 humongous (almost 4x your cutoff). That certainly contributes to having too many neighbors for the default settings.
why do you include “ellipsoid” in your atom style? nothing seems to use it.
what is the point of the various indenters?
why are you ramping the soft potential (and starting from 0.0) while you want to do NPT? that makes no sense at all
why do this all at the same time? the normal procedure would be to first equilibrate your system to a defined state and then add “modifications” or “experiments” to it.
The ramping of the “soft” potential is usually to unoverlap entangled random polymer geometries. Why combine this with NPT equilibration
I have to agree with Shern, this all looks rather random and not really following common best practices and thus it is not at all clear if this can ever result in a meaningful simulation and what kind of system this would represent.
My reason for switching from nvt to npt was because my volume was changing. In either case, the indented volume would mean no particle would interact with the box boundary, so the issue of different boundaries shouldn`t come up (Here I have forgotten to put in plane indenters that would block up the top/bottom of the cylinder). But I needed to switch to periodic boundaries to use npt. That was my reasoning for reaching this set of commands.
I am thinking about the npt/nvt ensembles wrong, it seems. If I am changing the simulation volume, using nvt is more appropriate?
Thank you for your insight for the correct fixes to use. And thank you for your comments, I hope this clarifies some of my choices, but I think I also have some issues to address.
a neighbor list skin of 1.2 is huge for reduced units, a skin of 4.7 humongous (almost 4x your cutoff). That certainly contributes to having too many neighbors for the default settings.
I overlooked this, thank you.
why do you include “ellipsoid” in your atom style? nothing seems to use it.
I wanted finite sized particles, is this incorrect to use?
what is the point of the various indenters?
There’s a typo in there (sorry), but the purpose is to set two inward planes at the top/bottom of the cylinder, to shrink the cylinder length, allowing with radius.
why are you ramping the soft potential (and starting from 0.0) while you want to do NPT? that makes no sense at all
The ramping of the “soft” potential is usually to unoverlap entangled random polymer geometries. Why combine this with NPT equilibration
I switched from nvt to npt, because I am changing the volume I am simulating in. However, based on comments here (and from Shern) it sounds like I am mistaken. Yes, I am trying to unoverlap entangled random polymer geometries.
why do this all at the same time? the normal procedure would be to first equilibrate your system to a defined state and then add “modifications” or “experiments” to it.
I first run X steps with these interaction parameters while adjusting the simulation volume, followed by Y steps with these parameters with fixed simulation volume (so a “proper” equilibration), using nvt/langevin
It’s best to think of the various fix n* as integrators. Whether or not they sample the various thermodynamic ensembles is up to the user input. For example, people regularly “heat up” their systems to a desired temperature using something like fix NVT all nvt temp 100 400 200.0. This is valid, and useful, and at no point do any of those trajectories sample a valid NVT ensemble (because the temperature never actually equilibrates, even though it might come close to).
In order:
fix nve integrates Newtonian equations of motion. It generates trajectories sampling the NVE ensemble if the user does not separately modify the system energy or volume.
fix nvt integrates equations of motion with a Nose-Hoover thermostat, which continuously rescales velocities to sample an NVT ensemble at specified temperature if the user does not separately modify the system energy or volume.
fix npt integrates equations motion with, first, a Nose-Hoover thermostat, and also a barostat which continuously rescales the box size to sample an NPT ensemble at specified temperature and pressure if the user does not separately modify the system energy or volume.
I am not sure that you actually want to sample a well-defined thermodynamic ensemble with your simulations, and that’s ok! What you do want is for your equations of motion to suitably represent some physical feature of your system of interest, and for that you need to make sure your combination of force field, integrator, and other constraints and applied forces actually makes sense. That kind of work is not easily done “remotely”, and our standard advice is for you to consult your supervisor or a local mentor, in addition to carefully checking the literature to ensure that what you’re doing isn’t completely novel and unsupportable.
Also, it’s good practice in these situations to use the simplest possible model available, and only add complications if absolutely necessary. As a practical example, proteins are some of the most complicated molecules to ever exist, and yet most of them can be simulated satisfactorily in LAMMPS using maybe twenty to thirty commands.