Compatibility in microstructural topology optimization