NiHu  2.0
Introduction

What is NiHu?

NiHu is an open source C++ and Matlab toolbox used for solving boundary value problems of partial differential equations by means of the boundary element method (BEM).

The core module

The core modul of the toolbox provides a general framework to numerically evaluate weighted residual integrals of the form

\( \displaystyle W_{ij} = \left<t_i, \left(\mathcal{K}d_j\right)_S\right>_F = \int_F t_i({\bf x}) \int_S K({\bf x}, {\bf y}) d_j({\bf y}) \mathrm{d} S_{{\bf y}} \mathrm{d} F_{{\bf x}} \)

where \( S \) denotes a boundary surface, \( t_i \) and \( d_j \) denote base functions of discretised function spaces, and \( \mathcal{K} \) denotes an integral operator defined by its kernel function \( K \). Such integrals frequently arise when the numerical solution of boundary value problems is formalised using the finite or boundary element methods (see for example An introductory BEM example).

The fast multipole extension

The fast multipole extension of the toolbox provides a programming environment to evaluate weighted residual matrix-vector products of the type

\( \displaystyle f_{i} = \sum_{j} \left<t_i, \left(\mathcal{K}d_j\right)_S\right>_F \sigma_j = \sum_{j} \int_F t_i({\bf x}) \int_S K({\bf x}, {\bf y}) d_j({\bf y}) \mathrm{d} S_{{\bf y}} \mathrm{d} F_{{\bf x}} \sigma_j \)

where \( \sigma_j \) denotes an element of the discretized excitation. Matrix vector products of the above type are accelerated using the fast multipole method applied to the specific kernel function \( K({\bf x}, {\bf y}) \).

Unified programming interface

The main motivation of developing NiHu is to provide a unified open source software framework for BEM problems of different kinds. Our implementation is capable to generate BEM executables

  • with Direct and Indirect BEM formalism
  • with Galerkin, Collocational and General solution methods
  • in 2D and 3D
  • with element types defined in a general manner

The main C++ core of NiHu can be considered as a skeleton that defines different BEM problems in a general way, by reflecting mathematics behind boundary elements in the C++ code. The C++ code snippet below demonstrates the capabilities of NiHu's application layer:

auto msh = create_mesh(nodes, elements, quad_1_tag(), tria_1_tag());
auto func_sp = constant_view(msh);
auto L = create_integral_operator(laplace_3d_SLP_kernel());
auto M = create_integral_operator(laplace_3d_DLP_kernel());
auto I = identity_integral_operator();
L_matrix << dirac(func_sp) * L[func_sp];
M_matrix << dirac(func_sp) * M[func_sp] + dirac(func_sp) * (-.5*I)[func_sp];

The 7-line code snippet defines a collocational 3D BEM for the Laplace equation, implemented with constant triangular and quadrilateral elements, and computes the system matrices of the discretised boundary integrals.

Customisable library

Specific aspects of BEM implementations are developed in C++ libraries designed to be easily customisable by researchers and developers. Developers may customise

  • Element types
  • Kernels and their fast multipole expansions
  • Quadratures
  • Singular and nearly singular integration techniques specific to kernels, formalisms and element types
  • and more...

in order to adapt NiHu to their specific problems.

Matlab layer

The Matlab shell layer provides extensive pre- and post processing features like

  • Parametric mesh generation for academic benchmarks
  • Standard mesh format import and export
  • Direct and iterative solutions of the resulting matrix equations
  • Easy plot generation

and makes integration with other software tools straightforward.

Summary

The introduced concept allows a beneficial application of the toolbox in

  • education, where general mathematical aspects need to be emphasized,
  • research, where the developer can focus on small scale details, while having his implementation working as a part of a general system;
  • and engineering practice, as the implementation is capable of solving problems of industrial size.