From 69aab00aa595f4333797ac2357e17f02bc3c757f Mon Sep 17 00:00:00 2001 From: Florian Weik Date: Fri, 19 Aug 2016 16:22:25 -0600 Subject: [PATCH 1/6] python: Check accuracy paramerter of p3m only when tuning. --- src/python/espressomd/electrostatics.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/espressomd/electrostatics.pyx b/src/python/espressomd/electrostatics.pyx index 130aff6b174..5a856c574c3 100644 --- a/src/python/espressomd/electrostatics.pyx +++ b/src/python/espressomd/electrostatics.pyx @@ -169,7 +169,7 @@ IF P3M == 1: raise ValueError( "P3M cao has to be an integer between -1 and 7") - if not (self._params["accuracy"] >= 0): + if self._params["tune"] and not (self._params["accuracy"] >= 0): raise ValueError("P3M accuracy has to be positive") if self._params["epsilon"] == "metallic": From c7e6d9bc092c5cd46f15101b2478346964a419fc Mon Sep 17 00:00:00 2001 From: Florian Weik Date: Mon, 1 Oct 2018 22:28:54 +0200 Subject: [PATCH 2/6] core: gpu: Removed unused particle property. --- src/core/cuda_interface.hpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/core/cuda_interface.hpp b/src/core/cuda_interface.hpp index 829b544fefe..1c490c498e0 100644 --- a/src/core/cuda_interface.hpp +++ b/src/core/cuda_interface.hpp @@ -94,8 +94,6 @@ struct CUDA_particle_data { float mass; #endif - unsigned int fixed; - #ifdef VIRTUAL_SITES bool is_virtual; #endif From 521515792bd1249e2aa5dde693294e78a802c48e Mon Sep 17 00:00:00 2001 From: Florian Weik Date: Tue, 2 Oct 2018 23:52:11 +0200 Subject: [PATCH 3/6] core: Explicit WCA potential. --- doc/sphinx/inter_non-bonded.rst | 34 ++++++++ src/core/energy_inline.hpp | 5 ++ src/core/forces_inline.hpp | 5 ++ .../nonbonded_interactions/CMakeLists.txt | 1 + .../nonbonded_interaction_data.cpp | 4 + .../nonbonded_interaction_data.hpp | 6 ++ src/core/nonbonded_interactions/wca.cpp | 40 +++++++++ src/core/nonbonded_interactions/wca.hpp | 60 ++++++++++++++ src/features.def | 1 + src/python/espressomd/interactions.pxd | 8 ++ src/python/espressomd/interactions.pyx | 83 ++++++++++++++++++- testsuite/python/interactions_non-bonded.py | 46 +++++++++- 12 files changed, 289 insertions(+), 4 deletions(-) create mode 100644 src/core/nonbonded_interactions/wca.cpp create mode 100644 src/core/nonbonded_interactions/wca.hpp diff --git a/doc/sphinx/inter_non-bonded.rst b/doc/sphinx/inter_non-bonded.rst index dcc16afb35e..b03d11abda5 100644 --- a/doc/sphinx/inter_non-bonded.rst +++ b/doc/sphinx/inter_non-bonded.rst @@ -216,6 +216,40 @@ interaction, while :math:`\delta` varies how smoothly the potential goes to zero alchemical transformations, where a group of atoms can be slowly turned on/off during a simulation. +.. _Weeks-Chandler-Anderson interaction: + +Weeks-Chandler-Anderson interaction +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. note:: + Feature ``WCA`` required. + + +The interface for the Weeks-Chandler-Anderson interactions is implemented in +:class:`espressomd.interactions.WCAInteraction`. They +are configured via the syntax:: + + system.non_bonded_inter[type1, type2].wca.set_params(**kwargs) + +This command defines a Weeks-Chandler-Anderson interaction between particles of the +types ``type1`` and ``type2``. The potential is defined by + +.. math:: + + \label{eq:wca} + V_\mathrm{WCA}(r) = + \begin{cases} + 4 \epsilon \left[ \left(\frac{\sigma}{r}\right)^{12} + - \left(\frac{\sigma}{r}\right)^6 + \frac{1}{4} \right] + & \mathrm{if~} r < \sigma 2^{\frac{1}{6}}\\ + 0 + & \mathrm{otherwise} + \end{cases}. + +The net force on a particle can be capped by using +force capping ``system.non_bonded_inter.set_force_cap(max)``, see +section :ref:`Capping the force during warmup` + .. _Lennard-Jones cosine interaction: Lennard-Jones cosine interaction diff --git a/src/core/energy_inline.hpp b/src/core/energy_inline.hpp index 675a1180616..fd67ce93e4d 100644 --- a/src/core/energy_inline.hpp +++ b/src/core/energy_inline.hpp @@ -58,6 +58,7 @@ #include "nonbonded_interactions/soft_sphere.hpp" #include "nonbonded_interactions/steppot.hpp" #include "nonbonded_interactions/thole.hpp" +#include "nonbonded_interactions/wca.hpp" #ifdef ELECTROSTATICS #include "bonded_interactions/bonded_coulomb.hpp" #endif @@ -100,6 +101,10 @@ inline double calc_non_bonded_pair_energy(const Particle *p1, /* Lennard-Jones */ ret += lj_pair_energy(p1, p2, ia_params, d, dist); #endif +#ifdef WCA + /* WCA */ + ret += wca_pair_energy(p1, p2, ia_params, d, dist); +#endif #ifdef LENNARD_JONES_GENERIC /* Generic Lennard-Jones */ diff --git a/src/core/forces_inline.hpp b/src/core/forces_inline.hpp index f2a6b380b1a..d1e560a2962 100644 --- a/src/core/forces_inline.hpp +++ b/src/core/forces_inline.hpp @@ -61,6 +61,7 @@ #include "nonbonded_interactions/soft_sphere.hpp" #include "nonbonded_interactions/steppot.hpp" #include "nonbonded_interactions/thole.hpp" +#include "nonbonded_interactions/wca.hpp" #include "npt.hpp" #include "object-in-fluid/affinity.hpp" #include "object-in-fluid/membrane_collision.hpp" @@ -185,6 +186,10 @@ inline void calc_non_bonded_pair_force_parts( #ifdef LENNARD_JONES add_lj_pair_force(p1, p2, ia_params, d, dist, force); #endif +/* WCA */ +#ifdef WCA + add_wca_pair_force(p1, p2, ia_params, d, dist, force); +#endif /* Lennard-Jones generic */ #ifdef LENNARD_JONES_GENERIC add_ljgen_pair_force(p1, p2, ia_params, d, dist, force); diff --git a/src/core/nonbonded_interactions/CMakeLists.txt b/src/core/nonbonded_interactions/CMakeLists.txt index d6eee8ce316..7b0e59a87e5 100644 --- a/src/core/nonbonded_interactions/CMakeLists.txt +++ b/src/core/nonbonded_interactions/CMakeLists.txt @@ -17,6 +17,7 @@ add_library(nonbonded_interactions SHARED soft_sphere.cpp steppot.cpp thole.cpp + wca.cpp ) add_dependencies(nonbonded_interactions EspressoConfig) diff --git a/src/core/nonbonded_interactions/nonbonded_interaction_data.cpp b/src/core/nonbonded_interactions/nonbonded_interaction_data.cpp index 3e7f3c7006e..85847639b52 100644 --- a/src/core/nonbonded_interactions/nonbonded_interaction_data.cpp +++ b/src/core/nonbonded_interactions/nonbonded_interaction_data.cpp @@ -255,6 +255,10 @@ static void recalc_maximal_cutoff_nonbonded() { max_cut_current = (data->LJ_cut + data->LJ_offset); #endif +#ifdef WCA + max_cut_current = std::max(max_cut_current, data->WCA_cut); +#endif + #ifdef DPD max_cut_current = std::max(max_cut_current, std::max(data->dpd_r_cut, data->dpd_tr_cut)); diff --git a/src/core/nonbonded_interactions/nonbonded_interaction_data.hpp b/src/core/nonbonded_interactions/nonbonded_interaction_data.hpp index 84b6fb78a3d..9fcbe65b969 100644 --- a/src/core/nonbonded_interactions/nonbonded_interaction_data.hpp +++ b/src/core/nonbonded_interactions/nonbonded_interaction_data.hpp @@ -120,6 +120,12 @@ struct IA_parameters { #endif +#ifdef WCA + double WCA_eps = 0.0; + double WCA_sig = 0.0; + double WCA_cut = INACTIVE_CUTOFF; +#endif + /** flag that tells whether there is any short-ranged interaction, i.e. one that contributes to the "nonbonded" section of the energy/pressure. Note that even if there is no short-ranged diff --git a/src/core/nonbonded_interactions/wca.cpp b/src/core/nonbonded_interactions/wca.cpp new file mode 100644 index 00000000000..065d705f32a --- /dev/null +++ b/src/core/nonbonded_interactions/wca.cpp @@ -0,0 +1,40 @@ +/* + Copyright (C) 2018 The ESPResSo project + + This file is part of ESPResSo. + + ESPResSo is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ESPResSo is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "config.hpp" + +#ifdef WCA +#include "wca.hpp" + +#include "communication.hpp" + +int wca_set_params(int part_type_a, int part_type_b, double eps, double sig) { + IA_parameters *data = get_ia_param_safe(part_type_a, part_type_b); + + data->WCA_eps = eps; + data->WCA_sig = sig; + data->WCA_cut = sig * std::pow(2., 1. / 6.); + + /* broadcast interaction parameters */ + mpi_bcast_ia_params(part_type_a, part_type_b); + + return ES_OK; +} + +#endif /* ifdef WCA */ diff --git a/src/core/nonbonded_interactions/wca.hpp b/src/core/nonbonded_interactions/wca.hpp new file mode 100644 index 00000000000..9d9a0fed564 --- /dev/null +++ b/src/core/nonbonded_interactions/wca.hpp @@ -0,0 +1,60 @@ +/* + Copyright (C) 2018 The ESPResSo project + + This file is part of ESPResSo. + + ESPResSo is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ESPResSo is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ +#ifndef WCA_HPP +#define WCA_HPP + +#include "config.hpp" + +#ifdef WCA + +#include "nonbonded_interaction_data.hpp" +#include "particle_data.hpp" + +int wca_set_params(int part_type_a, int part_type_b, double eps, double sig); + +/** Calculate WCA force between particle p1 and p2 */ +inline void add_wca_pair_force(const Particle *const p1, + const Particle *const p2, + IA_parameters *ia_params, double const d[3], + double dist, double force[3]) { + if (dist < ia_params->WCA_cut) { + auto const frac2 = Utils::sqr(ia_params->WCA_sig / dist); + auto const frac6 = frac2 * frac2 * frac2; + auto const fac = + 48.0 * ia_params->WCA_eps * frac6 * (frac6 - 0.5) / (dist * dist); + for (int j = 0; j < 3; j++) + force[j] += fac * d[j]; + } +} + +/** calculate WCA energy between particle p1 and p2. */ +inline double wca_pair_energy(const Particle *p1, const Particle *p2, + const IA_parameters *ia_params, const double d[3], + double dist) { + if (dist < ia_params->WCA_cut) { + auto const frac2 = Utils::sqr(ia_params->WCA_sig / dist); + auto const frac6 = frac2 * frac2 * frac2; + return 4.0 * ia_params->WCA_eps * + (Utils::sqr(frac6) - frac6 + .25); + } + return 0.0; +} + +#endif /* ifdef WCA */ +#endif diff --git a/src/features.def b/src/features.def index a78f0520fe6..cc7e0c6ba5b 100644 --- a/src/features.def +++ b/src/features.def @@ -85,6 +85,7 @@ SHANCHEN requires not ELECTROKINETICS and EXPERIMENTAL_FE /* Interaction features */ TABULATED LENNARD_JONES +WCA LJ_WARN_WHEN_CLOSE LENNARD_JONES_GENERIC implies LENNARD_JONES LJCOS diff --git a/src/python/espressomd/interactions.pxd b/src/python/espressomd/interactions.pxd index 5fea1c5db67..7be3bc28474 100644 --- a/src/python/espressomd/interactions.pxd +++ b/src/python/espressomd/interactions.pxd @@ -47,6 +47,10 @@ cdef extern from "nonbonded_interactions/nonbonded_interaction_data.hpp": double LJ_offset double LJ_min + double WCA_eps + double WCA_sig + double WCA_cut + double LJCOS_eps double LJCOS_sig double LJCOS_cut @@ -160,6 +164,10 @@ cdef extern from "nonbonded_interactions/lj.hpp": double eps, double sig, double cut, double shift, double offset, double min) + +cdef extern from "nonbonded_interactions/wca.hpp": + cdef int wca_set_params(int part_type_a, int part_type_b, + double eps, double sig) IF LJCOS: cdef extern from "nonbonded_interactions/ljcos.hpp": cdef int ljcos_set_params(int part_type_a, int part_type_b, diff --git a/src/python/espressomd/interactions.pyx b/src/python/espressomd/interactions.pyx index 075ace50ca0..83ae9eab68e 100644 --- a/src/python/espressomd/interactions.pyx +++ b/src/python/espressomd/interactions.pyx @@ -324,8 +324,87 @@ IF LENNARD_JONES == 1: """ return "epsilon", "sigma", "cutoff", "shift" -# Generic Lennard-Jones +IF WCA == 1: + cdef class WCAInteraction(NonBondedInteraction): + def validate_params(self): + """Check that parameters are valid. + + Raises + ------ + ValueError + If not true. + """ + if self._params["epsilon"] < 0: + raise ValueError("WCA eps has to be >=0") + if self._params["sigma"] < 0: + raise ValueError("WCA sigma has to be >=0") + return True + + def _get_params_from_es_core(self): + cdef IA_parameters * ia_params + ia_params = get_ia_param_safe( + self._part_types[0], + self._part_types[1]) + return { + "epsilon": ia_params.WCA_eps, + "sigma": ia_params.WCA_sig, + "cutoff": ia_params.WCA_cut} + + def is_active(self): + """Check if interaction is active. + + """ + return (self._params["epsilon"] > 0) + + def set_params(self, **kwargs): + """ Set parameters for the WCA interaction. + + Parameters + ---------- + + epsilon : :obj:`float` + The magnitude of the interaction. + sigma : :obj:`float` + Determines the interaction length scale. + + """ + super(WCAInteraction, self).set_params(**kwargs) + + def _set_params_in_es_core(self): + if wca_set_params( + self._part_types[0], self._part_types[1], + self._params["epsilon"], + self._params["sigma"]): + raise Exception("Could not set WCA parameters") + + def default_params(self): + """Python dictionary of default parameters. + + """ + return { + "epsilon": 0., + "sigma": 0.} + + def type_name(self): + """Name of interaction type. + + """ + return "WCA" + + def valid_keys(self): + """All parameters that can be set. + + """ + return "epsilon", "sigma" + + def required_keys(self): + """Parameters that have to be set. + + """ + return "epsilon", "sigma" + +# Generic Lennard-Jones IF LENNARD_JONES_GENERIC == 1: cdef class GenericLennardJonesInteraction(NonBondedInteraction): @@ -1672,6 +1751,8 @@ class NonBondedInteractionHandle(object): # Here, add one line for each nonbonded ia IF LENNARD_JONES: self.lennard_jones = LennardJonesInteraction(_type1, _type2) + IF WCA: + self.wca = WCAInteraction(_type1, _type2) IF MEMBRANE_COLLISION: self.membrane_collision = MembraneCollisionInteraction( _type1, _type2) diff --git a/testsuite/python/interactions_non-bonded.py b/testsuite/python/interactions_non-bonded.py index 7b4b3f50f8e..805d052b458 100644 --- a/testsuite/python/interactions_non-bonded.py +++ b/testsuite/python/interactions_non-bonded.py @@ -47,11 +47,11 @@ def tearDown(self): self.system.part.clear() # Required, since assertAlmostEqual does NOT check significant places - def assertFractionAlmostEqual(self, a, b): + def assertFractionAlmostEqual(self, a, b, **args): if abs(b) < 1E-8: - self.assertAlmostEqual(a, b) + self.assertAlmostEqual(a, b, **args) else: - self.assertAlmostEqual(a / b, 1.) + self.assertAlmostEqual(a / b, 1., **args) def assertItemsFractionAlmostEqual(self, a, b): for i, ai in enumerate(a): @@ -106,6 +106,46 @@ def test_lj_generic(self): self.system.non_bonded_inter[0, 0].generic_lennard_jones.set_params( epsilon=0.) + # Test WCA Potential + @ut.skipIf(not espressomd.has_features("WCA"), + "Features not available, skipping test!") + def test_wca(self): + wca_eps = 2.12 + wca_sig = 1.37 + wca_cutoff = wca_sig * 2.**(1./6.) + + wca_shift = -((wca_sig / wca_cutoff)**12 - ( + wca_sig / wca_cutoff)**6) + + self.system.non_bonded_inter[0,0].wca.set_params(epsilon=wca_eps, + sigma=wca_sig) + + for i in range(231): + self.system.part[1].pos = self.system.part[1].pos + self.step + self.system.integrator.run(recalc_forces=True, steps=0) + + # Calculate energies + E_sim = self.system.analysis.energy()["non_bonded"] + E_ref = tests_common.lj_generic_potential( + r=(i + 1) * self.step_width, eps=wca_eps, sig=wca_sig, + cutoff=wca_cutoff, shift=4. * wca_shift) + + # Calculate forces + f0_sim = self.system.part[0].f + f1_sim = self.system.part[1].f + f1_ref = self.axis * tests_common.lj_generic_force(espressomd, + r=(i + 1) * self.step_width, eps=wca_eps, + sig=wca_sig, cutoff=wca_cutoff) + # Check that energies match, ... + self.assertFractionAlmostEqual(E_sim, E_ref) + # force equals minus the counter-force ... + self.assertTrue((f0_sim == -f1_sim).all()) + # and has correct value. + self.assertItemsFractionAlmostEqual(f1_sim, f1_ref) + + self.system.non_bonded_inter[0, 0].wca.set_params( + epsilon=0.,sigma=1.) + # Test Generic Lennard-Jones Softcore Potential @ut.skipIf(not espressomd.has_features("LJGEN_SOFTCORE"), "Features not available, skipping test!") From 7c99454bd0f5943bf3ee20c9d2bc44650092f34f Mon Sep 17 00:00:00 2001 From: Florian Weik Date: Wed, 3 Oct 2018 15:08:56 +0200 Subject: [PATCH 4/6] Formatting. --- .../nonbonded_interactions/nonbonded_interaction_data.cpp | 2 +- src/core/nonbonded_interactions/wca.hpp | 3 +-- testsuite/python/interactions_non-bonded.py | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/core/nonbonded_interactions/nonbonded_interaction_data.cpp b/src/core/nonbonded_interactions/nonbonded_interaction_data.cpp index 85847639b52..69954b91a13 100644 --- a/src/core/nonbonded_interactions/nonbonded_interaction_data.cpp +++ b/src/core/nonbonded_interactions/nonbonded_interaction_data.cpp @@ -256,7 +256,7 @@ static void recalc_maximal_cutoff_nonbonded() { #endif #ifdef WCA - max_cut_current = std::max(max_cut_current, data->WCA_cut); + max_cut_current = std::max(max_cut_current, data->WCA_cut); #endif #ifdef DPD diff --git a/src/core/nonbonded_interactions/wca.hpp b/src/core/nonbonded_interactions/wca.hpp index 9d9a0fed564..88478e4f858 100644 --- a/src/core/nonbonded_interactions/wca.hpp +++ b/src/core/nonbonded_interactions/wca.hpp @@ -50,8 +50,7 @@ inline double wca_pair_energy(const Particle *p1, const Particle *p2, if (dist < ia_params->WCA_cut) { auto const frac2 = Utils::sqr(ia_params->WCA_sig / dist); auto const frac6 = frac2 * frac2 * frac2; - return 4.0 * ia_params->WCA_eps * - (Utils::sqr(frac6) - frac6 + .25); + return 4.0 * ia_params->WCA_eps * (Utils::sqr(frac6) - frac6 + .25); } return 0.0; } diff --git a/testsuite/python/interactions_non-bonded.py b/testsuite/python/interactions_non-bonded.py index 805d052b458..37a0e0fe8b8 100644 --- a/testsuite/python/interactions_non-bonded.py +++ b/testsuite/python/interactions_non-bonded.py @@ -112,13 +112,13 @@ def test_lj_generic(self): def test_wca(self): wca_eps = 2.12 wca_sig = 1.37 - wca_cutoff = wca_sig * 2.**(1./6.) + wca_cutoff = wca_sig * 2.**(1. / 6.) wca_shift = -((wca_sig / wca_cutoff)**12 - ( wca_sig / wca_cutoff)**6) - self.system.non_bonded_inter[0,0].wca.set_params(epsilon=wca_eps, - sigma=wca_sig) + self.system.non_bonded_inter[0, 0].wca.set_params(epsilon=wca_eps, + sigma=wca_sig) for i in range(231): self.system.part[1].pos = self.system.part[1].pos + self.step @@ -144,7 +144,7 @@ def test_wca(self): self.assertItemsFractionAlmostEqual(f1_sim, f1_ref) self.system.non_bonded_inter[0, 0].wca.set_params( - epsilon=0.,sigma=1.) + epsilon=0., sigma=1.) # Test Generic Lennard-Jones Softcore Potential @ut.skipIf(not espressomd.has_features("LJGEN_SOFTCORE"), From 811436af7d5623937a7f176f273967082680e3a7 Mon Sep 17 00:00:00 2001 From: Florian Weik Date: Wed, 3 Oct 2018 16:16:32 +0200 Subject: [PATCH 5/6] doc: Fixed sphinx --- doc/sphinx/inter_non-bonded.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/sphinx/inter_non-bonded.rst b/doc/sphinx/inter_non-bonded.rst index b03d11abda5..6d0115187ec 100644 --- a/doc/sphinx/inter_non-bonded.rst +++ b/doc/sphinx/inter_non-bonded.rst @@ -219,7 +219,7 @@ on/off during a simulation. .. _Weeks-Chandler-Anderson interaction: Weeks-Chandler-Anderson interaction -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. note:: Feature ``WCA`` required. From 0566b6af930dfdcacc2fd5e4c00bf929a7068253 Mon Sep 17 00:00:00 2001 From: Florian Weik Date: Thu, 4 Oct 2018 10:41:56 +0200 Subject: [PATCH 6/6] doc: Mr. Anderson --- doc/sphinx/inter_non-bonded.rst | 8 ++++---- .../04-lattice_boltzmann/04-lattice_boltzmann_part3.ipynb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/sphinx/inter_non-bonded.rst b/doc/sphinx/inter_non-bonded.rst index 6d0115187ec..166ce021606 100644 --- a/doc/sphinx/inter_non-bonded.rst +++ b/doc/sphinx/inter_non-bonded.rst @@ -216,22 +216,22 @@ interaction, while :math:`\delta` varies how smoothly the potential goes to zero alchemical transformations, where a group of atoms can be slowly turned on/off during a simulation. -.. _Weeks-Chandler-Anderson interaction: +.. _Weeks-Chandler-Andersen interaction: -Weeks-Chandler-Anderson interaction +Weeks-Chandler-Andersen interaction ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. note:: Feature ``WCA`` required. -The interface for the Weeks-Chandler-Anderson interactions is implemented in +The interface for the Weeks-Chandler-Andersen interactions is implemented in :class:`espressomd.interactions.WCAInteraction`. They are configured via the syntax:: system.non_bonded_inter[type1, type2].wca.set_params(**kwargs) -This command defines a Weeks-Chandler-Anderson interaction between particles of the +This command defines a Weeks-Chandler-Andersen interaction between particles of the types ``type1`` and ``type2``. The potential is defined by .. math:: 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 923954593ef..4fdb0438652 100644 --- a/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part3.ipynb +++ b/doc/tutorials/04-lattice_boltzmann/04-lattice_boltzmann_part3.ipynb @@ -18,7 +18,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "One of the typical applications of **ESPResSo** is the simulation of polymer chains with a bead-spring-model. For this we need a repulsive interaction between all beads, for which one usually takes a shifted and truncated Lennard-Jones (so called Weeks-Chandler-Anderson) interaction, and additionally a bonded interaction between adjacent beads to hold the polymer together. You have already learned that the command" + "One of the typical applications of **ESPResSo** is the simulation of polymer chains with a bead-spring-model. For this we need a repulsive interaction between all beads, for which one usually takes a shifted and truncated Lennard-Jones (so called Weeks-Chandler-Andersen) interaction, and additionally a bonded interaction between adjacent beads to hold the polymer together. You have already learned that the command" ] }, {