Abstract
We present an error-neural-modeling-based strategy for approximating two-dimensional curvature in the level-set method. Our main contribution is a redesigned hybrid solver [Larios-Cárdenas and Gibou, J. Comput. Phys. (May 2022), 10.1016/j.jcp.2022.111291] that relies on numerical schemes to enable machine-learning operations on demand. In particular, our routine features double predicting to harness curvature symmetry invariance in favor of precision and stability. The core of this solver is a multilayer perceptron trained on circular- and sinusoidal-interface samples. Its role is to quantify the error in numerical curvature approximations and emit corrected estimates for select grid vertices along the free boundary. These corrections arise in response to preprocessed context level-set, curvature, and gradient data. To promote neural capacity, we have adopted sample negative-curvature normalization, reorientation, and reflection-based augmentation. In the same manner, our system incorporates dimensionality reduction, well-balancedness, and regularization to minimize outlying effects. Our training approach is likewise scalable across mesh sizes. For this purpose, we have introduced dimensionless parametrization and probabilistic subsampling during data production. Together, all these elements have improved the accuracy and efficiency of curvature calculations around under-resolved regions. In most experiments, our strategy has outperformed the numerical baseline at twice the number of redistancing steps while requiring only a fraction of the cost.










Similar content being viewed by others
Explore related subjects
Discover the latest articles, news and stories from top researchers in related subjects.Data availability
The training datasets generated during the current study are not publicly available due to space limitations but are available from the corresponding author on reasonable request. Our neural networks, their preprocessing objects, and the testing flower-interface data sets we used, however, are publicly available at https://github.com/UCSB-CASL/Curvature_ECNet_2D.
Notes
We use the terms node, grid point, and vertex interchangeably.
We will limit ourselves to \(n = 2\) dimensions in this manuscript. Also, we will omit the explicit time dependence of \(\phi \) and \(\Gamma \) for compactness.
For us, \(h\kappa \) denotes the numerical approximation to dimensionless curvature at the interface,
is the neurally corrected estimation, \(h\kappa ^\star \) is MLCurvature()’s output, and \(h\kappa ^*\) represents the exact value.
For consistency, we represent one-element nodal variables as M-vectors in lowercase bold faces (e.g., \(\varvec{{\phi }} \)) and variables with \(d > 1\) values per node as d-by-M matrices in caps (e.g., \({\hat{N}}\)). M is the number of vertices, e.g., all independent nodes that a p4est [48] macromesh
is aware of.
This is a dictionary mapping coordinate codes to numerical values; for example, m maps to \(-1\).
One should choose \(h\kappa _{\min }^* \leqslant h\kappa _{\min }^{low}\), where the latter is the lower bound from Algorithm 1.
In homogenous coordinates, \([x,y,1]^T\) is a point, while \([x,y,0]^T\) is a vector. \(T(\cdot )\) and \(R(\cdot )\) are thus 3-by-3 matrices in \({\mathbb {R}}^2\).
Element-wise division.
Standardization or z-scoring transforms a vector \(\varvec{{\psi }} \) into \(\varvec{{\psi }} '\), which has mean 0 and variance 1.
If \(D \in {\mathbb {R}}^{n \times p}\) is a data set, and \(M \in {\mathbb {R}}^{n \times p}\) contains D’s column-wise mean p-vector \(\varvec{{\mu }} \) stacked n times, then \(C = \frac{1}{n-1}(D-M)^T(D-M)\) is D’s p-by-p covariance matrix. Further, if \({\mathbf {x}}= \varvec{{d}} - \varvec{{\mu }} \) is a centered, feature p-vector, and \(C = U\Sigma V^T\) is C’s SVD decomposition, then \({\mathbf {x}}_k = V_k^T{\mathbf {x}}\) is the PCA-transformed k-vector, where \(V_k\) contains V’s first k columns. Lastly, whitening involves normalizing \({\mathbf {x}}_k\) so that \({\mathbf {x}}_k' = \Sigma _k^{-1/2} {\mathbf {x}}_k\), where \(\Sigma _k\) is \(\Sigma \)’s k-order leading principal sub-matrix.
The correlation matrix is equivalent to the covariance matrix of the standardized data [52].
A single-precision general matrix-matrix multiplication of the form \(C = \alpha AB+\beta C\), where \(\alpha = 1\) and \(\beta = 0\).
Using C++14 compiling optimization enabled via -O2 -O3 -march=native.
References
Friedman, A.: Variational Principles of Free-Boundary Problems. Dover Publications, New York (2010)
Osher, S., Sethian, J.A.: Fronts propagating with curvature-dependent speed: Algorithms based on Hamilton-Jacobi formulations. J. Comput. Phys. 79(1), 12–49 (1988)
Popinet, S.: Numerical models of surface tension. Annu. Rev. Fluid Mech. 50(1), 49–75 (2018)
Sussman, M., Smereka, P., Osher, S.: A level set approach for computing solutions to incompressible two-phase flow. J. Comput. Phys. 114(1), 146–159 (1994)
Sussman, M., Fatemi, E., Smereka, P., Osher, S.: An improved level set method for incompressible two-phase flows. Comput. & Fluids 27(5–6), 663–680 (1998)
Gibou, F., Chen, L., Nguyen, D., Banerjee, S.: A level set based sharp interface method for the multiphase incompressible Navier-Stokes equations with phase change. J. Comput. Phys. 222(2), 536–555 (2007)
Theillard, M., Gibou, F., Saintillan, D.: Sharp numerical simulation of incompressible two-phase flows. J. Comput. Phys. 391, 91–118 (2019)
Losasso, F., Gibou, F., Fedkiw, R.: Simulating water and smoke with an octree data structure. ACM Trans. Graph. (SIGGRAPH Proc.) 23(3), 457–462 (2004)
Losasso, F., Shinar, T., Selle, A., Fedkiw, R.: Multiple interacting liquids. SIGGRAPH ACM TOG 25(3), 812–819 (2006)
Gibou, F., Hyde, D., Fedkiw, R.: Sharp interface approaches and deep learning techniques for multiphase flows. J. Comput. Phys. 380, 442–463 (2019)
Egan, R., Guittet, A., Temprano-Coleto, F., Isaac, T., Peaudecerf, F.J., Landel, J.R., Luzzatto-Fegiz, P., Burstedde, C., Gibou, F.: Direct numerical simulation of incompressible flows on parallel octree grids. J. Comput. Phys. 428, 110084 (2021)
Chen, H., Min, C., Gibou, F.: A numerical scheme for the Stefan problem on adaptive Cartesian grids with supralinear convergence rate. J. Comput. Phys. 228(16), 5803–5818 (2009)
Papac, J., Gibou, F., Ratsch, C.: Efficient symmetric discretization for the Poisson, heat and Stefan-type problems with Robin boundary conditions. J. Comput. Phys. 229(3), 875–889 (2010)
Papac, J., Helgadottir, A., Ratsch, C., Gibou, F.: A level set approach for diffusion and Stefan-type problems with Robin boundary conditions on quadtree/octree adaptive Cartesian grids. J. Comput. Phys. 233, 241 (2013)
Mirzadeh, M., Gibou, F.: A conservative discretization of the Poisson-Nernst-Planck equations on adaptive Cartesian grids. J. Comput. Phys. 274, 633–653 (2014)
Theillard, M., Gibou, F., Pollock, T.: A sharp computational method for the simulation of the solidification of binary alloys. J. Sci. Comput. 63, 330–354 (2015)
Boudon, F., Chopard, J., Ali, O., Gilles, B., Hamant, O., Boudaoud, A., Traas, J., Godin, C.: A computational framework for 3D mechanical modeling of plant morphogenesis with cellular resolution. PLoS Comput. Biol. 11(1), e1003950 (2015)
Ocko, S.A., Heyde, A., Mahadevan, L.: Morphogenesis of termite mounds. Proc. Natl. Acad. Sci. U.S.A. 116(9), 3379–3384 (2019)
Alias, M.A., Buenzli, P.R.: A level-set method for the evolution of cells and tissue during curvature-controlled growth. Int. J. Numer. Methods Biomed. Eng. 36(1), e3279 (2020)
Lervåg, K. Y.: Calculation of interface curvature with the level-set method. arXiv:1407.7340 (July 2014)
Sethian, J.A.: Level Set Methods and Fast Marching Methods. In: Cambridge Monogr. Appl. Comput. Math., 2nd edn. Cambridge University Press, Cambridge, UK (1999)
Osher, S., Fedkiw, R.: Level Set Methods and Dynamic Implicit Surfaces. Appl. Math. Sci. 153. Springer, Cham (2002)
Gibou, F., Fedkiw, R., Osher, S.: A review of level-set methods and some recent applications. J. Comput. Phys. 353, 82–109 (2018)
Hirt, C.W., Nichols, B.D.: Volume of fluid (VOF) method for the dynamics of free boundaries. J. Comput. Phys. 39, 201–225 (1981)
Qin, R.S., Bhadeshia, H.K.: Phase field method. Materials Sci. Tech. 26(7), 803–811 (2010)
Tryggvason, G., Bunner, B., Esmaeeli, A., Juric, D., Al-Rawahi, N., Tauber, W., Han, J., Nas, S., Jan, Y.-J.: A front-tracking method for the computations of multiphase flow. J. Comput. Phys. 169(2), 708–759 (2001)
du Chéné, A., Min, C., Gibou, F.: Second-order accurate computation of curvatures in a level set framework using novel high-order reinitialization schemes. J. Sci. Comput. 35, 114–131 (2008)
Zhao, H.: A fast sweeping method for eikonal equations. Math. Comp. 74, 603–627 (2005)
Detrixhe, M., Gibou, F., Min, C.: A parallel fast sweeping method for the eikonal equation. J. Comput. Phys. 237, 46–55 (2013)
Macklin, P., Lowengrub, J.: An improved geometry-aware curvature discretization for level set methods: Application to tumor growth. J. Comput. Phys. 215(2), 392–401 (2006)
Larios-Cárdenas, L.Á., Gibou, F.: A deep learning approach for the computation of curvature in the level-set method. SIAM J. Sci. Comput. 43(3), A1754–A1779 (2021)
Larios-Cárdenas, L.Á., Gibou, F.: A hybrid inference system for improved curvature estimation in the level-set method using machine learning. J. Comput. Phys. 463, 111291 (2022)
Qi, Y., Lu, J., Scardovelli, R., Zaleski, S., Tryggvason, G.: Computing curvature for volume of fluid methods using machine learning. J. Comput. Phys. 377, 155–161 (2019)
Aggarwal, C.C.: Neural Networks and Deep Learning - A Textbook. Springer, Cham (2018)
Mehta, P., Bukov, M., Wang, C., Day, A.G.R., Richardson, C., Fisher, C.K., Schwabd, D.J.: A high-bias, low-variance introduction to machine learning for physicists. Phys. Rep. 810, 1–124 (2019)
Patel, H.V., Panda, A., Kuipers, J.A.M., Peters, E.A.J.F.: Computing interface curvature from volume fractions: A machine learning approach. Comput. & Fluids 193, 104263 (2019)
Després, B., Jourdren, H.: Machine learning design of volume of fluid schemes for compressible flows. J. Comput. Phys. 408(1), 109275 (2020)
Ataei, M., Bussmann, M., Shaayegan, V., Costa, F., Han, S., Park, C.B.: NPLIC: A machine learning approach to piecewise linear interface construction. Computers & Fluids 223, 104950 (2021). arxiv:2007.04244
Buhendwa, A.B., Bezgin, D.A., Adams, N.: Consistent and symmetry preserving data-driven interface reconstruction for the level-set method. J. Comp. Phys. 457, 111049 (2022)
França, H.L., Oishi, C.M.: A machine learning strategy for computing interface curvature in front-tracking methods. J. Comput. Phys. 450, 110860 (2022)
Larios-Cárdenas, L. Á., Gibou, F.: Error-correcting neural networks for semi-Lagrangian advection in the level-set method. arXiv:2110.11611 (October 2021)
Pathak, J., Mustafa, M., Kashinath, K., Motheau, E., Kurth, T., Day, M.: Using machine learning to augment coarse-grid computational fluid dynamics simulations. arXiv:2010.00072 (2020)
Dong, C., Loy, C.C., He, K., Tang, X.: Learning a deep convolutional network for image super-resolution. In: Fleet, D., Pajdla, T., Schiele, B., Tuytelaars, T. (eds.) Computer Vision - ECCV 2014., pp. 184–199. Springer International Publishing, Cham (2014)
Min, C., Gibou, F.: A second order accurate level set method on non-graded adaptive Cartesian grids. J. Comput. Phys. 225(1), 300–321 (2007)
Shu, C.-W., Osher, S.: Efficient implementation of essentially non-oscillatory shock capturing schemes. II. J. Comput. Phys. 83(1), 32–78 (1989)
Jiang, G.-S., Peng, D.: Weighted ENO schemes for Hamilton-Jacobi equations. SIAM J. Sci. Comput. 21(6), 2126–2143 (2000)
Mirzadeh, M., Guittet, A., Burstedde, C., Gibou, F.: Parallel level-set methods on adaptive tree-based grids. J. Comput. Phys. 322, 345–364 (2016)
Burstedde, C., Wilcox, L.C., Ghattas, O.: p4est: Scalable algorithms for parallel adaptive mesh refinement on forests of octrees. SIAM J. Sci. Comput. 33(3), 1103–1133 (2011)
Strain, J.: Tree methods for moving interfaces. J. Comput. Phys. 151(2), 616–648 (1999)
Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V., Vanderplas, J., Passos, A., Cournapeau, D., Brucher, M., Perrot, M., Duchesnay, E.: Scikit-learn: Machine learning in Python. J. Mach. Learn. Res. 12, 2825–2830 (2011)
Turk, M., Pentland, A.: Eigenfaces for recognition. J. Cogn. Neurosci. 3(1), 71–86 (1991)
Parker, D.S.: Exploring the Matrix - Adventures in Modeling with Matlab. UCLA Course Reader Solutions, United States (2016)
de Berg, M., van Kreveld, M., Overmars, M., Schwarzkopf, O.: Computational Geometry - Algorithms and Applications, 2nd edn. Springer, Cham (2000)
Min, C.: Local level set method in high dimension and codimension. J. Comput. Phys. 200(1), 368–382 (2004)
Swokowski, E.W.: Calculus with Analytic Geometry, 4th edn. PWS Publishers, Boston, MA (1988)
Hill, J.F.S.: Computer Graphics Using OpenGL, 2nd edn. Prentice-Hall Inc., Hoboken, New Jersey (2001)
Heath, M. T.: Scientific Computing: An Introductory Survey. SIAM, Philadelphia, revised 2nd edition (2018)
Parent, R.: Computer Animation: Algorithms and Techniques, 2nd edn. Morgan Kaufmann, Burlington, Massachusetts (2008)
The Boost Community. Boost C++ libraries. https://www.boost.org, (August 2019). v1.71.0
Abadi, M., Agarwal, A., Barham, P., Brevdo, E., Chen,Z., Citro, C., Corrado,G.S., Davis, A., Dean, J., Devin, M., Ghemawat, S., Goodfellow, I., Harp, A., Irving, G., Isard, M., Jozefowicz, R., Jia, Y., Kaiser, L., Kudlur, M., Levenberg, J., Mané, D., Schuster, M., Monga, R., Moore, S., Murray, D., Olah, C., Shlens, J., Steiner, B., Sutskever, I., Talwar, v., Tucker, P., Vanhoucke, V., Vasudevan, V., Viégas, F., Vinyals, O., Warden, P., Wattenberg, M., Wicke, M., Yu, Y., Zheng, X.: TensorFlow: Large-Scale Machine Learning on Heterogeneous Systems. https://www.tensorflow.org (2015)
Chollet, F., et al.: Keras. https://keras.io (2015)
McKinney, W.: Data Structures for Statistical Computing in Python. In S. van der Walt and J. Millman, editor, In: Proceedings of the 9th Python in Science Conference, pp. 56–61 (2010). https://pandas.pydata.org
LeCun, Y. A., Bottou, L., Orr, G. B., Müller, K.-R.: Efficient BackProp, volume 7700 of Lecture Notes in Comput. Sci., pp. 9–48. Springer Berlin Heidelberg, Berlin, Heidelberg (2012)
Lohmann, N.: JSON for modern C++. https://github.com/nlohmann/json (August 2020). v3.9.1
Hermann, T.: Frugally-deep. https://github.com/Dobiasd/frugally-deep, (February 2021). v0.15.2
Xianyi, Z., Kroeker, M.: OpenBLAS: An optimized BLAS library. https://github.com/xianyi/OpenBLAS (July 2021). v0.3.17
Zhuang, J., Kochkov, D., Bar-Sinai, Y., Brenner, M. P., Hoyer, S.: Learned discretizations for passive scalar advection in a two-dimensional turbulent flow. Phys. Rev. Fluids, 6(6):064605 (June 2021). https://github.com/google-research/data-driven-advection
Ray, D., Hesthaven, J.S.: An artificial neural network as a troubled-cell indicator. J. Comp. Phys. 367, 166–191 (2018)
Morgan, N. R., Tokareva, S., Liu, X., Morgan, A. D.: A machine learning approach for detecting shocks with high-order hydrodynamic methods. AIAA SciTech Forum (January 2020)
Beucler, T., Pritchard, M., Rasp, S., Ott, J., Baldi, P., Gentine, P.: Enforcing analytic constraints in neural networks emulating physical systems. Phys. Rev. Lett. 126(9), 098302 (2021)
Funding
The authors declare that no funds, grants, or other support were received during the preparation of this manuscript.
Author information
Authors and Affiliations
Contributions
Luis Ángel Larios-Cárdenas: Conceptualization, Methodology, Software, Validation, Formal analysis, Investigation, Resources, Data curation, Writing - Original draft, Visualization. Frédéric Gibou: Conceptualization, Methodology, Resources, Writing - Review & editing, Supervision, Project administration, Funding acquisition.
Corresponding author
Ethics declarations
Competing interests
The authors have no relevant financial or non-financial interests to disclose.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Larios-Cárdenas, L.Á., Gibou, F. Error-Correcting Neural Networks for Two-Dimensional Curvature Computation in the Level-set Method. J Sci Comput 93, 6 (2022). https://doi.org/10.1007/s10915-022-01952-2
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s10915-022-01952-2