Formation of Spatial Structures in Bistable Optical Elements Containing Nematic Liquid Crystals