A: Set q the point on the panel
B: Set nq the unit outward normal to the panel at q
C: Compute up.nq
D: Compute r
E: Compute r, r2
F: Compute r3 (in the 3D case)
G: Compute [(¶r)/( ¶nq)] via (3.20)
H: Compute [(¶r)/( ¶up)] via (3.21)
I: Compute
[(¶r)/( ¶nq)] *[(¶r)/( ¶up)]
J: Compute [(¶2 r)/( ¶up ¶nq)]
via (3.22)
K: Compute kr [k*r] and ikr [i*kr]
L: Compute skr [kr*kr] in the 3D case)
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 (3.5) or (3.7) for 2D
or via (3.6) or (3.8) for 3D.
O: Multiply Lk kernel by weight and add to sum
P: Compute [(¶Gk)/( ¶r)]
via (3.13) or (3.9) for 2D or via
(3.15) or (3.11) 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 (3.14) or (3.10) for 2D or
via (3.16) or (3.12) 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, although 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. Since Hankel functions are not generally available as standard functions, then some external routine is required for their evaluation.
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.