Electrostatic self assembly of nanocomposite polymers in grating structures