Dynamic single crystal to polycrystal transformation of a 1D-coordination polymer and its second harmonic generation