updated output-foo, energy density, and group velocity functions to support mu and B fields and correctly compute H, E, and D