We describe a model for the study of the interaction of short x-ray free-electron laser (XFEL) pulses with large finite samples. Hydrodynamics is solved in one-dimensional planar geometry with consideration of the electron-ion energy exchange and of the possible elastoplastic behavior. From a time-dependent calculation of the complex refractive index and of the underlying atomic physics, XFEL energy deposition is modeled through a calculation of the radiation field in the material. In the case of hard x-ray irradiation, energetic electrons induced by the XFEL absorption can propagate and deposit their energy outside the interaction region. Simulations of the interaction of hard x-ray ultrashort pulses with solid materials Ru and Si at different grazing incidence angles are presented and discussed. The results obtained demonstrate the potential of this approach to predict damage dynamics for materials of interest for x-ray optics.