A Multigrid Method on Non-Graded Adaptive Octree and Quadtree Cartesian Grids