Phase field modeling of defects and deformation