I have a question about the fix wall/region command. I’m trying to relax a structure inside a defined region. It works fine using NVT as the volume is constant. However, when I switch to NPT it run over several timesteps then it crashes with the error "Particle outside surface of region used in fix wall/region.
Step Temp Press Lx Ly Lz Xy Xz Yz Density Volume TotEng PotEng KinEng
ERROR on proc 8: Particle outside surface of region used in fix wall/region (src/fix_wall_region.cpp:308)
Last command: run 10000
I was wondering if the fix wall/region command supports volume changes or not. Do you have any ideas on how I can simulate a confined system under NPT?
I suspect that the problem you are facing results from the rescaling of coordinates from fix npt.
But before discussing this a question: what is the point of using fix npt, when you have a confined system?
Thank you for your reply ,
I am trying to transform a periodic system into a non-periodic system confined in water. Initially, I relaxed the periodic system using NVT and NPT ensembles, which worked fine. However, due to the complexity of using a classical forcefield and the image flag, it becomes quite complicated to merge the relaxed system with water.
Therefore, my idea is to make initially 2 systems, relax the first system using wall/region constraints to avoid the image flag issue, and then relax the water around it.
It is still not clear to me what you are trying to achieve. Can you provide some simple sketches outlining what your system(s) are supposed to be like at the individual steps?
Since this is not a bulk system, there is no reason to use NPT on this. The atoms are bounded by the confinement potential and that doesn’t change. By default fix npt will scale all positions when it scales the box (see the “dilate” keyword) which is giving you the problem. But you don’t want to adjust the box around the central system anyway.
Once that system is relaxed, you can then add the water to the inverse of the confinement region (e.g. with a molecule file and create_atoms random using the overlap keyword with a suitable value. Then define two groups, water and inner, and then relax that system alternating between using fix setforce 0 0 0 on the water system or the included system. This can initially be done with fix nvt as well and only when the interface between the two subsystems has sufficiently “healed” you could switch to fix npt and possibly remove fix setforce altogether.