According to the recent studies on interfaces in crystals, it is evident that most grain boundaries and phase boundaries have two dimensional periodic structures. Starting from this fact, using the representation of Fourier series expansion, in the case of given interface structure, i.e., in mathematical sense, formerly given the boundary condition, the elastic fields near the phase boundary between two anisotropic phases are found. As an example, we compute numerically the field of a twist grain boundary in Ni. The method and equations presented in this paper are generally applicable for studying various types of grain boundaries and phase boundaries, providing an effective and concise method for treating this kind of problem.