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
The ELC actor is set up by recycling the old struct and assigning new values to individual members, which is a potential source of bugs. For example, when the setter is called with const_pot=false, the core parameter elc_params.const_pot is not updated:
True
Traceback (most recent call last):
File "mwe.py", line 19, in <module>
system.actors.add(elc) # should fail: metallic boundaries
File "actors.pyx", line 215, in espressomd.actors.Actors.add
File "actors.pyx", line 70, in espressomd.actors.Actor._activate
File "electrostatics.pyx", line 533, in espressomd.electrostatics.ELC._activate_method
File "electrostatics.pyx", line 516, in espressomd.electrostatics.ELC._set_params_in_es_core
RuntimeError: ELC with two parallel metallic boundaries requires the const_pot option
Older versions of ESPResSo are not affected by this bug, because before 4.2 the ELC setter could only be called once.
In addition, when resizing the box in the z-direction, the gap parameter h is not updated, which leads to incorrect ELC energies being calculated and particles entering the gap region without triggering an exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "analyze.pyx", line 474, in espressomd.analyze.Analysis.energy
File "utils.pyx", line 236, in espressomd.utils.handle_errors
File "utils.pyx", line 255, in espressomd.utils.handle_errors
Exception: calc_long_range_energies failed: ERROR: Particle 1 entered ELC gap region by 2
E = -2.345896134603552
The text was updated successfully, but these errors were encountered:
Fixes#4230
Description of changes:
- create a new ELC struct every time a new ELC actor is set up (#4220)
- use standard exception mechanism in the ELC setter (#4219)
- ELC data members are updated upon change to the system
The ELC actor is set up by recycling the old struct and assigning new values to individual members, which is a potential source of bugs. For example, when the setter is called with
const_pot=false
, the core parameterelc_params.const_pot
is not updated:espresso/src/core/electrostatics_magnetostatics/elc.cpp
Lines 1111 to 1114 in 415f8d4
If the user deleted an older ELC actor that was set with
const_pot=true
, the new actor has constant potential enabled. MWE:Output:
Expected:
Older versions of ESPResSo are not affected by this bug, because before 4.2 the ELC setter could only be called once.
In addition, when resizing the box in the z-direction, the gap parameter
h
is not updated, which leads to incorrect ELC energies being calculated and particles entering the gap region without triggering an exception:Output:
Expected:
The text was updated successfully, but these errors were encountered: