  A vectorial Modica--Mortola functional is considered and the convergence to a
sharp interface model is studied. The novelty of the paper is that the wells of
the potential are not constant, but depend on the spatial position in the
domain $\Omega$. The mass constrained minimization problem and the case of
Dirichlet boundary conditions are also treated. The proofs rely on the precise
understanding of minimizing geodesics for the degenerate metric induced by the
potential.
