An efficient numerical technique has been used to compute the deformation of pores of arbitrary shape embedded in a homogeneous elastic solid under the influence of applied stresses. The scheme is based on the boundary-element method, where single linear elements are used to generate solutions that satisfy prescribed boundary conditions. These solutions can be employed to describe the behavior of elastic moduli and other petrophysical properties in porous rocks. The numerical algorithm allows computation of the stress field induced by the pores in the solid. In this way, the effect of the interactions between pores caused by stress concentrations can be studied from a quantitative point of view. To test the algorithm, some interesting results are compared with existing models, for special cases available in the literature. Also, a model for the compressibility and porosity of sedimentary rocks, as a function of applied hydrostatic stress, was generated by mixing some realistic pore geometries generated with the numerical algorithm. Results were in good agreement with data obtained from selected samples of sandstones.