How to define spatially varying materials

You can access the original cell index as done here: Wrong order of dofs after creating mesh from lists of points and cells - #5 by dokken