A New 3-D Electromagnetic Solver for the Design of Arbitrarily Shaped Accelerating Cavities