Based on an impedance relation, a new computational model is developed for the analysis of tunnels under gravitational loading. The shape of tunnel is arbitrary. The impedance matrix, representing the soil resistance, is evaluated through integration of the equations of elasticity by generalized finite difference method (GFDM). The rigidity matrix of tunnel ring is constructed by using two types of elements: plate and shell elements. The equations of these elements are evaluated through integration of the equations of higher order plate and shell theories again by GFDM. These element equations accommodate not only axial and bending deformations, but, also shear deformations in the ring. In the study, the rotational joint deformation is simulated through the use of rotational spring model and the slippage is considered by modifying the impedance matrix so that the tangential soil resistance force between the ring and soil medium vanishes. Some numerical results are presented, in nondimensional forms, for circular and square tunnels where the following three cases are considered for circular tunnels: a) the soil medium is infinite, the change in σv (vertical (in situ) compressional stress) in the vicinity of tunnel is disregarded b) the soil medium is infinite, the change in σv is taken into account c) the soil medium is halfspace (HS). In connection with the case of (a), a comparison is presented for the ring flexibility curves of radial displacement and section forces of circular ring with those reported in literature. In view of the interpretations of the results and comparisons, we think, the proposed model may be used reliably in the analysis of tunnels.