A three-dimensional boundary element approach to confined free-surface flow as applied to die casting