Finite-element solutions for a direct problem in continuous casting and for its inverse