FEM Synthesis of Electromagnetic Fields