Surface anchoring of nematic liquid crystals