Selection of Physical and Geometrical Properties for the Confinement of Vibrations in Nonhomogeneous Beams