Anisotropic properties with different materials

Edit:
I think this post advising to use the curl instead of the gradient might be the solution: Anisotropic material definition and results issue - #2 by kamensky
However even with curl I still get NaNs in my solution…