# Introduction¶

This notebook demonstrates how you can create symmetric and asymmetric grain boundaries.

# Symmetric GB¶

Let's take Fe Σ5[001]/(120) tilt grain boundary as an example. The initial structure is a BCC lattice structure

In [1]:
from aimsgb import GrainBoundary, Grain

s = Grain.from_file("POSCAR_Fe")
gb = GrainBoundary([0, 0, 1], 5, [1, 2, 0], s)
structure = gb.build_gb()


If you need a bigger supercell for each grain, say 2 unit cells:

In [3]:
gb = GrainBoundary([0, 0, 1], 5, [1, 2, 0], s, uc_a=2, uc_b=2)
structure = gb.build_gb()


If you need a Fe Σ5[001]/(001) twist grain boundary

In [2]:
gb = GrainBoundary([0, 0, 1], 5, [0, 0, 1], s)
structure = gb.build_gb()


# Asymmetric GB¶

Let's say we want to have one of the grain shifted for 0.2 Å along a-axis

In [2]:
from aimsgb import GrainBoundary, Grain

s = Grain.from_file("POSCAR_Fe")
gb = GrainBoundary([0, 0, 1], 5, [1, 2, 0], s)
gb.grain_a.translate_sites(range(len(gb.grain_a)), [0.2, 0, 0])
structure = gb.build_gb()