plumed2 icon indicating copy to clipboard operation
plumed2 copied to clipboard

METATOMIC: SELECTED_ATOMS keyword does not work as intended

Open goharalisiddiqui opened this issue 2 months ago • 3 comments

In the documentation, it says that the SELECTED_ATOMS keyword can be used as SELECTED_ATOMS=11-20 just like the atom selector but actually it is parsed as a vector and thus must can only be written in expanded form e.g. SELECTED_ATOMS=11,12,13,14,15,16,17,18,19,20

goharalisiddiqui avatar Oct 21 '25 14:10 goharalisiddiqui

metatomic.patch

If I parse it as an atomic list, it compiles and I can use SELECTED_ATOMS=11-20, but I am not sure if it will break anything else. The attached patch is what applied to metatomic.cpp (release v2.10.0)

goharalisiddiqui avatar Oct 21 '25 14:10 goharalisiddiqui

Hi @goharalisiddiqui, I think that it is best to tag @Luthaf for problems about the metatomic module

I would add a small point: you do not need to test if an unsigned in less than 0, and you can use .serial() instead of .index()+1 in the error message

Iximiel avatar Nov 17 '25 09:11 Iximiel

Thanks a lot for the patch @goharalisiddiqui, I'll integrate it ASAP. I did not knew the difference between parsing atom lists and parsing vectors.

Luthaf avatar Nov 17 '25 10:11 Luthaf