Hi,
I'm not too familiar with the constant pH method, maybe Jonas can help
here. From what I understand, the constant pH method will create and
delete particles, yet the list of particle ids doesn't shrink upon
particle deletion (maybe due to particle recycling?).
The line `system.part[k].pos` will fail because the particle was
deleted. However `system.part[:].pos[k]` will work just fine, because
the ParticleSlice has a bitmask to skip deleted particles; when printing
debug messages in the core, I get a jump around values of k that refer
to deleted particles:
...
get_particle_node(237)
get_particle_node(238)
get_particle_node(240)
get_particle_node(241)
...
The issue is reproducible in 4.1. @Jonas is this behavior documented?
The user guide section on constant pH doesn't mention it:
http://espressomd.org/html/doc/advanced_methods.html#constant-ph-simulation-using-the-reaction-ensemble
Best,
JN
On 11/7/19 8:49 AM, Jiaxing Yuan wrote:
Dear all,
I am simulating a system of electrolytes where charge regulation
occurs so the total particle number is changing during the simulation.
However, in the production run process of my script, an error of
"Particle node not found" is observed. I confirm if I remove the
lines below, the script works well:
for k in range(number_of_particles):
print(system.part[k].type, file=f_config)
print("position", file=f_config)
for k in range(number_of_particles):
print(system.part[k].pos, file=f_config)
So I am confused about why these lines lead to an error. What is the
correct way to output the configuration so that one can analyze the
configuration? My script is attached below, thank you!
Best,
Jiaxing