## Preprocessing and Postprocessing Codes

### PreProcessor: Crystal Structures Generator

This subsection includes atomic positions of various crystal systems used as input for the codes. For more details on a particular structure and various other crystallographic structures, please check here.

#### Basic Crystal Structure Generator for Body Centered Cubic System

The sample element is taken as Tungsten (W)

Figure 1. Basic body centered cubic (bcc) crystal structure.

Primitive Vectors:
A1 = - ½ a X + ½ a Y + ½ a Z
A2 = + ½ a X - ½ a Y + ½ a Z
A3 = + ½ a X + ½ a Y - ½ a Z

Basis Vector:
B1 = 0 (W) (2a)

However in orthogonal unitcell:
A1 = a X
A2 = a Y
A3 = a Z

And the Basis vectors:
B1 = 0.0 0.0 0.0
B2 = 0.5 0.5 0.5

#### Basic Crystal Structure Generator for Face Centered Cubic System

The sample element is taken as Tungsten (W)

Figure 2. Basic face centered cubic (fcc) crystal structure.

Primitive Vectors:
A1 = ½ a Y + ½ a Z
A2 = ½ a X + ½ a Z
A3 = ½ a X + ½ a Y

Basis Vector:
B1 = 0 (Al) (4a)

However in orthogonal unitcell:
A1 = a X
A2 = a Y
A3 = a Z

And the Basis vectors:
B1 = 0.0 0.0 0.0
B2 = 0.5 0.5 0.0
B2 = 0.0 0.5 0.5
B2 = 0.5 0.0 0.5

### HCP Structure

The sample element is taken as Magnesium (Mg)

Figure 3. Basic hexagonal closed packed (hcp) crystal structure.

Primitive Vectors:
A1 = ½ a X - ½ 31/2 a Y
A2 = ½ a X + ½ 31/2 a Y
A3 = c Z

Basis Vector:
B1 = 1/3 A1 + 2/3 A2 + ¼ A3 (Mg) (2c)
B2 = 2/3 A1 + 1/3 A2 + ¾ A3 (Mg) (2c)

However in orthogonal unitcell:
A1 = a X
A2 = b Y
A3 = c Z
where b = Sqrt(3)a

And the Basis vectors:
B1 = 1/4 a 1/3 b 1/4 c
B2 = 3/4 a 5/6 b 1/4 c
B2 = 1/4 a 0 b 3/4 c
B2 = 3/4 a 1/2 b 3/4 c

A very basic sample program csg.py to generate the bcc, fcc and hcp crystal structure with orthogonal basis are given .