Development of a vector analysis code for the simulation of electromagnetic fields in the quasi-optical system of gyrotrons