Proposing an intelligent mesh smoothing method with graph neural networks

Zhichao Wang, Xinhai Chen, Junjun Yan, Jie LiuarXiv 2023 · DOI

Abstract

In Computational Fluid Dynamics (CFD), the quality of the underlying mesh is a primary determinant of simulation accuracy and stability. Traditional smoothing methods often present a trade-off between computational speed and the quality of the resulting mesh. This paper introduces GMSNet, a lightweight Graph Neural Network (GNN) framework designed for rapid and high-quality mesh smoothing. By utilizing a novel unsupervised loss function termed MetricLoss, GMSNet learns to optimize node positions based on geometric quality metrics without the need for expensive, pre-optimized ground-truth labels. The model achieves a 13.5x speedup over traditional optimization-based methods while utilizing 95% fewer parameters than previous deep learning approaches. Furthermore, a shift truncation mechanism is integrated to ensure mesh validity by preventing the creation of inverted elements.

Introduction

Mesh smoothing is a critical preprocessing step in CFD, where node positions are adjusted to improve the shape of elements—ideally moving them toward a near-equilateral configuration. Engineers currently face a dilemma: heuristic methods like Laplacian smoothing are computationally efficient but can produce poor-quality or even invalid "inverted" elements. Conversely, optimization-based methods yield high-quality results but are too slow for large-scale industrial simulations.

Previous attempts to apply artificial intelligence to this problem have struggled with the irregular topology of meshes and the requirement for massive labeled datasets. GMSNet addresses these bottlenecks by leveraging the inherent properties of GNNs, which are naturally suited for unstructured data and are permutation invariant. This allows a single model to effectively smooth nodes regardless of their local connectivity or the order in which neighbor data is processed.

Methodology

The GMSNet architecture is designed to be both lightweight and robust. The workflow begins by extracting a local neighborhood, or "StarPolygon," around a target node. To ensure the model is invariant to scale and orientation, these local coordinates undergo a normalization process before being processed by a node encoder.

Overview of the GMSNet architecture and the iterative smoothing workflow.

The core of the network consists of a GNN block that performs message passing between nodes, followed by a Multi-Layer Perceptron (MLP) that predicts the optimal displacement for the central node. To maintain mesh integrity, the authors implemented a Shift Truncation mechanism. If a predicted move would result in an invalid element (e.g., a negative volume), the displacement vector is iteratively halved until the resulting mesh configuration is valid. This fault-tolerance ensures that the AI-driven process remains physically consistent.

MetricLoss and Unsupervised Learning

A significant contribution of this research is the introduction of MetricLoss, an unsupervised loss function that allows the network to learn directly from geometric principles. Instead of training the model to mimic a "perfect" mesh, MetricLoss is calculated based on the aspect ratio of the triangles within the StarPolygon.

The MetricLoss function derived from the geometric properties of the star polygon.

By minimizing this loss, GMSNet identifies node positions that maximize the quality metric $q_i$. This unsupervised approach is not only more flexible than supervised learning but also more stable. The authors noted that MetricLoss avoids the gradient explosion issues commonly associated with other metrics, such as the min-max angle, during the training phase.

Experimental Results and Discussion

The researchers trained GMSNet on a modest dataset of 20 2D triangle meshes and evaluated its performance across several distinct test cases, including square, circle, airfoil, and pipe geometries.

  • Computational Efficiency: GMSNet demonstrated a 13.56x speedup over traditional optimization-based smoothing methods. This efficiency is achieved with a model that uses only 5% of the parameters of previous "NN-Smoothing" architectures.
  • Mesh Quality: In complex scenarios like the airfoil and pipe meshes, GMSNet produced results that closely approximated or even exceeded the quality of optimization-based methods in terms of the mean inverse aspect ratio.
  • Robustness and Generalization: The model successfully smoothed geometries it had never encountered during training. For instance, it effectively handled the manually distorted airfoil mesh, proving that it had learned the fundamental principles of geometric optimization rather than merely memorizing specific shapes.

Conclusion

GMSNet represents a significant advancement in the application of deep learning to CFD preprocessing. By combining the topological flexibility of GNNs with an unsupervised geometric loss function, the authors have created a tool that is both faster than optimization methods and more reliable than simple heuristics. While the current implementation is limited to 2D triangle meshes, the framework provides a clear roadmap for extension to 3D volume meshes. Future work will focus on scaling the model for industrial-sized simulations and exploring hybrid methods that combine node smoothing with topological modifications such as edge flipping.

Summary updated

BibTeX
@misc{wang2023proposing,
  author = {Zhichao Wang and Xinhai Chen and Junjun Yan and Jie Liu},
  title = {{Proposing an intelligent mesh smoothing method with graph neural networks}},
  year = {2023},
  eprint = {2311.12815},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.12815},
}
Figure