Regarding restraining molecule between the graphene sheets using colvars

Dear lammps users,
I am doing MD simulation with abf method using colvars module with two
graphene sheets and HSS molecule between them, as the dynamics starts HSS
molecule is escaping the graphene sheets. I want to restrict the molecule so
that it spans all the degrees of freedom in between the graphene sheets.
Each graphene sheet is of size 14 Å in length and width, and are parallel
to each other in xz-plane separated along y-direction whose center of mass
is located at the origin.

I am trying to implement this with colvars, please find my colvars script
below, any help will be appreciated

Hi Prasad, the validity of your input really depends on the correctness of the atom group definitions, which are specific to your system. For this reason, checking the script is best done by you.

Is there a particular issue that you are asking help with?

Giacomo

After re-reading your other posts on the subject, it looks like you are misusing the definitions of the distanceZ/distanceXY variables, which implement cylindrical coordinates. In general, Colvars is useful to apply restraints on complex coordinates: for Cartesian coordinates, you’re better off in terms of simplicity of input and performance using other LAMMPS fixes.

Have you looked at fix wall/region, for example?

Thanks, Giacomo I had checked fix wall/region and it works fine for my system.