We develop a PyTorch-based Graph Network Simulator (GNS) that learns physics and predicts the flow behavior of particulate and fluid systems. GNS discretizes the domain with nodes representing a collection of material points and the links connecting the nodes representing the local interaction between particles or clusters of particles. The GNS learns the interaction laws through message passing on the graph. GNS has three components: (a) Encoder, which embeds particle information to a latent graph, the edges are learned functions; (b) Processor, which allows data propagation and computes the nodal interactions across steps; and (c) Decoder, which extracts the relevant dynamics (e.g., particle acceleration) from the graph. We introduce physics-inspired simple inductive biases, such as an inertial frame that allows learning algorithms to prioritize one solution (constant gravitational acceleration) over another, reducing learning time. The GNS implementation uses semi-implicit Euler integration to update the next state based on the predicted accelerations. GNS trained on trajectory data is generalizable to predict particle kinematics in complex boundary conditions not seen during training. The trained model accurately predicts within a 5\% error of its associated material point method (MPM) simulation. The predictions are 5,000x faster than traditional MPM simulations (2.5 hours for MPM simulations versus 20 s for GNS simulation of granular flow). GNS surrogates are popular for solving optimization, control, critical-region prediction for in situ viz, and inverse-type problems. The GNS code is available under the open-source MIT license at https://github.com/geoelements/gns.
我们开发了一个基于PyTorch的图形网络模拟器(GNS),它学习物理并预测颗粒和流体系统的流动行为。GNS使用表示材质点集合的节点和连接表示粒子或粒子簇之间的局部交互的节点的链接离散化区域。GNS通过图上的消息传递来学习交互规律。GNS有三个组件:(A)编码器,将粒子信息嵌入到潜在图中,边是学习函数;(B)处理器,允许数据传播并跨步骤计算节点交互;以及(C)解码器,从图中提取相关动力学(例如,粒子加速)。我们引入了受物理启发的简单归纳偏差,例如允许学习算法将一个解决方案(恒定重力加速)优先于另一个解决方案的惯性框架,从而减少学习时间。GNS实现使用半隐式欧拉积分来基于预测的加速度更新下一状态。基于轨迹数据训练的GNS可推广到预测复杂边界条件下的粒子运动学,这在训练期间是看不到的。训练后的模型预测精度在其关联物质点法(MPM)模拟误差的5%以内。预测速度是传统MPM模拟的5000倍(MPM模拟2.5小时,而GNS颗粒流模拟S 20小时)。GNS代理在解决现场优化、控制、临界区预测和逆型问题等方面很受欢迎。GNS码在麻省理工学院的开源许可下可以在https://github.com/geoelements/gns.上获得