A General Time-Domain Finite-Element Method for Frequency-Domain Solutions