Skip to content

Setting default shape for ALJ prevents shape from being settable for all types #2190

@josephburkhart

Description

@josephburkhart

Description

Setting a default shape for an instance of hoomd.md.pair.aniso.ALJ causes that instance to ignore all type shapes set thereafter.

Script

import hoomd

sim = hoomd.util.make_example_simulation()

nl = hoomd.md.nlist.Cell(buffer=0.4)
alj = hoomd.md.pair.aniso.ALJ(nl, default_r_cut=2.5)

cube_verts = [(-0.5, -0.5, -0.5),
              (-0.5, -0.5, 0.5),
              (-0.5, 0.5, -0.5),
              (-0.5, 0.5, 0.5),
              (0.5, -0.5, -0.5),
              (0.5, -0.5, 0.5),
              (0.5, 0.5, -0.5),
              (0.5, 0.5, 0.5)]

cube_faces = [[0, 2, 6],
              [6, 4, 0],
              [5, 0, 4],
              [5,1,0],
              [5,4,6],
              [5,6,7],
              [3,2,0],
              [3,0,1],
              [3,6,2],
              [3,7,6],
              [3,1,5],
              [3,5,7]]

alj.params[("A", "A")] = dict(epsilon=2.0,
                              sigma_i=1.0,
                              sigma_j=1.0,
                              alpha=1,
                              )

alj.shape.default = dict(vertices=[], faces=[])

alj.shape["A"] = dict(vertices=cube_verts,
                      faces=cube_faces)

print(alj.shape["A"])

Input files

No response

Output

_HOOMDDict{'vertices': [], 'faces': [], 'rounding_radii': (0.0, 0.0, 0.0)}

Expected output

_HOOMDDict{'vertices': [(-0.5, -0.5, -0.5), (-0.5, -0.5, 0.5), (-0.5, 0.5, -0.5), (-0.5, 0.5, 0.5), (0.5, -0.5, -0.5), (0.5, -0.5, 0.5), (0.5, 0.5, -0.5), (0.5, 0.5, 0.5)], 'faces': [[0, 2, 6], [6, 4, 0], [5, 0, 4], [5, 1, 0], [5, 4, 6], [5, 6, 7], [3, 2, 0], [3, 0, 1], [3, 6, 2], [3, 7, 6], [3, 1, 5], [3, 5, 7]], 'rounding_radii': (0.0, 0.0, 0.0)}

Platform

Linux, CPU

Installation method

Conda-forge package

HOOMD-blue version

5.4.0

Python version

3.14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions