atom_style: "molecular"

Dear Axel,

yes I know that this is not possible of course.

I think i’ve misinterpreted the error message returned by the set mass command then… it told me that I cant set the attribute for that atom style. I’ll check and come back if necessary.

Thank you very much.
Best,
S.

Dear Axel,

yes I know that this is not possible of course.

I think i've misinterpreted the error message returned by the set mass
command then... it told me that I cant set the attribute for that atom
style. I'll check and come back if necessary.

​for cases like this, it is almost always best to construct a minimal demo
input to showcase the problem. as you mentioned, the cause is often a
misinterpretation or an ambiguity and that is easiest resolved with a
specific input rather than through second hand descriptions.

axel.​

Dear Axel,

again you're right.

Here is my snippet and I apologize for not
bringing this up until now:

region 1 block 0 10 0 10 0 10
atom_style charge
create_box 10 1
create_atoms 1 random 1000 38790 1
set type 1 charge 2
set type 1 mass 40.0784

The charge can be set,
however the mass cannot be set:

Setting atom values ...
ERROR: Cannot set this attribute for this atom style (../set.cpp:153)

Thanks in advance.

Best,
Stephan

I think you need to use the "mass 1 " syntax. I think you cannot use the “set type mass”-synax because your atom style does not have a per-atom mass but rather a per-type mass,

It actually says so in the docs for “set”, although I do admit it is a bit of a long read:
“Keyword mass sets the mass of all selected particles. The particles must have a per-atom mass attribute, as defined by the atom_style command. See the “mass” command for how to set mass values on a per-type basis.”

Okay,

I replaced the set type 1 mass 40.0784 by
mass 1 40.0784, however then I get this error:
ERROR: All masses are not set

However using mass * 40.0784 seems to works,
to me it seems I did not assign a type to
the atoms i create by the create_atoms command,
right?

Best,
Stephan

You are mistaken. The command “create_atoms 1 random 1000 38790 1” creates atoms of type 1. The wording of this error I also find a bit unclear, what it really should say in my opinion is “not all masses are set”.
You probably have other atom types declared that do not have a mass set. With the command

mass * you assign ALL atom types the mass of , which might not be what you want.

Hey,
this is true,

I recognized this right now!
It should probably say something like: "Not all masses are set for some
used atom type." Right?

Thanks for your help!

Best,
Stephan

We can quibble over whether the error should say

All masses are not set, or

Not all masses are set.

But the hope is that once you see the error,

you figure out something is wrong with the way you

are setting masses, and how your script didn’t

set enough of them, whether you have per-type

masses or per-atom masses.

Steve