# Increase box size and continue a run

**URL:** <https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516>\
**Category:** User discussions\
**Created:** [January 31, 2021, 2:18am UTC](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516 "2021-01-31T02:18:59Z")\
**Posts on this page:** 18\
**Page:** 2

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [February 5, 2021, 7:23pm UTC](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516/21 "2021-02-05T19:23:52Z")

</div>

Your ions are out of order. The order of molecules (and the number of each) in `[molecules]` must match the order of the molecules in the coordinate file. The individual numbering in the coordinate file is irrelevant. The order has to be the same. `grompp` expects sodium ions when it reaches atom 1575018 but it finds a chloride.

---

<div class="post-metadata">

**Author:** ![L\_k](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@L\_k](https://gromacs.bioexcel.eu/u/L_k)\
**Post date:** [February 5, 2021, 11:11pm UTC](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516/22 "2021-02-05T23:11:44Z")

</div>

I now understand what this means and corrected this error in the gro file. I now have an error in energy minimization. There is another thread with a similar error but I was wondering if there were additional suggestions, or if you had additional feedback on them.

The error is:

Energy minimization has stopped because the force on at least one atom is not finite. This usually means atoms are overlapping. Modify the input coordinates to remove atom overlap or use soft-core potentials with the free energy code to avoid infinite forces. You could also be lucky that switching to double precision is sufficient to obtain finite forces.

Writing lowest energy coordinates.

Steepest Descents converged to machine precision in 15 steps,  
but did not reach the requested Fmax \< 500.  
Potential Energy = 6.9141134e+18  
Maximum force = inf on atom 98449  
Norm of force = inf

No approaches received feedback from the other thread (posted below) and so I was wondering if there were additional suggestions to try.

> [@Energy minimization has stopped](https://gromacs.bioexcel.eu/t/energy-minimization-has-stopped/767/2):
>
> - check your starting structure by looking at atom 4698, maybe some error occur when you built the starting structure and you have two overlapping atoms
> - maybe you have one solvent molecule overlapping with another molecule, in that case remove it
> - check the energy minimisation parameter in mdp file maybe some values are not suitable for your case (e.i maybe step value is too large)

Again, I greatly appreciate all of your guidance on this. It has been a great learning opportunity.

---

<div class="post-metadata">

**Author:** ![pjohansson](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/pjohansson/32/316_2.png) [@pjohansson](https://gromacs.bioexcel.eu/u/pjohansson)\
**Post date:** [February 6, 2021, 9:32am UTC](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516/23 "2021-02-06T09:32:08Z")

</div>

Hello,

did you follow the steps outlined in that response? As noted in the error message and thread, an infinite force on an atom usually means that another atom has the same (or incredibly similar) position. This causes the 1/r^12 term in the Lennard-Jones potential to blow up since r is 0 (well, all 1/r terms will). Checking your configuration for atoms overlapping with atom #98449 may solve it.

Regards,  
Petter

---

<div class="post-metadata">

**Author:** ![L\_k](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@L\_k](https://gromacs.bioexcel.eu/u/L_k)\
**Post date:** [February 7, 2021, 5:20am UTC](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516/24 "2021-02-07T05:20:29Z")

</div>

Hello,

I tried removing the atom since it is just a solvent molecule (in the gro file). But then I get the error:

Fatal error:  
Invalid line in protein\_edit.gro for atom 1594427:  
21 21 21

Stopping at the line with the box size. I am also trying to see where the overlap is in vim - but am unsure of how to do so at the moment.

---

<div class="post-metadata">

**Author:** ![L\_k](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@L\_k](https://gromacs.bioexcel.eu/u/L_k)\
**Post date:** [February 7, 2021, 5:32am UTC](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516/25 "2021-02-07T05:32:36Z")

</div>

When I visualize, it appears that the new box is not perfectly aligned with the original. May this be contributing to the original?

---

<div class="post-metadata">

**Author:** ![pjohansson](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/pjohansson/32/316_2.png) [@pjohansson](https://gromacs.bioexcel.eu/u/pjohansson)\
**Post date:** [February 7, 2021, 11:30am UTC](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516/26 "2021-02-07T11:30:31Z")

</div>

Did you edit the number of atoms in the file (line #2) after removing the atoms? The message suggests to me that it is expecting to read more atoms than exist in the file, and thus expects the box size line to be for an atom.

---

<div class="post-metadata">

**Author:** ![L\_k](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@L\_k](https://gromacs.bioexcel.eu/u/L_k)\
**Post date:** [February 7, 2021, 2:39pm UTC](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516/27 "2021-02-07T14:39:55Z")

</div>

Hello and thank you for your reply.

I did edit that as well. But because the atom overlapping (OW98449) is part of a water molecule (or so I think), it leads me to the error that the number of atoms in the topology and gro do not match. Then if I delete one SOL molecule from the topology there are 1594424 atoms, and 1594426 in the gro file. How can I determine which other atoms to delete from the gro file? I tried deleting 2 hydrogens (HW#) but then the lines are offset and atom names do not match between the topology and gro file (same error as above).

---

<div class="post-metadata">

**Author:** ![pjohansson](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/pjohansson/32/316_2.png) [@pjohansson](https://gromacs.bioexcel.eu/u/pjohansson)\
**Post date:** [February 7, 2021, 7:02pm UTC](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516/28 "2021-02-07T19:02:58Z")

</div>

Molecules are whole in the .gro file. The OW atom is followed by its two bonded hydrogen atoms, they must all be deleted as a group.

---

<div class="post-metadata">

**Author:** ![L\_k](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@L\_k](https://gromacs.bioexcel.eu/u/L_k)\
**Post date:** [February 8, 2021, 2:00pm UTC](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516/29 "2021-02-08T14:00:50Z")

</div>

Perfect! I understand now. And this worked perfectly for removing the first that overlapped. However, I get the same error for a different number atom that I cannot find in the gro file (when I search it in vim it is not found). Could this be an atom in the topology file and there is some mismatch between them still?

---

<div class="post-metadata">

**Author:** ![L\_k](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@L\_k](https://gromacs.bioexcel.eu/u/L_k)\
**Post date:** [February 8, 2021, 7:39pm UTC](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516/30 "2021-02-08T19:39:37Z")

</div>

I know that I have to delete lost atoms, but cannot find a command to do so.

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [February 8, 2021, 7:51pm UTC](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516/31 "2021-02-08T19:51:34Z")

</div>

There isn’t a command. You delete lines using a text editor and update the atom count (and the topology). If you find yourself just chasing water molecules with bad contacts, it means you’ve done something wrong in building the system. A stray water or two sometimes happens, but usually going and deleting things is a poor idea for a fix because the problem lies elsewhere.

---

<div class="post-metadata">

**Author:** ![L\_k](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@L\_k](https://gromacs.bioexcel.eu/u/L_k)\
**Post date:** [February 17, 2021, 3:06pm UTC](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516/32 "2021-02-17T15:06:47Z")

</div>

I have gone through the equilibration steps, but can I just run the new tpr file from the old checkpoint? Or I tried running just using -deffnm, but the error says I have to specify -s.

---

<div class="post-metadata">

**Author:** ![L\_k](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@L\_k](https://gromacs.bioexcel.eu/u/L_k)\
**Post date:** [February 17, 2021, 3:07pm UTC](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516/33 "2021-02-17T15:07:08Z")

</div>

Thank you for your advice. I was able to fix the setup and equilibrate appropriately.

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [February 17, 2021, 4:57pm UTC](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516/34 "2021-02-17T16:57:57Z")

</div>

> [@L\_k](#):
>
> but can I just run the new tpr file from the old checkpoint?

Your old system is irrelevant. The checkpoint file contains information about a totally different system. You’re running a new simulation.

---

<div class="post-metadata">

**Author:** ![L\_k](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@L\_k](https://gromacs.bioexcel.eu/u/L_k)\
**Post date:** [February 24, 2021, 4:39pm UTC](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516/35 "2021-02-24T16:39:11Z")

</div>

I see, and I did get the output data. It still began at time 0ns. This means that I can never begin from the time where I left off, right? Even though I built the new gro file from an already running simulation.

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [February 24, 2021, 7:18pm UTC](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516/36 "2021-02-24T19:18:38Z")

</div>

> [@L\_k](#):
>
> This means that I can never begin from the time where I left off, right? Even though I built the new gro file from an already running simulation.

Yes, as I’ve said a few times. You are starting a totally new simulation (because you are not preserving any velocities from the previous simulation), using only a previous starting configuration for a subset of the system (not the entire thing, because you’ve added solvent, ions, etc).

---

<div class="post-metadata">

**Author:** ![L\_k](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@L\_k](https://gromacs.bioexcel.eu/u/L_k)\
**Post date:** [February 24, 2021, 7:29pm UTC](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516/37 "2021-02-24T19:29:58Z")

</div>

Right I understand. Thank you for all of your help, I greatly appreciate it.

---

<div class="post-metadata">

**Author:** ![mannu](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@mannu](https://gromacs.bioexcel.eu/u/mannu)\
**Post date:** [November 7, 2024, 6:17am UTC](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516/38 "2024-11-07T06:17:04Z")

</div>

Sir,  
I was trying to increase the size of box after generating a protein water system in charmm gui as for bigger system charmm gui terminates after 7 days. I created a box using editconf and solvate. Iam using TIP3 but the topol.top generated has SOL. So, I changed the topol.top by adding the SOL atoms to TIP3 and changed gro file using vmd renaming the SOL to TIP3 and OW to OH2, HW1 to H1, HW2 to H2 as per the TIP3 forcefield. Is this practice acceptable, if not can please guide me. Using this, I was able to run grommp and generate em.tpr.

Thanking you  
Manisha

[Previous page](https://gromacs.bioexcel.eu/t/increase-box-size-and-continue-a-run/1516.md?page=1)
