This article describes in detail the mathematical formulation used in the WAFER-1 code, which is presently used for three-dimensional analysis of LWR fuel pin performance. The code aims at a prediction of the local stress-strain history in the cladding, especially with regard to the ridging phenomenon. To achieve this, a clad model based on shell theory has been developed. This model interacts with a detailed finite difference pellet model which treats radial and transversal cracking in the pellet in a deterministic way, based on certain assumptions with respect to the cracking pattern. Pellet and clad creep are taken into account. The inner core of the pellet, bounded by a specified isotherm, may be treated as a viscous material. Axial force exchange between pellet and clad is also included. The axial loading is distributed on the pellet end face with due regard to any pellet dishing. An arbitrary power history may be used as input to the model.