You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In undocumented behavior, md.constrain.Rigid uses charges and diameters only in create_bodies. This is unlike constituent_types, which is used checked the body validation process and positions and orientation which are applied every time step.
Also, changing only the charges or diameters is not counted as a changed body (e.g. making a change to charges only does not trigger a new validation):
I expected an error that the charge and/or diameter given in rigid.body['A'] fails to match that in the simulation state. Like this error given when constituent_types doesn't match:
RuntimeError: Error validating rigid bodies: Constituent particle types must be consistent with the rigid body definition. Rigid body definition is in order of particle tag.
ALTERNATIVELY, I expect the API to not accept charges and diameters as body type parameters (see discussion below).
Configuration
Versions:
Python version: all
HOOMD-blue version: 3.2.0
Developer
Before implementing a fix, we should discuss what the correct API should be. Many users have expressed extreme confusion over the charge and diameter fields. There is less confusion over constituent_types, however it has the same behavior (used for create_bodies and validation only).
I see two rational options:
Validate charges and diameters the same way as constituent_types. Document how these are used.
Remove charges, diameters and consituent_types from the bodies type parameter and make them parameters of create_bodies (optional in the case of charges and diameters). Document how these are used.
The 2nd option will involve a deprecation or a breaking change. However, it cleans up the API as it longer requires that the user provide the same information in two places (simulation state and body definition). Users will still be annoyed that they need to define the local positions and orientations, but that is not avoidable as the data available in the simulation state is both not sufficient and overdetermined.
The text was updated successfully, but these errors were encountered:
I would suggest the 2nd as charges and diameters at least make most sense just in the simulation. I am not sure for constituent_types, but it does provide the most flexibility that way (e.g. types could change mid simulation without error).
Yes, I agree that we should remove constituent_types from the body type parameter as well. It removes all redundant information. We can discuss this further in the meeting tomorrow.
Note: if we choose to make this a breaking change, we can remove diameters altogether from HOOMD in v4.
As discussed in glotzerlab/hoomd-examples#73, we also need to modify HOOMD to enforce that the particle type ids match those in the body definition, as they are used when determining the per-type ghost width.
Description
In undocumented behavior,
md.constrain.Rigid
usescharges
anddiameters
only increate_bodies
. This is unlikeconstituent_types
, which is used checked the body validation process andpositions
andorientation
which are applied every time step.Also, changing only the
charges
ordiameters
is not counted as a changed body (e.g. making a change tocharges
only does not trigger a new validation):hoomd-blue/hoomd/md/ForceComposite.cc
Lines 167 to 171 in 319c199
Script
Output
no output
Expected output
I expected an error that the charge and/or diameter given in
rigid.body['A']
fails to match that in the simulation state. Like this error given whenconstituent_types
doesn't match:ALTERNATIVELY, I expect the API to not accept
charges
anddiameters
as body type parameters (see discussion below).Configuration
Versions:
Developer
Before implementing a fix, we should discuss what the correct API should be. Many users have expressed extreme confusion over the charge and diameter fields. There is less confusion over
constituent_types
, however it has the same behavior (used forcreate_bodies
and validation only).I see two rational options:
charges
anddiameters
the same way asconstituent_types
. Document how these are used.charges
,diameters
andconsituent_types
from thebodies
type parameter and make them parameters ofcreate_bodies
(optional in the case ofcharges
anddiameters
). Document how these are used.The 2nd option will involve a deprecation or a breaking change. However, it cleans up the API as it longer requires that the user provide the same information in two places (simulation state and body definition). Users will still be annoyed that they need to define the local positions and orientations, but that is not avoidable as the data available in the simulation state is both not sufficient and overdetermined.
The text was updated successfully, but these errors were encountered: