Replaced "2" by Grid::dimension everywhere I found it.

This is a preparation for 3D.
Fixed deprecation warning
Use faceCodim enum instead of "1"
Added sanity check