Numerical solution of a direct and inverse stationary problem of heat transfer with a modified method of elementary balances