Skip to content

Commit 4d73f66

Browse files
committed
further improvement to tutorial 1
1 parent a372040 commit 4d73f66

1 file changed

Lines changed: 66 additions & 54 deletions

File tree

docs/sphinx/source/tutorials/tutorial1/bulk-solution.rst

Lines changed: 66 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,15 @@ into it:
6969

7070
.. code-block:: bw
7171
72-
Empty box
72+
Cubic box
7373
0
7474
3.50000 3.50000 3.50000
7575
7676
.. |empty.gro| raw:: html
7777

7878
<a href="../../../../../../.dependencies/gromacstutorials-inputs/tutorial1/empty.gro" target="_blank">empty.gro</a>
7979

80-
The first line, *Empty box*, is a comment, the second line is the
80+
The first line, *Cubic box*, is a comment, the second line is the
8181
total number of atoms (0), and the last line is the box dimension in nanometer,
8282
here 3.5 nm by 3.5 nm by 3.5 nm. This **.gro** file is written in |Gromos87 format.
8383
@@ -116,7 +116,7 @@ and ``S1``, all grouped in a residue called ``SO4``. Then, let us call the
116116
gmx insert-molecules -ci so4.gro -f empty.gro -o conf.gro -nmol 6 -radius 0.5
117117
118118
Here, the ``insert-molecules`` command of GROMACS uses **empty.gro** as an input (flag ``-f``),
119-
and create a new **.gro** file named **conf.gro** with 6 residue (flag ``-nmol``).
119+
and create a new **.gro** file named **conf.gro** (flag ``-o``) with 6 ions in it (flag ``-nmol``).
120120
The ``-radius 0.5`` option is used to prevent ions for being inserted closer than
121121
:math:`0.5~\text{nm}` from each others. The output should indicate that the
122122
insertion were successful:
@@ -126,66 +126,86 @@ insertion were successful:
126126
Added 6 molecules (out of 6 requested)
127127
Writing generated configuration to conf.gro
128128
129-
130-
131-
132-
129+
Looking at the generated the **conf.gro** file, it contains
130+
30 atoms corresponding to the 6 ions:
133131

134132
.. code-block:: bw
135133
136-
nb_na=$((2 * nb_so4))
137-
gmx insert-molecules -ci na.gro -f conf.gro -o conf.gro -nmol ${nb_na} -radius 0.5
134+
Cubic box
135+
30
136+
1SO4 O1 1 2.231 2.698 0.397
137+
1SO4 O2 2 2.008 2.825 0.356
138+
1SO4 O3 3 2.009 2.566 0.370
139+
1SO4 O4 4 2.115 2.685 0.165
140+
1SO4 S1 5 2.091 2.693 0.322
141+
(...)
142+
6SO4 O1 26 1.147 3.194 0.656
143+
6SO4 O2 27 1.107 3.341 0.446
144+
6SO4 O3 28 1.349 3.274 0.514
145+
6SO4 O4 29 1.216 3.444 0.658
146+
6SO4 S1 30 1.205 3.313 0.568
147+
3.50000 3.50000 3.50000
138148
139-
.. code-block:: bw
149+
Between the second and the
150+
last lines, there is one line per
151+
atom. Each line indicates, from left to right:
140152

141-
nb_h2o=800
142-
gmx insert-molecules -ci h2o.gro -f conf.gro -o conf.gro -nmol ${nb_h2o} -radius 0.14
153+
- the residue ID, with all the atoms from the same
154+
SO\ :sub:`4`\ :sup:`2-` ion sharing the same residue ID,
155+
- the residue name,
156+
- the atom name,
157+
- the atom ID,
158+
- the atom position: :math:`x`, :math:`y`, and :math:`z` coordinates in nanometer.
159+
160+
The format of a **.gro** file is fixed, and each column is in a
161+
fixed position. The generated **conf.gro** file can be visualized
162+
using VMD by typing in the terminal:
163+
164+
.. code-block:: bash
143165
166+
vmd conf.gro
144167
168+
Then, download the |na.gro| template for the Na\ :sup:`+` ion
169+
and add 12 ions using the same command:
145170

171+
.. code-block:: bw
146172
173+
gmx insert-molecules -ci na.gro -f conf.gro -o conf.gro -nmol 12 -radius 0.5
147174
148-
.. |conf-SO4.gro| raw:: html
175+
.. |na.gro| raw:: html
149176

150-
<a href="https://raw.githubusercontent.com/gromacstutorials/gromacstutorials-inputs/main/level1/bulk-solution/conf.gro" target="_blank">here</a>
177+
<a href="../../../../../../.dependencies/gromacstutorials-inputs/tutorial1/na.gro" target="_blank">na.gro</a>
151178

152-
The *conf.gro* file looks like this:
179+
Here, importantly, the same **conf.gro** file is used as input (``-f``) and
180+
output (``-o``), so the 12 ions will be added to the same file. Finally,
181+
download the |h2o.gro| template for the :math:`\text{H}_2\text{O}` molecule
182+
and add 800 molecules using the same command:
153183

154184
.. code-block:: bw
155185
156-
Na2SO4 solution
157-
2846
158-
1 SO4 O1 1 2.608 3.089 2.389
159-
1 SO4 O2 2 2.562 3.181 2.150
160-
1 SO4 O3 3 2.388 3.217 2.339
161-
1 SO4 O4 4 2.425 2.980 2.241
162-
1 SO4 S1 5 2.496 3.117 2.280
163-
(...)
164-
719 Sol OW1 2843 3.220 2.380 1.540
165-
719 Sol HW1 2844 3.279 2.456 1.540
166-
719 Sol HW2 2845 3.279 2.304 1.540
167-
719 Sol MW1 2846 3.230 2.380 1.540
168-
3.36000 3.36000 3.36000
186+
gmx insert-molecules -ci h2o.gro -f conf.gro -o conf.gro -nmol 800 -radius 0.14
169187
170-
Between the second and the
171-
last lines, there is one line per
172-
atom. Each line indicates, from left to right:
188+
.. |h2o.gro| raw:: html
173189

174-
- the residue ID, with all the atoms from the same SO\ :sub:`4`\ :sup:`2-` ion sharing the same residue ID,
175-
- the residue name,
176-
- the atom name,
177-
- the atom ID,
178-
- the atom position: *x*, *y*, and *z* coordinates in nanometer.
179-
180-
Note that the format of a *.gro* file is fixed,
181-
and each column is in a fixed position.
190+
<a href="../../../../../../.dependencies/gromacstutorials-inputs/tutorial1/h2o.gro" target="_blank">h2o.gro</a>
182191

183-
The *conf.gro* file can be visualized using VMD by
184-
typing in the terminal:
192+
The final **conf.gro** file contains :
185193

186-
.. code-block:: bash
194+
.. code-block:: bw
187195
188-
vmd conf.gro
196+
Cubic box
197+
3242
198+
1SO4 O1 1 2.660 2.778 1.461
199+
1SO4 O2 2 2.869 2.640 1.392
200+
1SO4 O3 3 2.686 2.533 1.540
201+
1SO4 O4 4 2.840 2.717 1.638
202+
1SO4 S1 5 2.763 2.667 1.507
203+
(...)
204+
818Sol OW1 3239 1.130 0.170 2.960
205+
818Sol HW1 3240 1.155 0.134 3.058
206+
818Sol HW2 3241 1.039 0.132 2.918
207+
818Sol MW1 3242 1.130 0.170 2.960
208+
3.50000 3.50000 3.50000
189209
190210
.. figure:: ../figures/level1/bulk-solution/step0-light.png
191211
:alt: Gromacs initial configuration of SO\ :sub:`4`\ :sup:`2-` and Na\ :sup:`+` ions visualized with VMD
@@ -200,19 +220,11 @@ typing in the terminal:
200220
Figure: SO\ :sub:`4`\ :sup:`2-` ions, Na\ :sup:`+` ions, and water molecules.
201221
Oxygen atoms are in red, hydrogen in white, sodium in blue, and sulfur in
202222
yellow. For better rendering, the atom representation and colors
203-
were modified with respect to the default VMD representation. If
204-
you want to obtain the same rendering, you can follow this
205-
|vmd-tutorial| from the LAMMPS tutorials webpage to obtain a similar rendering.
206-
207-
.. |vmd-tutorial| raw:: html
208-
209-
<a href="https://lammpstutorials.github.io/sphinx/build/html/tutorials/vmd/vmd-tutorial.html" target="_blank">VMD tutorial</a>
223+
were modified with respect to the default VMD representation.
210224

211225
As can be seen using VMD, the water molecules are
212-
arranged in a quite unrealistic and regular manner, with
213-
all dipoles facing in the same direction, and possibly
214-
wrong distances between some of the molecules and ions.
215-
This will be fixed during energy minimization.
226+
arranged in a quite unrealistic and regular manner.
227+
This will need to be fixed during energy minimization.
216228

217229
2) The topology files (.top .itp)
218230
-------------------------------------

0 commit comments

Comments
 (0)