Topological pinning and flux flow in ceramic superconductors