Untangling all-hex meshes via adaptive boundary optimization