Hello,
I tried to write a code to create a stacking fault by displacement but after I visualize it doesn’t get created, could you help me with that? Thank you so much!
%%writefile NiCrFe.in
# LAMMPS script for creating a NiFeCr alloy (60:20:20) in an FCC structure with a stacking fault
units metal
dimension 3
boundary p p p
atom_style atomic
# Create FCC lattice and define the simulation box
lattice fcc 3.52
region box block 0 10 0 10 0 10
create_box 3 box
# Create atoms in the simulation box
create_atoms 1 box
# Define masses for the elements
mass 1 58.6934 # Ni
mass 2 55.845 # Fe
mass 3 51.9961 # Cr
# Assign atom types based on the desired composition
set type 1 type/fraction 2 0.20 12345
set type 1 type/fraction 3 0.25 12346
# Define the pair style and coefficients
pair_style eam/alloy
pair_coeff * * FeCrNi_d.eam.alloy Ni Fe Cr
# Define neighbor settings
neighbor 2.0 bin
neigh_modify delay 10 check yes
# Define the initial velocity
velocity all create 300.0 12345 mom yes rot yes dist gaussian
# Set up thermo settings
thermo 100
thermo_style custom step temp pe etotal press
# Dump atomic configuration for OVITO visualization
dump 1 all custom 100 NiFeCr_60_20_20.dump id type x y z
# Run initial minimization
minimize 1.0e-4 1.0e-6 100 1000
# Introduce a stacking fault by shifting part of the lattice
region fault block 0 10 0 10 5 10
group fault_region region fault
displace_atoms fault_region move 0.5 0.0 0.0
# Run minimization again after displacement
minimize 1.0e-4 1.0e-6 100 1000
# Set up MD run
timestep 0.002
fix 1 all nvt temp 300.0 300.0 0.1
# Run the simulation for 10000 timesteps
run 1000