Geometrically defined basis functions for polyhedral elements with applications to computational electromagnetics