The penalty function method in mechanics - A review of recent advances