Build a binary system with specific structure

Hi everyone,

I’m going to build a TiC system which has a NaCl structure (as known FCC structure). Ti has hcp and C has dia sturcture, so I wonder how I can put them together to form a NaCl stucture? Here is what I came up, does it make any sense?

units metal
dimension 3
boundary p p p
atom_style atomic

# create geometry
*lattice fcc 3.55 *
region box block -10 10 -10 10 5 10
create_box 2 box
mass 1 47.880
mass 2 12.011

# create Ti atoms
lattice hcp 2.92
create_atoms 1 region box

# creat C atoms
lattice dia 3.55
create_atoms 2 region box

group 2 region box

Any hint and suggetsion are greatly appriciate!

Last time I looked, NaCl would have a simple cubic crystal structure with the lattice sites alternately occupied by Na and Cl and thus each forming an FCC sub-lattice that is shifted by half a cell width in x, y, and z.

Well, does it produce the geometry you want?

Why not use “lattice custom”?