Temperature structure of the intracluster medium from smoothed-particle hydrodynamics and adaptive-mesh refinement simulations