Error in simulating system using region and fix wall/region command

Dear all,

I want to simulate with a polymer and many freely diffusing particles in a periodic box, but the polymer should be confined in a region (smaller than the periodic box), while the particles can move in the periodic box and interact with the polymer and themselves.

I used the region sphere command and fix wall/region command, but it shows particles outside the box error.

ERROR on proc 1: Particle outside surface of region used in fix wall/region (…/fix_wall_region.cpp:300)

Is there a way to simulate such a system?

outside the region, not outside the box.

What you describe seems like the correct approach. My guess is that you are not using suitable settings and need to more carefully debug what you are doing. The fact that you are getting an error message does not automatically mean that the approach is flawed, it can just be a flawed execution.

1 Like

Okay, thank you. I will check my code. I just wanted to check that I am using the correct approach.

Mind you, this is “correct” as far as the “mechanics” of the procedure are concerned. Whether this results in meaningful physics is very difficult to say without knowing more. An alternative process could be to apply a position restraint to the center of mass of the polymer via fix spring.

1 Like

As per fix wall/region command — LAMMPS documentation :

The surface of the region only exerts forces on particles “inside” the region; if a particle is “outside” the region it will generate an error, because it has moved through the wall.

It seems you have particles outside the region you have defined. If this has happened right at the start, then your starting configuration is not compatible with your region specification. If this has happened some time during the simulation then maybe the dynamics are “pushing” particles out and your region is too restrictive of the polymer’s motion.

1 Like