4  Evaluation of the Discrete Forms

In this section a list of operations for computing the discrete integral operators is given. This particular programme of computation is given prominence because it needs to be executed for each quadrature point and hence it is the key to determining the computational cost of the overall method. The following computational programme is intended to be optimal. Note that it is assumed that p and vp are already set.


A: Set q the point on the element

B: Set nq the unit outward normal to the element at q

C: Compute vp.nq

D: Compute r

E: Compute r, r2

F: Compute r3 (in the 3D case)

G: Compute r/ nq via (23)

H: Compute r/ vp via (24)

I: Compute

r/ nq *r/ vp

J: Compute 2 r/ vp nq via (25)


K: Compute kr [k*r] and ikr [i*kr]

L: Compute skr [kr*kr] (in the 3D cases)

M: Compute H [Hankel function H0(1) (kr), H1(1) (kr) for 2D problems] or E [exp(ikr) for 3D problems].

N: Compute Green's function via (6) or (10) for 2D or via (7) or (11) for 3D.

O: Multiply Lk kernel by weight and add to sum

P: Compute Gk/ r via (16) or (12) for 2D or via (18) or (14) for 3D

Q: Compute value of quadrature weight multiplied by the result of operation N.

R: Compute Mk kernel multiplied by weight and add to sum

S: Compute Mkt kernel multiplied by weight and add to sum

T: Compute 2 Gk/ r2 via (17) or (13) for 2D or via (19) or (15) for 3D

U: Multiply Nk kernel by weight and add to sum

Apart from operations E and M, each operation can be directly costed in terms of floating-point operations. Operation E computes a square root and operation M computes a Hankel function in two-dimensional problems and a complex exponential in three-dimensional problems. The square root and the complex exponential functions are available in most programming languages, though in some cases it could be beneficial (in terms of computational cost) not to use the standard language functions.

In the two-dimensional case, operation M requires the computation of the spherical Hankel functions or log functions when k is zero. An external module is required for the evaluation of the Hankel function.

In the subroutines H2LC, H3LC and H3ALC the square root function and the exponential and/or Hankel function or log functions that are evaluated at each quadrature point need to be provided as external functions with the identifiers FNSQRT, FNEXP, FNHANK and FNLOG. The freedom to define the functions externally and to choose the quadrature rule allows the user to take full control of the efficiency of the subroutines.