Construction and application of algebraic dual polynomial representations for finite element methods on quadrilateral and hexahedral meshes