Production of building materials, ceramics and glass