Modelling a ceramic foam using locally adaptable morphology