Device and method for the production of cellular materials