A class of spatially inhomogeneous Dirichlet spaces on the p-adic number field