Physics-consistent deep learning for structural topology optimization