Viscosity of dilute suspensions of rodlike particles: A numerical simulation method