Shaping of foam-like materials through the use of a sonotrode