Factor out logical element dimension checking into a separate function
so it can be used in both the ASCII and binary writers.
Use elem_dimension instead of Mesh dimension in the binary Tecplot writer.