Density Functional Theory Study of Extended Defects in Functional Materials