Current and field pattern in rectangular and inhomogeneous superconductors.