“…For an arbitrary resonator configuration involving apertures and mirrors (with or without holes), the code calculates the dominant mode by iteratively simulating round-trip propagations, starting from a random distribution. When first written, the code neglected the FEL interaction [Xie and Kim, 1991a]; we refer to this as the empty-cavity simulation. Each round-trip propagation in this case consists of a sequence of FresnelKirchhoff integral transforms.…”