Scalable algorithms for physics-informed neural and graph networks