Pinning and critical currents of heterogeneous superconductors in different structural states