Analysis of rarefied gas flow through an arbitrary cross section by the finite element method