On the role of confinement on solidification in pure materials and binary alloys