Algorithm Developement For Adaptive Grid Generation Using Galerkin Finite Element Method