[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error of Particle node not found

From: Jean-Noël Grad
Subject: Re: Error of Particle node not found
Date: Thu, 14 Nov 2019 14:38:37 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Thunderbird/60.9.0


Offline discussion with Jonas: deleted particles are indeed kept in the particle list for future recycling; it helps reducing the complexity of the C++ code. You could use a try...except RuntimeError to skip non-existent particles, unfortunately this is far from ideal, as the number of particles is an implementation detail.

In other words, `len(system.part)` and `len(system.part[:].id)` both return N_existing, but to iterate with a try...except you would need the quantity N_existing + N_deleted. Jonas suggested using the h5md output format directly, which should allow you to run queries on the particle population with h5md-related tools.

The documentation on Reaction Ensemble methods is currently undergoing changes ( As soon as this work is done, we'll update it to reflect the fact that particles are not iterable when they undergo a chemical reaction.

Thank you for reporting this issue.


On 11/14/19 1:39 PM, Jean-Noël Grad wrote:

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:

The issue is reproducible in 4.1. @Jonas is this behavior documented? The user guide section on constant pH doesn't mention it:


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!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]