Skip to content

Fix ELCIC nonneutral for CPU, disable for GPU - #5409

Open
reinaual wants to merge 2 commits into
espressomd:pythonfrom
reinaual:fix_elc
Open

Fix ELCIC nonneutral for CPU, disable for GPU#5409
reinaual wants to merge 2 commits into
espressomd:pythonfrom
reinaual:fix_elc

Conversation

@reinaual

@reinaual reinaual commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Hopefully fixes #3001, disables combination described in #5408

This now finally re-enables ELCIC for non-neutral systems. It turns out, that also the not yet disabled metallic case was also affected by #3001.

fig1_impact
  • For neutral systems, the dipole correction is translational invariant. However, for non-neutral systems it's not. So one part was to measure the dipole moment with respect to the symmetry-plane of the system. This caused a constant force towards one of the plates (depending on a sign), which is now corrected.
  • The force was not the gradient of the energy. Due to a mistake in the sign of the energy and a mess between lz with and without gap for the corrections, we had a jump in our energy.
  • The background_energy-correction counted the energy correction twice.
  • The analytic ImageSum used box_length instead of box_h.
  • I've enabled non-neutral with non-metallic boundaries as well, as I don't see why this was forbidden. To the best of my knowledge it works exactly the same as the metallic case.
  • Fixed an interface issue, where const_pot was silently ignored by the code.
  • Disabled P3M-GPU with dielectric ELC, due to ELCIC forces wrong with P3M-GPU #5408

@reinaual reinaual added the BugFix label Aug 4, 2026
@reinaual
reinaual force-pushed the fix_elc branch 2 times, most recently from 4193e6f to c67f5ee Compare August 4, 2026 14:52
Several corrections used the wrong z-box dimension.
This hopefully found all, by checking continuity and
explicit derivatives of energies.
…tric ELC with GPU

The constant-potential mode models the two dielectric interfaces as
electrodes held at a fixed potential difference. Without a dielectric
contrast there are no electrodes, and the flag was silently ignored.

The P3M-GPU is ignoring charges assigned with charge_assign, as used
in ELC. It's using it's own charge-assignment, based on the particle
buffer on the GPU. Disabling for now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ELC energy wrong for non-neutral systems

1 participant