Jinyuan,
As I said, the positions and types displayed by OVITO in your first message are consistent with your inputs.
Particle 0: [1, 0.333333, 0] == [1, 1/3, 0] + [0, 0, 0]
Particle 1: [1, 0.333333, 0] == [1, 1/3, 0] + [0, 0, 0]
Particle 2: [2, 1.333333, 0] == [1, 1/3, 0] + [1, 1, 0]
Particle 3: [3, 0.333333, 0] == [1, 1/3, 0] + [2, 0, 0]
As I said in my original message, HOOMD translated (by vector addition) the positions of the particles in the local reference frame of the body to the global reference frame of the simulation. If this concept is unfamiliar to you, I suggest you review vector addition in a textbook.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan
> On Aug 24, 2021, at 3:37 AM, Jinyuan Mao <
maojin...@gmail.com> wrote:
>
> Hi Anderson,
>
> As shown in OVITO, the coordination of three type A change to the (1,0.3333,0), (2,1.3333,0), (3,0.3333,0) respectively.However in my script it was (0,0,0), (1,1,0), (2,0,0). I don't know why it changed, cause the coordination of R is exactly the center of these three positions of A.
>
> Then I make another test as below, in this test, I set the position R as (0,0,0), and set the three type A as (-1,-1,0), (1,-1,0), (0,2,0) respectively. Finally, I got an correct position matched with that in my script as shown in OVITO. So I am confused if I must set the position of center particle as (0,0,0)?
>
> uc = hoomd.lattice.unitcell(N=1,
> a1 = [30, 0,0],
> a2 = [0,30, 0],
> a3 = [0,0,30],
> dimensions=3,
> position =[[0, 0, 0]],
> type_name = ['R'],
> mass = [1.0],
> moment_inertia = [[1,1,1]],
> orientation = [[1,0,0,0]]);
> system = hoomd.init.create_lattice(unitcell=uc, n=[1,1,1]);
> system.particles.types.add('A');
> rigid = hoomd.md.constrain.rigid();
> rigid.set_param('R',
> types=['A']*3,
> positions=[(-1,-1,0),(1,-1,0),(0,2,0)]);
> rigid.create_bodies()
>
> To view this discussion on the web visit
https://groups.google.com/d/msgid/hoomd-users/50df42c7-0315-48bf-bd84-8b40142ed574n%40googlegroups.com.
> <Screenshot from 2021-08-24 15-22-12.png>