Liquid crystals in complex geometries formed by polymer and porous networks