You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When inserting particles of type 0 with the following syntax:
system.part.add(pos=[1, 2, 3])
the particle is created with a default-constructed value for the type, in this case 0. Since the set_particle_type() callback is not called, the particle id is not added to the global type map used by reaction methods, and therefore won't be involved in any reaction where one of the reactants has type 0. This affects all ESPResSo versions since 4.0.0.
diff --git a/src/python/espressomd/particle_data.pyx b/src/python/espressomd/particle_data.pyx
index 3dc80634b..964143eee 100644
--- a/src/python/espressomd/particle_data.pyx+++ b/src/python/espressomd/particle_data.pyx@@ -1814,4 +1814,7 @@ Set quat and scalar dipole moment (dipm) instead.")
pid = p_dict.pop("id")
+ if "type" not in p_dict:+ p_dict["type"] = 0+
if p_dict != {}:
self.by_id(pid).update(p_dict)
Possible patch for 4.1.4:
diff --git a/src/python/espressomd/particle_data.pyx b/src/python/espressomd/particle_data.pyx
index 4e7799a29..c93b752fe 100644
--- a/src/python/espressomd/particle_data.pyx+++ b/src/python/espressomd/particle_data.pyx@@ -1912,4 +1912,7 @@ Set quat and scalar dipole moment (dipm) instead.")
del P["id"]
+ if "type" not in P:+ P["type"] = 0+
if P != {}:
self[id].update(P)
The text was updated successfully, but these errors were encountered:
Description of changes:
- track particles with default-constructed type 0 (fixes#4588)
- restore the original particle velocity when a Monte Carlo displacement move is rejected (fixes#4587)
Description of changes:
- track particles with default-constructed type 0 (fixesespressomd#4588)
- restore the original particle velocity when a Monte Carlo displacement move is rejected (fixesespressomd#4587)
When inserting particles of type 0 with the following syntax:
the particle is created with a default-constructed value for the type, in this case 0. Since the
set_particle_type()
callback is not called, the particle id is not added to the global type map used by reaction methods, and therefore won't be involved in any reaction where one of the reactants has type 0. This affects all ESPResSo versions since 4.0.0.MWE for 4.2.0 and 4.3-dev:
MWE for 4.1.4:
Output:
Expected output:
Possible patch for 4.3-dev:
Possible patch for 4.2.0:
Possible patch for 4.1.4:
The text was updated successfully, but these errors were encountered: