Issue with set/fix property/atom

Hi all and Merry Christmas,

The attached input script leads to an illegal set command, even though the offending lines are copy-pasted from the fix property/atom page. Are the docs outdated, is it a bug or am I doing something wrong?

Cheers,

Stefan

set_error.in (218 Bytes)

Hi all and Merry Christmas,

The attached input script leads to an illegal set command, even though the
offending lines are copy-pasted from the fix property/atom page.

​the fix property/atom docs are incorrect. when looking up the equivalent
operation in the documentation of the set command docs, it should become
evident, that the set command has to be:

​set atom * mol v_cluster

axel.

Thanks for the fast reply! Your proposed change indeed works. :slight_smile:

I did notice that, unless I add a run 0 before the set command, it leads to a segfault. I am guessing this is because the code in set is not yet aware that the molecule vector should be the one defined through set property/atom, because it attempts to dereference atom->molecule which is NULL at this point if the run has not been issued. See attached script. After the run 0 and the commands as normal, the mol property does get added and dumped properly.

I am having similar issues with custom-defined properties (“d_…”), in that they don’t get dumped properly unless there is a run command in between the fix and the set. I didn’t find any mention of this in the docs, and it seems a bit unintuitive. Maybe we should add a warning to the docs?

set_segfault.in (439 Bytes)

I just noticed I was not the only one that ran into this issue (https://sourceforge.net/p/lammps/mailman/message/36088805/).

I guess in hindsight it makes sense that they ought to be defined before the box is created, but it would be nice to add a note that explains this to the fix property/atom docs. I can add this tomorrow (I’m on Dutch time and I have a bad cold so I’m off to sleep now).

Thanks again Axel!