Transformation optics for cavity array metamaterials.