Stress analysis in solidification processes: Application to continuous casting