Interaction between phase transformations and dislocations at the nanoscale. Part 1. General phase field approach