mesh = dol.UnitCube(4, 4, 4) a = 1.0 b = 1.0 d = 1.0 mesh.coordinates()[:, 0] = a * mesh.coordinates()[:, 0] mesh.coordinates()[:, 1] = b * mesh.coordinates()[:, 1] mesh.coordinates()[:, 2] = d * mesh.coordinates()[:, 2] # init the PEC walls boundary condition pec_walls = PECWallsBoundaryCondition() pec_walls.init_with_mesh(mesh) # Use 3rd order basis functions order = 3 # Set up the eigen problem ep = EigenProblem() ep.set_mesh(mesh) ep.set_basis_order(order) ep.set_boundary_conditions(pec_walls) ep.init_problem() # Set up eigen problem solver where sigma is the shift to use in the shift-invert process sigma = 1.1 es = DefaultEigenSolver() es.set_eigenproblem(ep) es.set_sigma(sigma) # Solve the eigenproblem eigs_w, eigs_v = es.solve_problem(10) # Output the results