# Water box replication

GROMACS version: Any
GROMACS modification: No

Hi.
I am using spc216 water box (unit water box) for my non gromacs calculations.
genbox/solvate increases the size of this unit water box.

How this water box is replicated?
By stacking boxes together or by putting water molecules in the space?

What are the parameters used to replicate the box?
like, what is gap value between two adjacent boxes used.
If i want to replicate the box myself (without using solvate) of let’s say 545 size. How values should I keep in mind? How can I do it.

Thank You

Coordinates in the box are simply stacked next to one another, apply a shift in coordinates along the three Cartesian axes equal to the relevant component of the box vector. That is, starting from the coordinate origin, a box is placed and overlapping atoms deleted. Next, the coordinates are translated in one dimension by the value of the box size in that dimension and the process is repeated until the box surrounding the solute is full.

The box Gromacs creates has symmetry such that viewing from any point, all the same residues from unit box align in that axis no matter how big the box is.
a) It means gromacs is not doing any stochastic calculations for adding water. The boxes are arranged in proper grid.

That is, starting from the coordinate origin, a box is placed and overlapping atoms deleted.

How the placement happens? Is there any overlap, how is that overlap calculated (a)?
Or there is a gap in placement such that boxes stack perfectly, how is that gap calculated? This was my original question.

relevant component of the box vector.

I don’t know this. :)

After the box is created gromacs trims the boundaries to match the input size in nm by user.
In my view, I may be wrong, the boxes other than these boundary ones are complete and not trimmed.

Thank You

GROMACS tools assume the coordinate file provided for solvent is a pre-equilibrated box, so that they can be simply stacked next to one another, imposing no special gap, because the molecules exist as they were under periodic boundary conditions.

If you don’t know box dimensions, you can’t use the tiling approach that GROMACS does.

This is correct.

I know the box boundaries.

Stacking boxes is just linear transformation in all axis. (any other method? please do tell me)

Question will be how much to linear transform?

If I add 18.60A to each atom in x-axis, let’s say 4 times, I get 5 boxes stacked together almost like Gromacs positions. (diff of 0.036A)

But I can also use 19.0, 19.16 etc for placing the box, which doesn’t match the gromacs box.

How is this value calculated? (my main question)

I got 18.60A for spc216 by trial and error. Need to fine tune it.

What formula gives us this stacking value?

This formula works for all types of unit boxes.

hi,

The box file is found in path share/top/spc216.gro in your \$GMXPREFIX. The last line of a gro file contain the box vectors in nanometers. (pretty close to your guess, 1.86206 1.86206 1.86206)

1 Like

hahahaha

I spent more than a month doing testing and trials to figure out this value.
Last line was the answer. Life is interesting.

Gromacs uses this value, good, but the question will still be there, how gromacs reached at this value? Or whichever software was used to make this, how did that script got this value?
Reason: I need to create my own unit water boxes at different temperatures and densities.
I can split this question as another post if not appropriate here. :)

Thank You

The water box GROMACS uses is a pre-equilibrated configuration from a prior simulation conducted under an NPT ensemble.

The simplest thing to do is start with the existing boxes of water and perform new simulations under those new conditions.

Yes, that’s the idea.
Use existing box to create a big box, do 1000s of iterations and energy minimizations to get the desired state.
From that take out a unit water box. No idea how to do this.
Can gromacs create unit boxes?

Question will be same, how the box size is estimated?
tp5 is 2.5nm, tp4 is 1.868nm and spc216 is 1.862nm

Is there any rule of unit box size based on density, temperature etc?
However Gromaccs do it.
It’s more dev question but they refused.

If gromacs can give unit water boxes after the way I need, we can close this queston.

You can select atoms in a region of space using `gmx select` with geometric criteria to create an index file that can be passed to `gmx trjconv`.

Again, it’s not an estimate or a value you can calculate a priori, it’s simply an outcome of a simulation, the value of the box at the instant the snapshot was saved.

It’s a product of the force field. All water models produce different densities.

Let’s say we want four boxes, random example
I doubt if same density will be possible at different temperatures. If yes, good.

1. Density: 1000 , temp: 150F
2. Density: 1000, temp:: 120F
3. Density: 1500, temp: 150F
4. Density: 1500, temp: 120F

Take any example. Just to get the idea and understanding.
How should one proceed to do make these unit boxes?
What will be the size of unit water box which when replicated can mimic the same behavior as a big box?

tp5 is 2.5nm and tp4 is 1.8 nm so some calculations are going on to determine this size.

You can scale a box to a set density with `gmx editconf -density`. Replicating the box will not change the density. But unless you know the correct density for your simulated pressure, temperature and force field this will be unphysical (or rather, will change the pressure, possibly far away from the conditions the force field was developed for).

I need to get the unit box for my own code.
How to get the unit box of the desired density and temperature from the bigger box?

Sorry can’t understand this part.

I misspoke. If you’re setting the density and the temperature you’re simulating an NVT ensemble. That isn’t unphysical by itself.

But I don’t understand what else you need to create your “unit box”. If you only care about the density, the temperature does not matter, only the box size does. Just set the density using `editconf`. Then replicate and cut to your final size. The density will not change.

How to determine this size?
tp5 is 2.5nm, tp4 is 1.8 , these doesn’t sound like arbitrary numbers. Some logic is there.

As jalemkul has pointed out, they are water boxes with the outcome equilibrium density for some simulation parameters (likely at T = 300 K and p = 1 bar). The size of that box isn’t arbitrary, but you can replicate and cut it to any arbitrary size since those operations conserve density (as long as atoms in the box are evenly distributed, which they are in these boxes).

If you want to determine this size/density for yourself, here’s an experiment for you to perform: scale the box to a different size using `gmx editconf -scale` (or with `-density`). Enable pressure coupling to 1 bar and temperature coupling to 300 K and run a simulation. Use `gmx energy` to plot and calculate the box size and density once it reaches its equilibrium.

That’s good.
Will test this.
This will do density based boxes.

How to confirm temperature specific boxes? 300K, 320K and so on?
How to confirm this?