Application of the spherical metric tensor to grid adaptation and the solution of applied problems