diff --git a/doc/sphinx/visualization.rst b/doc/sphinx/visualization.rst
index 63d6880d862..6655698b6bc 100644
--- a/doc/sphinx/visualization.rst
+++ b/doc/sphinx/visualization.rst
@@ -175,10 +175,10 @@ screenshots without blocking the simulation script::
for i in range(100):
system.integrator.run(1)
- visualizer.screenshot('screenshot_{}.jpg'.format(i))
+ visualizer.screenshot('screenshot_{:0>5}.png'.format(i))
# You may consider creating a video with ffmpeg:
- # ffmpeg -f image2 -framerate 30 -i 'screenshot_%d.jpg' output.mp4
+ # ffmpeg -f image2 -framerate 30 -i 'screenshot_%05d.png' output.mp4
It is also possible to create a snapshot during online visualization.
Simply press the *enter* key to create a snapshot of the current window,
diff --git a/doc/tutorials/01-lennard_jones/01-lennard_jones.ipynb b/doc/tutorials/01-lennard_jones/01-lennard_jones.ipynb
index 940b5fb2db7..c92c3f7cf47 100644
--- a/doc/tutorials/01-lennard_jones/01-lennard_jones.ipynb
+++ b/doc/tutorials/01-lennard_jones/01-lennard_jones.ipynb
@@ -598,21 +598,21 @@
],
"metadata": {
"kernelspec": {
- "display_name": "Python 2",
+ "display_name": "Python 3",
"language": "python",
- "name": "python2"
+ "name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
- "version": 2
+ "version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
- "pygments_lexer": "ipython2",
- "version": "2.7.15rc1"
+ "pygments_lexer": "ipython3",
+ "version": "3.6.8"
}
},
"nbformat": 4,
diff --git a/doc/tutorials/02-charged_system/02-charged_system-1.ipynb b/doc/tutorials/02-charged_system/02-charged_system-1.ipynb
index d3a3354ba26..61f6d856831 100644
--- a/doc/tutorials/02-charged_system/02-charged_system-1.ipynb
+++ b/doc/tutorials/02-charged_system/02-charged_system-1.ipynb
@@ -461,21 +461,21 @@
],
"metadata": {
"kernelspec": {
- "display_name": "Python 2",
+ "display_name": "Python 3",
"language": "python",
- "name": "python2"
+ "name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
- "version": 2
+ "version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
- "pygments_lexer": "ipython2",
- "version": "2.7.14"
+ "pygments_lexer": "ipython3",
+ "version": "3.6.8"
}
},
"nbformat": 4,
diff --git a/doc/tutorials/02-charged_system/02-charged_system-2.ipynb b/doc/tutorials/02-charged_system/02-charged_system-2.ipynb
index 2afb32949a7..3c897e5a2fd 100644
--- a/doc/tutorials/02-charged_system/02-charged_system-2.ipynb
+++ b/doc/tutorials/02-charged_system/02-charged_system-2.ipynb
@@ -425,8 +425,15 @@
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
- "plt.ion()\n",
- "\n",
+ "plt.ion()\n"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
"plt.figure(figsize=(10, 6), dpi=80)\n",
"plt.plot(z_values, z_dens_na, label='Na')\n",
"plt.plot(z_values, z_dens_cl, label='Cl')\n",
@@ -471,21 +478,21 @@
],
"metadata": {
"kernelspec": {
- "display_name": "Python 2",
+ "display_name": "Python 3",
"language": "python",
- "name": "python2"
+ "name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
- "version": 2
+ "version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
- "pygments_lexer": "ipython2",
- "version": "2.7.14"
+ "pygments_lexer": "ipython3",
+ "version": "3.6.8"
}
},
"nbformat": 4,
diff --git a/doc/tutorials/02-charged_system/scripts/nacl_units_vis.py b/doc/tutorials/02-charged_system/scripts/nacl_units_vis.py
index e207dc30d8b..665dfb1333f 100644
--- a/doc/tutorials/02-charged_system/scripts/nacl_units_vis.py
+++ b/doc/tutorials/02-charged_system/scripts/nacl_units_vis.py
@@ -67,88 +67,91 @@ def decreaseTemp():
'g', visualization_opengl.KeyboardFireEvent.Hold, decreaseTemp))
-def main():
+print("\n--->Setup system")
+
+# System parameters
+n_ppside = 10
+n_part = int(n_ppside**3)
+n_ionpairs = n_part / 2
+density = 1.5736
+time_step = 0.001823
+temp = 298.0
+gamma = 20.0
+#l_bjerrum = 0.885^2 * e^2/(4*pi*epsilon_0*k_B*T)
+l_bjerrum = 130878.0 / temp
+
+num_steps_equilibration = 30
+
+# Particle parameters
+types = {"Cl": 0, "Na": 1}
+numbers = {"Cl": n_ionpairs, "Na": n_ionpairs}
+charges = {"Cl": -1.0, "Na": 1.0}
+lj_sigmas = {"Cl": 3.85, "Na": 2.52}
+lj_epsilons = {"Cl": 192.45, "Na": 17.44}
+
+lj_cuts = {"Cl": 3.0 * lj_sigmas["Cl"],
+ "Na": 3.0 * lj_sigmas["Na"]}
+
+masses = {"Cl": 35.453, "Na": 22.99}
+
+# Setup System
+box_l = (n_ionpairs * sum(masses.values()) / density)**(1. / 3.)
+system.box_l = [box_l, box_l, box_l]
+system.periodicity = [1, 1, 1]
+system.time_step = time_step
+system.cell_system.skin = 0.3
+system.thermostat.set_langevin(kT=temp, gamma=gamma, seed=42)
+
+# Place particles on a face-centered cubic lattice
+q = 1
+l = box_l / n_ppside
+for i in range(n_ppside):
+ for j in range(n_ppside):
+ for k in range(n_ppside):
+ p = numpy.array([i, j, k]) * l
+ if q < 0:
+ system.part.add(id=len(
+ system.part), type=types["Cl"], pos=p, q=charges["Cl"], mass=masses["Cl"])
+ else:
+ system.part.add(id=len(
+ system.part), type=types["Na"], pos=p, q=charges["Na"], mass=masses["Na"])
- print("\n--->Setup system")
-
- # System parameters
- n_ppside = 10
- n_part = int(n_ppside**3)
- n_ionpairs = n_part / 2
- density = 1.5736
- time_step = 0.001823
- temp = 298.0
- gamma = 20.0
- #l_bjerrum = 0.885^2 * e^2/(4*pi*epsilon_0*k_B*T)
- l_bjerrum = 130878.0 / temp
-
- num_steps_equilibration = 30
-
- # Particle parameters
- types = {"Cl": 0, "Na": 1}
- numbers = {"Cl": n_ionpairs, "Na": n_ionpairs}
- charges = {"Cl": -1.0, "Na": 1.0}
- lj_sigmas = {"Cl": 3.85, "Na": 2.52}
- lj_epsilons = {"Cl": 192.45, "Na": 17.44}
-
- lj_cuts = {"Cl": 3.0 * lj_sigmas["Cl"],
- "Na": 3.0 * lj_sigmas["Na"]}
-
- masses = {"Cl": 35.453, "Na": 22.99}
-
- # Setup System
- box_l = (n_ionpairs * sum(masses.values()) / density)**(1. / 3.)
- system.box_l = [box_l, box_l, box_l]
- system.periodicity = [1, 1, 1]
- system.time_step = time_step
- system.cell_system.skin = 0.3
- system.thermostat.set_langevin(kT=temp, gamma=gamma, seed=42)
-
- # Place particles on a face-centered cubic lattice
- q = 1
- l = box_l / n_ppside
- for i in range(n_ppside):
- for j in range(n_ppside):
- for k in range(n_ppside):
- p = numpy.array([i, j, k]) * l
- if q < 0:
- system.part.add(id=len(
- system.part), type=types["Cl"], pos=p, q=charges["Cl"], mass=masses["Cl"])
- else:
- system.part.add(id=len(
- system.part), type=types["Na"], pos=p, q=charges["Na"], mass=masses["Na"])
-
- q *= -1
q *= -1
q *= -1
+ q *= -1
+
+
+def combination_rule_epsilon(rule, eps1, eps2):
+ if rule == "Lorentz":
+ return (eps1 * eps2)**0.5
+ else:
+ return ValueError("No combination rule defined")
+
+
+def combination_rule_sigma(rule, sig1, sig2):
+ if rule == "Berthelot":
+ return (sig1 + sig2) * 0.5
+ else:
+ return ValueError("No combination rule defined")
+
+# Lennard-Jones interactions parameters
+for s in [["Cl", "Na"], ["Cl", "Cl"], ["Na", "Na"]]:
+ lj_sig = combination_rule_sigma(
+ "Berthelot", lj_sigmas[s[0]], lj_sigmas[s[1]])
+ lj_cut = combination_rule_sigma(
+ "Berthelot", lj_cuts[s[0]], lj_cuts[s[1]])
+ lj_eps = combination_rule_epsilon(
+ "Lorentz", lj_epsilons[s[0]], lj_epsilons[s[1]])
+
+ system.non_bonded_inter[types[s[0]], types[s[1]]].lennard_jones.set_params(
+ epsilon=lj_eps, sigma=lj_sig, cutoff=lj_cut, shift="auto")
- def combination_rule_epsilon(rule, eps1, eps2):
- if rule == "Lorentz":
- return (eps1 * eps2)**0.5
- else:
- return ValueError("No combination rule defined")
-
- def combination_rule_sigma(rule, sig1, sig2):
- if rule == "Berthelot":
- return (sig1 + sig2) * 0.5
- else:
- return ValueError("No combination rule defined")
-
- # Lennard-Jones interactions parameters
- for s in [["Cl", "Na"], ["Cl", "Cl"], ["Na", "Na"]]:
- lj_sig = combination_rule_sigma(
- "Berthelot", lj_sigmas[s[0]], lj_sigmas[s[1]])
- lj_cut = combination_rule_sigma(
- "Berthelot", lj_cuts[s[0]], lj_cuts[s[1]])
- lj_eps = combination_rule_epsilon(
- "Lorentz", lj_epsilons[s[0]], lj_epsilons[s[1]])
-
- system.non_bonded_inter[types[s[0]], types[s[1]]].lennard_jones.set_params(
- epsilon=lj_eps, sigma=lj_sig, cutoff=lj_cut, shift="auto")
-
- print("\n--->Tuning Electrostatics")
- p3m = electrostatics.P3M(prefactor=l_bjerrum, accuracy=1e-2)
- system.actors.add(p3m)
+print("\n--->Tuning Electrostatics")
+p3m = electrostatics.P3M(prefactor=l_bjerrum, accuracy=1e-2)
+system.actors.add(p3m)
+
+
+def main():
print("\n--->Temperature Equilibration")
system.time = 0.0
diff --git a/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part1.ipynb b/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part1.ipynb
index f7e8775ca0f..e5a130a2af7 100644
--- a/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part1.ipynb
+++ b/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part1.ipynb
@@ -54,8 +54,7 @@
"\n",
"### Notes on the **ESPResSo** version you will need\n",
"\n",
- "With version 3.1 **ESPResSo** offers GPU support for LB. We recommend however\n",
- "version 3.3, which has more features. We absolutely recommend using the GPU code,\n",
+ "**ESPResSo** offers both CPU and GPU support for LB. We recommend using the GPU code,\n",
"as it is much (100x) faster than the CPU code.\n",
"\n",
"For the tutorial you will have to compile in the following features: \n",
@@ -381,7 +380,6 @@
"espressomd.assert_features(['CUDA', 'LB_BOUNDARIES_GPU'])\n",
"from espressomd import System, lb, lbboundaries, shapes\n",
"import numpy as np\n",
- "import sys\n",
"\n",
"# System setup\n",
"system = System(box_l=[1.0, 1.0, 1.0]) # The box_l is specified below.\n",
@@ -453,8 +451,7 @@
"for i in range(10):\n",
" system.integrator.run(400)\n",
" lbf.print_vtk_velocity(\"fluid%04i.vtk\" % i)\n",
- " sys.stdout.write(\"\\rloop: %02i\" % i)\n",
- " sys.stdout.flush()\n",
+ " print(\"\\rloop: %02i\" % (i+1), end=\"\")\n",
"\n",
"\n",
"print(\"\\nIntegration finished.\")\n",
@@ -521,21 +518,21 @@
],
"metadata": {
"kernelspec": {
- "display_name": "Python 2",
+ "display_name": "Python 3",
"language": "python",
- "name": "python2"
+ "name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
- "version": 2
+ "version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
- "pygments_lexer": "ipython2",
- "version": "2.7.12"
+ "pygments_lexer": "ipython3",
+ "version": "3.6.8"
}
},
"nbformat": 4,
diff --git a/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part2.ipynb b/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part2.ipynb
index d8e68103332..981f2999e17 100644
--- a/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part2.ipynb
+++ b/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part2.ipynb
@@ -78,7 +78,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "Our first step is to investigate the diffusion of a single particle that is coupled to an LB fluid by the point coupling method. Start with an friction coefficient of 1.0:"
+ "Our first step is to investigate the diffusion of a single particle that is coupled to an LB fluid by the point coupling method. Start with a friction coefficient of 1.0:"
]
},
{
@@ -94,7 +94,6 @@
"from espressomd.accumulators import Correlator\n",
"\n",
"import numpy as np\n",
- "import sys\n",
"\n",
"# Constants\n",
"loops = 40000\n",
@@ -125,7 +124,7 @@
"# Equilibrate\n",
"print(\"Equilibrating the system.\")\n",
"system.integrator.run(1000)\n",
- "print(\"Equlibration finished.\")\n",
+ "print(\"Equilibration finished.\")\n",
"\n",
"# Setup observable correlator\n",
"pos = ParticlePositions(ids=(0,))\n",
@@ -138,10 +137,9 @@
" system.integrator.run(steps)\n",
"\n",
" if i % 1e2 == 0:\n",
- " sys.stdout.write(\"\\rSampling: {:.0f}%\".format(i * 100. / loops))\n",
- " sys.stdout.flush()\n",
+ " print(\"\\rSampling: {:.0f}%\".format(i * 100. / loops), end=\"\")\n",
"\n",
- "sys.stdout.write(\"\\rSampling finished.\\n\")\n",
+ "print(\"\\rSampling finished.\")\n",
"\n",
"c.finalize()\n",
"corrdata = c.result()\n",
@@ -192,21 +190,21 @@
],
"metadata": {
"kernelspec": {
- "display_name": "Python 2",
+ "display_name": "Python 3",
"language": "python",
- "name": "python2"
+ "name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
- "version": 2
+ "version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
- "pygments_lexer": "ipython2",
- "version": "2.7.12"
+ "pygments_lexer": "ipython3",
+ "version": "3.6.8"
}
},
"nbformat": 4,
diff --git a/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part3.ipynb b/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part3.ipynb
index 9273fab2eab..9f84d699646 100644
--- a/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part3.ipynb
+++ b/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part3.ipynb
@@ -66,7 +66,6 @@
"\n",
"from numpy import savetxt, zeros\n",
"import numpy as np\n",
- "import sys\n",
"\n",
"# Setup constant\n",
"time_step = 0.01\n",
@@ -144,10 +143,9 @@
"for i in range(loops):\n",
" system.integrator.run(step_per_loop)\n",
" system.analysis.append()\n",
- " sys.stdout.write(\"\\rSampling: {:.0f}%\".format(i * 100. / loops))\n",
- " sys.stdout.flush()\n",
+ " print(\"\\rSampling: {:.0f}%\".format(i * 100. / loops), end=\"\")\n",
"\n",
- "sys.stdout.write(\"\\rSampling finished.\\n\")\n",
+ "print(\"\\rSampling finished.\")\n",
"\n",
"c.finalize()\n",
"corrdata = c.result()\n",
@@ -187,21 +185,21 @@
],
"metadata": {
"kernelspec": {
- "display_name": "Python 2",
+ "display_name": "Python 3",
"language": "python",
- "name": "python2"
+ "name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
- "version": 2
+ "version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
- "pygments_lexer": "ipython2",
- "version": "2.7.12"
+ "pygments_lexer": "ipython3",
+ "version": "3.6.8"
}
},
"nbformat": 4,
diff --git a/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part4.ipynb b/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part4.ipynb
index 431b546bc41..59bb2ae11b8 100644
--- a/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part4.ipynb
+++ b/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part4.ipynb
@@ -124,21 +124,21 @@
],
"metadata": {
"kernelspec": {
- "display_name": "Python 2",
+ "display_name": "Python 3",
"language": "python",
- "name": "python2"
+ "name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
- "version": 2
+ "version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
- "pygments_lexer": "ipython2",
- "version": "2.7.12"
+ "pygments_lexer": "ipython3",
+ "version": "3.6.8"
}
},
"nbformat": 4,
diff --git a/doc/tutorials/04-lattice_boltzmann/scripts/part4_plot.py b/doc/tutorials/04-lattice_boltzmann/scripts/part4_plot.py
index 5376653345d..e4dbbf21a36 100644
--- a/doc/tutorials/04-lattice_boltzmann/scripts/part4_plot.py
+++ b/doc/tutorials/04-lattice_boltzmann/scripts/part4_plot.py
@@ -37,6 +37,6 @@
plt.plot(pos, ana, label='analytical')
plt.plot(pos, scaling * sim, '+', label='simulated')
plt.xlabel('$x$-axis ($\AA$)', fontsize=20)
-plt.ylabel('LB fluid velocity $u_y(x)$ ($\AA/s)$', fontsize=20)
+plt.ylabel('LB fluid velocity $u_y(x)$ ($\AA/s$)', fontsize=20)
plt.legend(fontsize=20)
plt.show()
diff --git a/doc/tutorials/05-raspberry_electrophoresis/05-raspberry_electrophoresis.ipynb b/doc/tutorials/05-raspberry_electrophoresis/05-raspberry_electrophoresis.ipynb
index ba32ec538b0..61d8e43c436 100644
--- a/doc/tutorials/05-raspberry_electrophoresis/05-raspberry_electrophoresis.ipynb
+++ b/doc/tutorials/05-raspberry_electrophoresis/05-raspberry_electrophoresis.ipynb
@@ -19,7 +19,7 @@
"resemble a raspberry as can be seen in Fig. 1. After covering the construction of a raspberry colloid, we then\n",
"briefly discuss the inclusion of hydrodynamic interactions via a lattice-Boltzmann fluid. Finally we will cover\n",
"including ions via the restrictive primitive model (hard sphere ions) and the addition of an electric field\n",
- "to measure the electrokinetic properties. this script will run a raspberry electrophoresis simulation and write the time and position of the colloid out to a file named posVsTime.dat in the same directory.\n",
+ "to measure the electrokinetic properties. This script will run a raspberry electrophoresis simulation and write the time and position of the colloid out to a file named posVsTime.dat in the same directory.\n",
"A sample set of data is included in the file posVsTime_sample.dat."
]
},
@@ -615,21 +615,21 @@
],
"metadata": {
"kernelspec": {
- "display_name": "Python 2",
+ "display_name": "Python 3",
"language": "python",
- "name": "python2"
+ "name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
- "version": 2
+ "version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
- "pygments_lexer": "ipython2",
- "version": "2.7.12"
+ "pygments_lexer": "ipython3",
+ "version": "3.6.8"
}
},
"nbformat": 4,
diff --git a/doc/tutorials/08-visualization/08-visualization.ipynb b/doc/tutorials/08-visualization/08-visualization.ipynb
index f217b0f45ef..afdd9c25d3a 100644
--- a/doc/tutorials/08-visualization/08-visualization.ipynb
+++ b/doc/tutorials/08-visualization/08-visualization.ipynb
@@ -384,21 +384,21 @@
],
"metadata": {
"kernelspec": {
- "display_name": "Python 2",
+ "display_name": "Python 3",
"language": "python",
- "name": "python2"
+ "name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
- "version": 2
+ "version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
- "pygments_lexer": "ipython2",
- "version": "2.7.15rc1"
+ "pygments_lexer": "ipython3",
+ "version": "3.6.8"
}
},
"nbformat": 4,
diff --git a/doc/tutorials/11-ferrofluid/11-ferrofluid_part1.ipynb b/doc/tutorials/11-ferrofluid/11-ferrofluid_part1.ipynb
index a4ec29660d3..9dcdeaa992a 100644
--- a/doc/tutorials/11-ferrofluid/11-ferrofluid_part1.ipynb
+++ b/doc/tutorials/11-ferrofluid/11-ferrofluid_part1.ipynb
@@ -206,22 +206,6 @@
"## Python Version"
]
},
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "If you are using python 2 issue the following command to activate the python 3 print syntax"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": [
- "from __future__ import print_function"
- ]
- },
{
"cell_type": "markdown",
"metadata": {},
@@ -233,7 +217,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "For interessting ferrofluid systems, where the fraction of ferromagnetic particles in the liquid carrier and their dipole moment are not vanishingly small, the ferromagnetic particles form clusters of different shapes and sizes. If the fraction and/or dipole moments are big enought the clusters can interconnect with each other and form a whole space occuping network.\n",
+ "For interesting ferrofluid systems, where the fraction of ferromagnetic particles in the liquid carrier and their dipole moment are not vanishingly small, the ferromagnetic particles form clusters of different shapes and sizes. If the fraction and/or dipole moments are big enough the clusters can interconnect with each other and form a whole space occupying network.\n",
"In this part we want to investigate the number of clusters as well as their shape and size in our simulated monolayer ferrofluid system. It should be noted that a monolayer is a quasi three dimensional system (q2D), i.e. two dimensional for the positions and three dimensional for the orientation of the dipole moments."
]
},
@@ -430,7 +414,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "Now we choose the steeptes descent integrator to remove possible overlaps of the particles. Therefore we integrate until the energy of the whole system is lower than $5 k_BT$."
+ "Now we choose the steepest descent integrator to remove possible overlaps of the particles. Therefore we integrate until the energy of the whole system is lower than $5 k_BT$."
]
},
{
@@ -468,7 +452,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "To calculate the dipole-dipole interaction we use the Dipolar P3M method (see Ref. [1]) which is based on the Ewald summation. At default the boundary conditions of the system are set to conducting which means the dielectric constant is set to infinity for the surrounding medium. As we want to simulate a two dimensional system we additionally use the dipolar layer correction (DLC) (see Ref. [2]). As we add DipolarP3M to our system as an actor, a tuning function is started automatically which tries to find the optimal parameters for Dipolar P3M and prints them to the screen. The last line of the output is the value of the tuned skin."
+ "To calculate the dipole-dipole interaction we use the Dipolar P3M method (see Ref. [1]) which is based on the Ewald summation. By default the boundary conditions of the system are set to conducting which means the dielectric constant is set to infinity for the surrounding medium. As we want to simulate a two dimensional system we additionally use the dipolar layer correction (DLC) (see Ref. [2]). As we add DipolarP3M to our system as an actor, a tuning function is started automatically which tries to find the optimal parameters for Dipolar P3M and prints them to the screen. The last line of the output is the value of the tuned skin."
]
},
{
@@ -513,16 +497,16 @@
"equil_steps = 1000\n",
"for i in range(equil_rounds):\n",
" system.integrator.run(equil_steps)\n",
- " print(\"Dipolar energy: %.2f\" % system.analysis.energy()[\"dipolar\"])\n",
- " print(\"progress: {:6.2f} %\".format((float(i)+1)/equil_rounds * 100))\n",
- "print(\"Equilibration done\")"
+ " print(\"progress: {:3.0f}%, dipolar energy: {:9.2f}\".format(\n",
+ " (i + 1) * 100. / equil_rounds, system.analysis.energy()[\"dipolar\"]), end=\"\\r\")\n",
+ "print(\"\\nEquilibration done\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
- "As we are interested in the clustersizes and the number of clusters we now set up the cluster analysis with the distance criterion that a particle is added to a cluster if the nearest neigbors of it are closer than $1.3\\cdot\\sigma_{lj}$."
+ "As we are interested in the cluster sizes and the number of clusters we now set up the cluster analysis with the distance criterion that a particle is added to a cluster if the nearest neigbors of it are closer than $1.3\\cdot\\sigma_{lj}$."
]
},
{
@@ -612,6 +596,7 @@
"import matplotlib.pyplot as plt\n",
"import matplotlib.animation as animation\n",
"from tempfile import NamedTemporaryFile\n",
+ "import base64\n",
"\n",
"VIDEO_TAG = \"\"\"