# Tests of the scuff-em core library

The libscuff unit of the scuff-em test suite tests several elemental calculations implemented by libscuff routines for assembling and post-processing the linear SIE system.

$\def\vb#1{{\mathbf #1}} \def\mb#1{{\mathbb #1}} \def\mc#1{{\mathcal #1}} % \def\inp#1#2{{\big\langle #1 \big| #2 \big\rangle}} \def\Inp#1#2{{\Big\langle #1 \Big| #2 \Big\rangle}} \def\INP#1#2{{\bigg\langle #1 \bigg| #2 \bigg\rangle}} % \def\vmv#1#2#3{{\big\langle #1 \big| #2 \big | #3 \big\rangle}} \def\Vmv#1#2#3{{\Big\langle #1 \Big| #2 \Big | #3 \Big\rangle}} \def\VMV#1#2#3{{\bigg\langle #1 \bigg| #2 \bigg | #3 \bigg\rangle}} %$

## SIE matrix elements: Singular and non-singular 4-dimensional integrals

This subunit tests libscuff routines for computing element of the SIE system matrix, which involve singular and nonsingular 4-dimensional integrals over pairs of triangular panels.

### SIE matrix elements in scuff-em

First we review the computation of SIE matrix elements in scuff-em.

#### Matrix elements

In the most general case, each pair of RWG basis functions $\{\vb b_{\alpha}, \vb b_{\beta}\}$ contributes a $2\times 2$ block of entries to the system matrix:

where $r$ runs over the indices of the (zero, one, or two) regions through which the basis functions interact, $\{\epsilon_r, \mu_r, k_r\}$ are the material properties and wavevector magnitude in region $r$, and $\mb G, \mb C\propto \nabla \times \mb G$ are the homogeneous dyadic Green's functions of Maxwell's equations.

If one or both basis functions lie on PEC surfaces then $\Delta\vb M$ reduces to a $2\times 1$, $1\times 2$, or $1\times 1$ matrix.

#### Edge-edge interactions

Matrix elements of the $\mb G$ and $\mb C$ operators are 4-dimensional integrals over the supports of the basis functions that may be written in terms of the scalar Greens' function:

with

#### Panel-panel interactions

Each edge-edge integral is a sum of 4 panel-panel integrals, e.g.

(This is for the general case in which both basis functions are full RWG basis functions; if one or both are half-RWG functions then the number of contributing panel pairs reduces to 2 or 1.)

The panel-panel integrals are

#### Desingularization

For pairs of basis functions with 1 or more common vertices I desingularize by subtracting off the first 3 nonvanishing terms in the small-$r$ series for $\Phi(r)$ and $\Psi(r)$ and integrating these terms separately. Thus I put

and e.g.

### Reference values

As reference values for testing libscuff routines for evaluating RWG integrals, I consider matrix elements between RWG functions on the following surface mesh, in which the triangles are sufficiently regular that it's easy to write down and evaluate the required 4-dimensional integrals.

For example, the positive-positive-panel contribution to $\mc{I}_{\nabla 0 0}$ reads

Parameterize the integral according to

to yield an integral over the unit 4-dimensional hypercube: