The theory of deformable porous media and its application to composite materials manufacturing