Python Interface Quick Reference

Python Interface Quick Reference#

This document summarizes how to use the Python interface of NGSBEM to

  1. assemble boundary integral operators (matrices), and

  2. evaluate potentials in the domain (representation formulas).

The focus is on practical usage of the interface, staying as close as possible to the explicit mathematical structure of the operators.

We deliberately separate

  • Assembly → bilinear form → matrix

  • Evaluation → layer potential based on density → field value in the domain


Notation

Symbol

Meaning

u, v

SurfaceL2 functions

uH1, vH1

H1 traces

uHDiv, vHDiv

HDivSurface functions

uHCurl, vHCurl

HCurl traces

ds

boundary measure

kappa

wavenumber


1. Assembly: Boundary Integral Operators (Matrices)

Laplace

Description

Assembly

Single Layer operator

V = LaplaceSL(u*ds)*v*ds

Double Layer operator

K = LaplaceDL(uH1*ds)*v*ds

Hypersingular operator

D = LaplaceSL(curl(uH1)*ds)*curl(vH1)*ds


Helmholtz

Description

Assembly

Single Layer operator

V = HelmholtzSL(u*ds, kappa)*v*ds

Double Layer operator

K = HelmholtzDL(uH1*ds, kappa)*v*ds

Hypersingular operator

D = HelmholtzSL(curl(uH1)*ds, kappa)*curl(vH1)*ds

Combined field operator

C = HelmholtzCF(u*ds, kappa)*v*ds

In practical scattering problems, the Combined Field Integral Equation (CFIE) is typically used because it is stable with respect to interior resonances. The combined field operator could also be constructed from the standard operators above, but it is provided directly for convenience.


Maxwell

Description

Construction

Single Layer operator

V = kappa * V1 - (1/kappa) * V2

- V1 = HelmholtzSL(uHDiv*ds, kappa) * vHDiv*ds

- V2 = HelmholtzSL(div(uHDiv)*ds, kappa) * div(vHDiv)*ds

Double layer operator

K = MaxwellDL(uHCurl.Operator("rotated_trace")*ds, kappa)*vHDiv*ds

Hypersingular operator

D = kappa * D1 - (1/kappa) * D2

- D1 = HelmholtzSL((Cross(n, uHCurl)*ds, kappa) * Cross(n, vHCurl)*ds

- D2 = HelmholtzSL(uHCurl.Operator("surface_curl")*ds, kappa) * vHCurl.Operator("surface_curl")*ds


2. Potential Evaluation (Representation Formulas)

These operators do not produce matrices. Instead, they evaluate the field generated by a boundary density at points in the domain.


Laplace

Potential

Interface

Single Layer potential

LaplaceSL(u*ds)

Double Layer potential

LaplaceDL(uH1*ds)


Helmholtz

Potential

Interface

Single Layer potential

HelmholtzSL(u*ds, kappa)

Double Layer potential

HelmholtzDL(u*ds, kappa)


Maxwell

Potential

Interface

Single Layer potential

kappa * E1 + (1/kappa) * E2

E1 = HelmholtzSL(uHDiv.Trace()*ds, kappa)(j)

E2 = grad( HelmholtzSL(div(uHDiv.Trace())*ds, kappa)(j) )

Double Layer potential

curl(HelmholtzSL(uHCurl.Operator("rotated_trace")*ds, kappa))(m)

Notes:

  • the Maxwell representation formulas are written explicitly in terms of Helmholtz single-layer potentials.

  • the double-layer operator is MaxwellDL, whereas in the representation formula the same contribution appears as curl(HelmholtzSL(...)).

3. Matrix vs. Potential Operators

Expression pattern

Result

Purpose

SL(u * ds) * v * ds

matrix / bilinear form

assembling boundary operators

SL(u * ds)(j)

field value

evaluating potentials in the domain


4. Typical Workflow

Step

Operation

1

assemble boundary integral operator

2

solve for boundary density

3

evaluate potential in the domain