Content uploaded by Martin Servin
Author content
All content in this area was uploaded by Martin Servin on Mar 16, 2021
Content may be subject to copyright.
Towards a graph neural network solver for granular dynamics
Martin Servin*†, Holger Götz†, Tomas Berglund□, and Erik Wallin†
† Department of Physics, Umeå University, SE-90187 Umeå, Sweden
* e-mail: martin.servin@umu.se, web page: http://digitalphysics.se
□ Algoryx Simulation AB, Umeå, Sweden. http://www.algoryx.se
ABSTRACT
The discrete element method (DEM) is a versatile but computationally intensive method for granular
dynamics simulation. We investigate the possibility of accelerating DEM simulations using graph
neural networks (GNN), which automatically support variable connectivity between particles. This
approach was recently found promising for particle-based simulation of complex fluids [1]. We start
from a time-implicit, or nonsmooth, DEM [2], where the computational bottleneck is the process of
solving a mixed linear complementarity problem (MLCP) to obtain the contact forces and particle
velocity update. This solve step is substituted by a GNN, trained to predict the MLCP solution.
Following [1], we employ an encoder-process-decoder structure for the GNN. The particle and
connectivity data is encoded in an input graph with particle mass, external force, and previous
velocity as node attributes, and contact overlap, normal, and tangent vectors as edge attributes. The
sought solution is represented in the output graph with the updated particle velocities as node
attributes and the contact forces as edge attributes. In the intermediate processing step, the input
graph is converted to a latent graph, which is then advanced with a fixed number of message passing
steps involving a multilayer perceptron neural network for updating the edge and node values. The
output graph, with the approximate solution to the MLCP, is finally computed by decoding the last
processed latent graph.
Both a supervised and unsupervised method are tested for training the network on granular
simulation of particles in a rotating or static drum. AGX Dynamics [3] is used for running the
simulations, and Pytorch [4] in combination with the Deep Graph Library [5] for the learning. The
supervised model learns from ground truth MLCP solutions, computed using a projected Gauss-
Seidel (PGS) solver, sampled from 1200 simulations involving 50-150 particles. The unsupervised
model learns to minimize a loss function derived from the MLCP residual function using particle
configurations extracted from the same simulations but ignoring the approximate solution from the
PGS solver. The simulation samples are split into training data (80%), validation data (10%), and test
data (10%). Network hyperparameter optimization is performed. The supervised GNN solver reaches
an error level of 1% for the contact forces and 0.01% on the particle velocities for a static drum. For a
rotating drum, the respective errors are 10% and 1%. The unsupervised GNN solver reaches 1%
velocity errors, 5% normal forces errors, but it has significant problems with predicting the friction
forces. The latter is presumably because of the discontinuous loss function that follows from the
Coulomb friction law and therefore we explore regularization of it. Finally, we discuss the potential
scalability and performance for large particle systems.
REFERENCES
[1] A. Sanchez-Gonzalez, J. Godwin, T. Pfaff, R. Ying, J. Leskovec, and P. Battaglia. “Learning to
Simulate Complex Physics with Graph Networks”, Int. Conf. M L. arXiv:2002.09405 (2020).
[2] M. Servin, D. Wang, C. Lacoursière, and K. Bodin. “Examining the smooth and nonsmooth
discrete element approaches to granular matter”. Int. J. Num. Meth. Engng., 97, 878-902 (2014).
[3] AGX Dynamics, https://www.algoryx.se/agx-dynamics, Accessed: 2020-03-13.
[4] A. Paszke et al. “PyTorch: An imperative style, high-performance deep learning library”,
NeurIPS, 8024-8035 (2019).
[5] M. Wang et al. “Deep graph library: A graph-centric, highly-performant package for graph
neural networks”, arXiv:1909.01315 (2019).