We describe a C++ library for electromagnetics based on the Finite-Difference Time-Domain method for transient analysis, and the Finite Element Method for modal analysis. Both methods share the same core and also both methods are optimized for CPU and GPU computing. The FEM method is applied for solving Laplace's equation and analyzes the relation between surface curvature and electrostatic potential of a long cylindric conductor. The FDTD method is applied for analyzing Thin Film Filters in optical wavelengths. Furthermore, the performance of both CPU and GPU versions are analyzed as a function of the grid size simulation. This approach allows to analyze a wide range of electromagnetic situations taking advantage of the benefits of each numerical method and also of the modern graphics processing units.