BIT Numerical Mathematics

, Volume 53, Issue 1, pp 111–152 | Cite as

A domain-specific embedded language in C++ for lowest-order discretizations of diffusive problems on general meshes

  • Daniele A. Di PietroEmail author
  • Jean-Marc Gratien
  • Christophe Prud’homme


In this work we propose an original implementation of a large family of lowest-order methods for diffusive problems including standard and hybrid finite volume methods, mimetic finite difference-type schemes, and cell centered Galerkin methods. The key idea is to regard the method at hand as a (Petrov–)Galerkin scheme based on possibly incomplete, broken affine spaces defined from a gradient reconstruction and a point value. The resulting unified framework serves as a basis for the development of a FreeFEM-like domain specific language targeted at defining discrete linear and bilinear forms. Both the back-end and the front-end of the language are extensively discussed, and several examples of applications are provided. The overhead of the language is evaluated with respect to a more traditional implementation. A benchmark including the comparison with more classical finite element methods on standard meshes is also proposed.


Domain specific embedded language Finite volume methods Cell centered Galerkin methods Petrov–Galerkin methods 

Mathematics Subject Classification

65N08 65N30 65Y05 


  1. 1.
    Aavatsmark, I., Barkve, T., Bøe, Ø., Mannseth, T.: Discretization on unstructured grids for inhomogeneous, anisotropic media, Part I: Derivation of the methods. SIAM J. Sci. Comput. 19(5), 1700–1716 (1998) CrossRefMathSciNetzbMATHGoogle Scholar
  2. 2.
    Aavatsmark, I., Eigestad, G.T., Mallison, B.T., Nordbotten, J.M.: A compact multipoint flux approximation method with improved robustness. Numer. Methods Partial Differ. Equ. 24, 1329–1360 (2008) CrossRefMathSciNetzbMATHGoogle Scholar
  3. 3.
    Agélas, L., Di Pietro, D.A., Droniou, J.: The G method for heterogeneous anisotropic diffusion on general meshes. Modél. Math. Anal. Numér. 44, 597–625 (2010) CrossRefzbMATHGoogle Scholar
  4. 4.
    Agélas, L., Di Pietro, D.A., Eymard, R., Masson, R.: An abstract analysis framework for nonconforming approximations of diffusion problems on general meshes. Int. J. Finite Vol. 7(1), 1–29 (2010) MathSciNetGoogle Scholar
  5. 5.
    Arnold, D.N.: An interior penalty finite element method with discontinuous elements. SIAM J. Numer. Anal. 19, 742–760 (1982) CrossRefMathSciNetzbMATHGoogle Scholar
  6. 6.
    Bassi, F., Botti, L., Colombo, A., Di Pietro, D.A., Tesini, P.: On the flexibility of agglomeration based physical space discontinuous Galerkin discretizations. J. Comput. Phys. 231(1–2), 45–65 (2012) CrossRefMathSciNetzbMATHGoogle Scholar
  7. 7.
    Brezzi, F., Lipnikov, K., Shashkov, M.: Convergence of mimetic finite difference methods for diffusion problems on polyhedral meshes. SIAM J. Numer. Anal. 45, 1872–1896 (2005) CrossRefMathSciNetGoogle Scholar
  8. 8.
    Brezzi, F., Lipnikov, K., Simoncini, V.: A family of mimetic finite difference methods on polygonal and polyhedral meshes. Math. Models Methods Appl. Sci. 15, 1533–1553 (2005) CrossRefMathSciNetzbMATHGoogle Scholar
  9. 9.
    Burman, E., Stamm, B.: Minimal stabilization for discontinuous Galerkin finite element methods for hyperbolic problems. Commun. Comput. Phys. 5, 498–524 (2009) MathSciNetGoogle Scholar
  10. 10.
    Ciarlet, P.G.: Basic error estimates for elliptic problems. In: Ciarlet, P.G., Lions, J.-L. (eds.) Finite Element Methods. Handbook of Numerical Analysis, vol. II. North-Holland, Amsterdam (1991). Chap. 2 Google Scholar
  11. 11.
    Di Pietro, D.A.: Cell-centered Galerkin methods. C. R. Math. Acad. Sci. Paris 348, 31–34 (2010) CrossRefMathSciNetzbMATHGoogle Scholar
  12. 12.
    Di Pietro, D.A.: A compact cell-centered Galerkin method with subgrid stabilization. C. R. Acad. Sci. Paris, Ser. I 348(1–2), 93–98 (2011) CrossRefGoogle Scholar
  13. 13.
    Di Pietro, D.A.: Cell centered Galerkin methods for diffusive problems. Modél. Math. Anal. Numér. 46(1), 111–144 (2012) CrossRefGoogle Scholar
  14. 14.
    Di Pietro, D.A., Ern, A.: Mathematical Aspects of Discontinuous Galerkin Methods. Mathématiques & Applications, vol. 69. Springer, Berlin (2011) Google Scholar
  15. 15.
    Di Pietro, D.A., Ern, A.: Analysis of a discontinuous Galerkin method for heterogeneous diffusion problems with low-regularity solutions. Numer. Methods Partial Differ. Equ. 28(4), 1161–1177 (2012) CrossRefzbMATHGoogle Scholar
  16. 16.
    Di Pietro, D.A., Gratien, J.-M.: Lowest order methods for diffusive problems on general meshes: a unified approach to definition and implementation. In: Fořt, J., Fürst, J., Halama, J., Herbin, R., Hubert, F. (eds.) Finite Volumes for Complex Applications, vol. VI, pp. 3–19. Springer, Berlin (2011) Google Scholar
  17. 17.
    Droniou, J., Eymard, R.: A mixed finite volume scheme for anisotropic diffusion problems on any grid. Numer. Math. 105(1), 35–71 (2006) CrossRefMathSciNetzbMATHGoogle Scholar
  18. 18.
    Droniou, J., Eymard, R., Gallouët, T., Herbin, R.: A unified approach to mimetic finite difference, hybrid finite volume and mixed finite volume methods. Math. Models Methods Appl. Sci. 20(2), 265–295 (2010) CrossRefMathSciNetzbMATHGoogle Scholar
  19. 19.
    Edwards, M.G., Rogers, C.F.: Finite volume discretization with imposed flux continuity for the general tensor pressure equation. Comput. Geosci. 2, 259–290 (1998) CrossRefMathSciNetzbMATHGoogle Scholar
  20. 20.
    Ern, A., Guermond, J.-L.: Theory and Practice of Finite Elements. Applied Mathematical Sciences, vol. 159. Springer, New York (2004) CrossRefzbMATHGoogle Scholar
  21. 21.
    Eymard, R., Gallouët, T., Herbin, R.: Discretization of heterogeneous and anisotropic diffusion problems on general nonconforming meshes SUSHI: a scheme using stabilization and hybrid interfaces. IMA J. Numer. Anal. 30, 1009–1043 (2010) CrossRefMathSciNetzbMATHGoogle Scholar
  22. 22.
    Eymard, R., Henry, G., Herbin, R., Hubert, F., Klöfkorn, R., Manzini, G.: 3D benchmark on discretization schemes for anisotropic diffusion problems on general grids. In: Fořt, J., Fürst, J., Halama, J., Herbin, R., Hubert, F. (eds.) Finite Volumes for Complex Applications. Problems & Perspectives, vol. VI, pp. 95–130. Springer, Berlin (2011) Google Scholar
  23. 23.
    Geuzaine, C., Remacle, J.-F.: Gmsh: a three-dimensional finite element mesh generator with built-in pre- and post-processing facilities. Int. J. Numer. Methods Eng. 79(11), 1309–1331 (2009) CrossRefMathSciNetzbMATHGoogle Scholar
  24. 24.
    Grospellier, G., Lelandais, B.: The Arcane development framework. In: Proceedings of the 8th Workshop on Parallel/High-performance Object-Oriented Scientific Computing, POOSC’09, pp. 4:1–4:11. ACM, New York (2009) Google Scholar
  25. 25.
    Hansbo, P., Larson, M.G.: Discontinuous Galerkin and the Crouzeix–Raviart element: application to elasticity. Modél. Math. Anal. Numér. 37(1), 63–72 (2003) CrossRefMathSciNetzbMATHGoogle Scholar
  26. 26.
    Hecht, F., Pironneau, O.: FreeFEM++ manual. Laboratoire Jacques Louis Lions (2005) Google Scholar
  27. 27.
    Herbin, R., Hubert, F.: Benchmark on discretization schemes for anisotropic diffusion problems on general grids. In: Finite Volumes for Complex Applications, vol. V, pp. 659–692. Wiley, New York (2008) Google Scholar
  28. 28.
    Logg, A., Mardal, K.-A., Wells, G.N.: Automated Solution of Differential Equations by the Finite Element Method. Lecture Notes in Computational Science and Engineering, vol. 84. Springer, Berlin (2012) CrossRefzbMATHGoogle Scholar
  29. 29.
    Long, K., Kirby, R., van Bloemen Waanders, B.: Unified embedded parallel finite element computations via software-based Fréchet differentiation. SIAM J. Sci. Comput. 32, 3323–3351 (2010) CrossRefMathSciNetzbMATHGoogle Scholar
  30. 30.
    Niebler, E.: boost::proto documentation (2011).
  31. 31.
    Prud’homme, C.: A domain specific embedded language in C++ for automatic differentiation, projection, integration and variational formulations. Sci. Program. 14(2), 81–110 (2006) Google Scholar
  32. 32.
    Prud’Homme, C., Chabannes, V., Doyeux, V., Ismail, M., Samake, A., Pena, G.: Feel++: a computational framework for Galerkin methods and advanced numerical methods. Accepted in ESAIM Proc.,, January 2012
  33. 33.
    Prud’homme, C., Chabannes, V., Pena, G., Veys, S.: Feel++: finite element embedded language in C++. Free software available at Contributions from A. Samake, V. Doyeux, M. Ismail
  34. 34.
    ISO: Information technology—Syntactic metalanguage—Extended BNF. ISO Standard: ISO/IEC 14977:1996 Google Scholar

Copyright information

© Springer Science+Business Media Dordrecht 2012

Authors and Affiliations

  • Daniele A. Di Pietro
    • 1
    Email author
  • Jean-Marc Gratien
    • 2
  • Christophe Prud’homme
    • 3
  1. 1.Institut de Mathématiques et de Modélisation de MontpellierUniversité Montpellier 2Montpellier Cedex 5France
  2. 2.Department of Information TechnologyIFP Energies nouvellesRueil-Malmaison CedexFrance
  3. 3.Université de Strasbourg, IRMA/CNRS UMR 7501Strasbourg CedexFrance

Personalised recommendations