skip to main content


The NSF Public Access Repository (NSF-PAR) system and access will be unavailable from 5:00 PM ET until 11:00 PM ET on Friday, June 21 due to maintenance. We apologize for the inconvenience.

Title: Finch: Domain Specific Language and Code Generation for Finite Element and Finite Volume in Julia
We introduce FINCH, a Julia-based domain specific language (DSL) for solving partial differential equations in a discretization agnostic way, currently including finite element and finite volume methods. A key focus is code generation for various internal or external software targets. Internal targets use a modular set of tools in Julia providing a direct solution within the framework. In contrast, external code generation produces a set of code files to be compiled and run with external libraries or frameworks. Examples include a matlab target, for smaller problems or prototyping, or C++/MPI based targets for larger problems needing scalability. This allows us to take advantage of their capabilities without needlessly duplicating them, and provides options tailored to the needs of the domain scientist. The modular design of FINCH allows ongoing development of these target modules resulting in a more extensible framework and a broader set of applications. The support for multiple discretizations, including finite element and finite volume methods, also contributes to this goal. Another focus of this project is complex systems containing a large set of coupled PDEs that could be challenging to efficiently code and optimize by hand, but that are relatively simple to specify using the DSL. In this paper we present the key features of FINCH that set it apart from many other DSL options, and demonstrate the basic usage and current capabilities through examples.  more » « less
Award ID(s):
1808652 2008772
Author(s) / Creator(s):
; ;
Date Published:
Journal Name:
Computational Science -- ICCS 2022
Medium: X
Sponsoring Org:
National Science Foundation
More Like this
  1. Finch, a domain specific language and code generation framework for partial differential equations (PDEs), is demonstrated here to solve two classical problems: steady-state advection diffusion equation (single PDE) and the phonon Boltzmann transport equation (coupled PDEs). Both finite volume and finite element methods are explored. In addition to work presented at the 2022 International Conference on Computational Science (Heisler et al., 2022), we include recent developments for solving nonlinear equations using both automatic and symbolic differentiation, and demonstrate the capability for the Bratu (nonlinear Poisson) equation. 
    more » « less
  2. The phonon Boltzmann transport equation is a good model for heat transfer in nanometer scale structures such as semiconductor devices. Computational complexity is one of the main challenges in numerically solving this set of potentially thousands of nonlinearly coupled equations. Writing efficient code will involve careful optimization and choosing an effective parallelization strategy, requiring expertise in high performance computing, mathematical methods, and thermal physics. To address this challenge, we present the domain specific language and code generation software Finch. This language allows a domain scientist to enter the equations in a simple format, provide only basic mathematical functions used in the model, and generate efficient parallel code. Even very complex systems of equations such as phonon Boltzmann transport can be entered in a very simple, intuitive way. A feature of the framework is flexibility in numerical methods, computing environments, parallel strategies, and other aspects of the generated code. We demonstrate Finch on this problem using a variety of parallel strategies and model configurations to demonstrate the flexibility and ease of use. 
    more » « less
  3. In recent years, there has been significant interest in the development of finite element methods defined on meshes that include rather general polytopes and curvilinear polygons. In the present work, we provide tools necessary to employ multiply connected mesh cells in planar domains, i.e., cells with holes, in finite element computations. Our focus is efficient evaluation of the \(H^1\) semi-inner product and \(L^2\) inner product of implicitly defined finite element functions of the types arising in boundary element based finite element methods and virtual element methods. Such functions are defined as solutions of Poisson problems having a polynomial source term and continuous boundary data. We show that the integrals of interest can be reduced to integrals along the boundaries of mesh cells, thereby avoiding the need to perform any computations in cell interiors. The dominating cost of this reduction is solving a relatively small Nyström system to obtain a Dirichlet-to-Neumann map, as well as the solution of two more Nyström systems to obtain an “anti-Laplacian” of a harmonic function, which is used for computing the \(L^2\) inner product. Several numerical examples demonstrate the high-order accuracy of this approach. Reproducibility of computational results. This paper has been awarded the “SIAM Reproducibility Badge: code and data available” as a recognition that the authors have followed reproducibility principles valued by SISC and the scientific computing community. Code and data that allow readers to reproduce the results in this paper are available at both and the supplementary materials (PuncturedFEM\_v0\_2\ [1.75MB]). 
    more » « less
  4. Abstract

    Immersed boundary methods are high-order accurate computational tools used to model geometrically complex problems in computational mechanics. While traditional finite element methods require the construction of high-quality boundary-fitted meshes, immersed boundary methods instead embed the computational domain in a structured background grid. Interpolation-based immersed boundary methods augment existing finite element software to non-invasively implement immersed boundary capabilities through extraction. Extraction interpolates the structured background basis as a linear combination of Lagrange polynomials defined on a foreground mesh, creating an interpolated basis that can be easily integrated by existing methods. This work extends the interpolation-based immersed isogeometric method to multi-material and multi-physics problems. Beginning from level-set descriptions of domain geometries, Heaviside enrichment is implemented to accommodate discontinuities in state variable fields across material interfaces. Adaptive refinement with truncated hierarchically refined B-splines (THB-splines) is used to both improve interface geometry representations and to resolve large solution gradients near interfaces. Multi-physics problems typically involve coupled fields where each field has unique discretization requirements. This work presents a novel discretization method for coupled problems through the application of extraction, using a single foreground mesh for all fields. Numerical examples illustrate optimal convergence rates for this method in both 2D and 3D, for partial differential equations representing heat conduction, linear elasticity, and a coupled thermo-mechanical problem. The utility of this method is demonstrated through image-based analysis of a composite sample, where in addition to circumventing typical meshing difficulties, this method reduces the required degrees of freedom when compared to classical boundary-fitted finite element methods.

    more » « less
  5. The solution of compressible flow equations is of interest with many aerospace engineering applications. Past literature has focused primarily on the solution of Computational Fluid Dynamics (CFD) problems with low-order finite element and finite volume methods. High-order methods are more the norm nowadays, in both a finite element and a finite volume setting. In this paper, inviscid compressible flow of an ideal gas is solved with high-order spectral/hp stabilized formulations using uniform high-order spectral element methods. The Euler equations are solved with high-order spectral element methods. Traditional definitions of stabilization parameters used in conjunction with traditional low-order bilinear Lagrange-based polynomials provide diffused results when applied to the high-order context. Thus, a revision of the definitions of the stabilization parameters was needed in a high-order spectral/hp framework. We introduce revised stabilization parameters, τsupg, with low-order finite element solutions. We also reexamine two standard definitions of the shock-capturing parameter, δ: the first is described with entropy variables, and the other is the YZβ parameter. We focus on applications with the above introduced stabilization parameters and analyze an array of problems in the high-speed flow regime. We demonstrate spectral convergence for the Kovasznay flow problem in both L1 and L2 norms. We numerically validate the revised definitions of the stabilization parameter with Sod’s shock and the oblique shock problems and compare the solutions with the exact solutions available in the literature. The high-order formulation is further extended to solve shock reflection and two-dimensional explosion problems. Following, we solve flow past a two-dimensional step at a Mach number of 3.0 and numerically validate the shock standoff distance with results obtained from NASA Overflow 2.2 code. Compressible flow computations with high-order spectral methods are found to perform satisfactorily for this supersonic inflow problem configuration. We extend the formulation to solve the implosion problem. Furthermore, we test the stabilization parameters on a complex flow configuration of AS-202 capsule analyzing the flight envelope. The proposed stabilization parameters have shown robustness, providing excellent results for both simple and complex geometries.

    more » « less