Discretization of differential geometry for computational gauge theory