Skip to main content
Proceedings. Mathematical, Physical, and Engineering Sciences logoLink to Proceedings. Mathematical, Physical, and Engineering Sciences
. 2016 Oct;472(2194):20160401. doi: 10.1098/rspa.2016.0401

Numerical quadrature over smooth, closed surfaces

J A Reeger 1,, B Fornberg 2, M L Watts 1
PMCID: PMC5095443  PMID: 27843402

Abstract

The numerical approximation of definite integrals, or quadrature, often involves the construction of an interpolant of the integrand and its subsequent integration. In the case of one dimension it is natural to rely on polynomial interpolants. However, their extension to two or more dimensions can be costly and unstable. An efficient method for computing surface integrals on the sphere is detailed in the literature (Reeger & Fornberg 2016 Stud. Appl. Math. 137, 174–188. (doi:10.1111/sapm.12106)). The method uses local radial basis function interpolation to reduce computational complexity when generating quadrature weights for any given node set. This article generalizes this method to arbitrary smooth closed surfaces.

Keywords: quadrature, surface integral, radial basis functions, radial basis function-finite differences

1. Introduction

Accurate approximation of partial differential equations (PDEs) and integrals on a surface often requires the construction of node sets featuring spatially varying densities in order to capture rapidly changing features (in the integrand or in the surface curvature). Applications where both spherical and non-spherical surfaces arise include geophysics [1] and mathematical biology (e.g. to model bio-molecules [2] or processes on cell membranes). For radial basis function (RBF)-based solution methods in these areas, see, for example, [38]. This paper considers an RBF-based method for numerical quadrature over smooth, closed surfaces. This method is well suited for obtaining integrated quantities, such as total energy, average temperature, integrating the function f(x,y,z)=1 over the surface to obtain surface area, etc.

Earlier literature on computing surface integrals focused largely on the sphere and were based on very specific node sets, using tabulated weights for select values of N (the total number of nodes) [911]. More recent literature has borrowed concepts from radial basis function-generated finite differences (RBF-FD) applied to spatially variable node sets for spherical quadrature [12]. This RBF-FD-motivated technique for spherical quadrature is here generalized to approximating integrals over arbitrary smooth, closed surfaces.

Various integration methods on the sphere appear in, for example, [11,1316]. Using interpolation with spherical harmonics, Womersley & Sloan [11] found that certain near-uniform node sets performed much worse than others, and designed special maximal determinant sets to overcome the issue. The reason for the irregularities (large accuracy differences between similar looking node sets) was subsequently found and resolved [16]. Later quadrature work for the sphere [12] has focused on (i) allowing for local node refinement and (ii) lowering the cost (from O(N3) to O(NlogN)) for calculating quadrature weights for N nodes.

Some of the methods for numerically computing surface integrals on the sphere have been adapted to other surfaces [17,18]. In [17], two methods are presented for numerical integration on a sphere, which are then adapted to integration over other smooth surfaces homeomorphic to the sphere. Similarly, Fuselier et al. [18] developed a quadrature method that extends to manifolds that are either homogeneous (including S2) or diffeomorphic to homogeneous spaces.

Additional types of quadrature for surfaces in R3 can be found in [10,19,20]. For example, Chien [19] discusses numerical quadrature for piecewise smooth surfaces using polynomial interpolants, while Sommariva & Womersley [10] couples thin-plate spline interpolation with Green's integral formula [21] for a meshless cubature in R3. Quadrature involving a Galerkin discretization of a boundary integral equation with a weakly singular kernel is adapted from electromagnetics to a general framework in [20]. In cases when the nodes (where data are available) are not given by an application, but the quadrature method can choose these freely, some additional opportunities arise. Gaussian quadrature for the sphere is described in [22] and for level set surfaces in (hyper-) rectangles in [23]. This latter reference also cites and summarizes several methods based on approximations with smoothed delta functions (generally of low orders of accuracy).

A common theme throughout the development of each of these methods is that they are fixed to particular node sets featuring near-uniform density in order to achieve stability. Some of these can achieve high orders of accuracy, even spectral, on the near-uniform datasets, but at the expense of a lengthy, often intractable, process for constructing the node sets themselves. On the other hand, the method introduced in this paper can be applied to node sets that are highly non-uniform. For smooth integrands, this new method achieves a convergence rate of O(N−3.5), which corresponds to O(h7) on nearly uniformly spaced node sets where all points are roughly h=O(1/N) apart. This can be contrasted with the one-dimensional case of nodes spaced h apart, where the classical trapezoidal and Simpson's rules only achieve O(h2) and O(h4) convergence rates, respectively. While no results are displayed in this paper for highly non-uniform node sets, the method in [12] (which this method extends from) performs comparably well on even pseudorandom node sets and also on node sets that are strongly concentrated around critical features of the integrand. The steps in the method described here which differ from the one in [12] are impacted little, if at all, by the configuration of nodes.

This article begins with a summary of the RBF-FD-motivated method for quadrature over a general smooth, closed surface. This is followed by a discussion of the computational efficiency of the method and demonstrations of the accuracy on several combinations of surfaces and test integrands. Implementations of this method are available at Matlab Central's File Exchange [24] or on Github for Python or Julia implementations (see [25] or [26], respectively). All of the results presented herein were generated using the Matlab® [27] implementation.

2. A description of the method

We wish to approximate the surface integral of the scalar function f(x), xR3, over a smooth, closed surface SR3 via

IS(f):=Sf(x)dSi=1Nwif(xi),

where the node set SN={xi}i=1NS is a set of (scattered) data sites located on the surface. Let the surface S be given in one of several forms: (i) as a level surface h(x)=0, (ii) as an explicit parametrization x(u,v) for parameters u and v, or (iii) only requiring the surface to be smooth, and include the node set SN. In each case, the method introduced in this paper requires that the set SN and its corresponding triangulation T={tk}k=1K are given (or have been calculated, for example, with a Delaunay triangulation routine). The set T itself approximates the surface very crudely, but can be related to a set T={τk}k=1K of curved triangles on the surface such that T fully covers the surface and no two elements of T intersect except at, possibly, their edges. The surface integral is then the sum over the curved triangles

IS(f)=k=1Kτkf(x)dS. 2.1

This method can be summarized in five steps similar to those presented in [12]:

  • (i) For each of the curved triangles in T, find a projection point.

  • (ii) From the projection point, project a neighbourhood of the three vertices of the curved triangle (points in SN) on S into the plane containing the corresponding flat triangle in T. This neighbourhood will include n−3 neighbouring nodes.

  • (iii) Find quadrature weights over the local projected node set for numerical evaluation of the definite integral over the projected central flat planar triangle.

  • (iv) Convert quadrature weights in each plane to corresponding weights for the surface.

  • (v) Combine the weights for the individual curved triangles to obtain the full weight set for the surface.

(a). Step 1: Find a projection point

In the method presented in [12], for each spherical triangle in T a neighbourhood of the three vertices of the triangle on the surface of the sphere is projected radially from the sphere centre onto the plane tangent to the surface of the sphere at the midpoint of the spherical triangle. This projection is known as the gnomonic projection and it is a well-known map projection technique, used already by the Greek Thales of Miletus in the seventh and sixth centuries BC [28]. It projects any geodesic (great-circle arc) as a straight line into a plane tangent to the sphere. In the case of the sphere, each neighbourhood can be projected from a common projection point—the centre of the sphere.

For an arbitrary smooth, closed surface we can no longer use a common projection point for all of the curved triangles. Section ??sec2b presents a formula for the projection that indicates the possibility of a singularity or numerical cancellation if the projection point falls in or near the same plane as the corresponding flat triangle being projected. Further, projection points for adjacent curved triangles must be selected so that the portion of the surface projected onto a flat triangle is accounted for in the integral over (i) only the flat triangle corresponding to the current curved triangle (i.e. tk when considering τk) and (ii) at least one flat triangle in (2.1). For these reasons, a different approach is taken.

(i). Defining the ‘cutting’ plane

Locating the projection point for each curved triangle in T begins by defining a unique ‘cutting’ plane for each edge in the triangulation T so that both of the two triangles containing a given edge will define the same plane. Throughout the remainder of this paper, the subscript k will be used to indicate that the steps are carried out for each triangle separately. When further subscripting is necessary—for instance, to indicate entries of a vector, matrix or a set—the necessary indexing will follow after a comma.

Consider the flat triangle tk=tAkBkCk in figure 1. The cutting plane along the edge AkBk is defined to contain the edge and to be parallel to the average of the normals nAkBkCk and nAkBkEk of tAkBkCk and tAkBkEk, respectively, pointing in the same general direction (that is, the angle between them is less than π/2). This average vector is given by

nAkBk=12(nAkBkCk+sign(nAkBkCkTnAkBkEk)nAkBkEk).

The vectors nBkCk and nCkAk can be defined similarly as in figure 1.

Figure 1.

Figure 1.

An illustration of a central flat triangle and its three immediate neighbours, all with the normal vectors shown as solid arrows. The three dashed vectors are displayed as originating from the projection point associated with the central flat triangle, and each goes through one side of it. These dashed vectors are defined by nAkBk=12(nAkBkCk+sign(nAkBkCkTnAkBkEk)nAkBkEk), nBkCk=12(nAkBkCk+sign(nAkBkCkTnBkCkFk)nBkCkFk) and nCkAk=12(nAkBkCk+sign(nAkBkCkTnAkCkDk)nAkCkDk). (Online version in colour.)

(ii). Locating a projection point

Once the cutting planes have been defined, for each flat triangle in T the point, xOk, of intersection of the three cutting planes is found. The three cutting planes for each of the flat triangles will, in general, intersect at a single point in three-dimensional space (with a special case of a point at infinity when nAkBk, nBkCk and nCkAk are all three parallel and the projection into the plane becomes the orthogonal projection). This point can be written as, for example,

xOk=xAk+nOkBkCk(xBkxAk)nOkBkCkvOkAkvOkAk,

where nOkAkBk=nAkBk×(xBkxAk), nOkCkAk=nCkAk×(xAkxCk) and

vOkAk=nOkAkBk×nOkCkAk,

with × the vector cross product. An illustration of this point of intersection can be found in figure 1.

(b). Step 2: Project locally to the plane containing the flat triangle

Once the point xOk is available, points x in a neighbourhood of the flat triangle tAkBkCk (and on the surface S) must be projected into the plane containing tAkBkCk for the interpolation procedure described in §??sec2c. The projection occurs by determining the intersection of this plane and the line through xOk and in the direction of (xxOk). Denote the region of S that projects onto tAkBkCk (including its boundary) to be τAkBkCk=τk. The projection neighbourhood containing 12 neighbouring vertices is illustrated in figure 2a.

Figure 2.

Figure 2.

An illustration of the projection of a triangle and its neighbours. (a) Here τAkBkCk is the central triangle and n=12 of its nearest neighbours (including the three vertices) are projected from xOk into the plane containing the vertices of τAkBkCk. The dashed line segments originating at xOk illustrate the projection of each of the nearest neighbours into the plane. (b) The two-dimensional coordinates of the nearest neighbours from the left frame, which are computed from (2.2). (Online version in colour.)

To reduce the dimension of the interpolation problem, a two-dimensional coordinate system in the plane containing tAkBkCk is defined by first translating the original coordinate system so that xOk is at the origin. This translated coordinate system is then rotated so that nABC aligns with the vertical axis. This rotation can be realized by multiplication by the matrix (as long as nxk2+nyk20, in which case Rk=I)

Rk=[nxknzknxk2+nyk2nxk2+nyk2+nzk2nyknzknxk2+nyk2nxk2+nyk2+nzk2nxk2+nyk2nxk2+nyk2+nzk2nyknxk2+nyk2nxknxk2+nyk20nxknxk2+nyk2+nzk2nyknxk2+nyk2+nzk2nzknxk2+nyk2+nzk2],

where nxk, nyk and nzk are the three components of nAkBkCk.

Let Nkn={xk,j}j=1n be the set containing the n nearest points in SN to the flat triangle tAkBkCk. After projecting, shifting and rotating the point in Nkn, their representations in the two-dimensional coordinate system may be centred at a point far from the origin in the two-dimensional space. This can create numerical issues when inverting the RBF interpolation matrix because of the size of the polynomial terms. To remedy this situation, one final translation is performed and the coordinates are defined as

χk=[100010]Rk1nAkBkCk(xxOk)(nAkBkCk×((xxOk)×(xMkxOk))) 2.2

to place the projection of the average of the triangle vertices, xMk=1/3(xAk+xBk+xCk), at the origin. The two-dimensional coordinates of the points in a neighbourhood of the central curved triangle in figure 2a are shown in figure 2b.

(c). Step 3: Find quadrature weights over the local projected node set

For the simplicity of discussion consider approximately evaluating the double integral of a function g(χk) over a planar triangle tAkBkCk. Denote this integral by

ItAkBkCk(g):=tAkBkCkg(χk)dA. 2.3

It can be evaluated approximately by integrating the RBF interpolant of g(χk) with basis functions ϕ(χkχk,j) centred at the projections of the n points in Nkn, which are all in a neighbourhood of tAkBkCk. RBF interpolation has been used successfully in the approximation of differential operators over subsets of scattered data through the concept of RBF-FD [3,6,29,30].

Following common RBF/RBF-FD procedures, let {πl(χk)}l=1M, with M=(m+1)(m+2)/2 the set of all of the bivariate polynomial terms up to degree m. The interpolant is constructed as

s(χk):=j=1nck,jRBFϕ(χkχk,j)+l=1Mck,lpπl(χk),

where ck,1RBF,,ck,nRBF,ck,1p,,ck,MpR are chosen to satisfy the interpolation conditions s(χk,j)=g(χk,j), j=1,2,…,n, along with constraints j=1nck,jRBFπl(χk,j)=0, for l=1,2,…,M. By integrating the interpolant the approximation of the integral of g is reduced to ItAkBkCk(g)j=1nwk,jRBFg(χk,j). A simple derivation can be carried out to show that the weights can be found by solving the linear system A~kWk=I~k with

A~k=[AkTPkPkT0],I~k=[IkRBFIkp]andWk=[wk,1RBFwk,nRBFwk,1pwk,Mp],

where Ak,ij=ϕ(χk,iχk,j), Pk,il=πl(χk,i), Ik,jRBF=ItAkBkCk(ϕ(χkχk,j)) and Ik,lp=ItAkBkCk(πl(χk)), for i,j=1,2,…,n and l=1,2,…,M [3], §5.1.4. When a node set comes from an application such as solving a system of PDEs, the likelihood of singularities occurring is for all practical purposes negligible (cf. [31], theorem 8.21, for precise non-singularity conditions). To guarantee non-singularity, a node set of high quality does not seem to be needed. However, some care would need to be taken if the nodes form patterns of extreme regularity, such as for satellite-obtained data that might be very densely sampled along just a few near-straight paths.

The integrals Ik,lp=ItAkBkCk(πl(χk)), l=1,2,…,M, can be evaluated exactly via, for instance, Green's theorem or through the conversion of the integral to barycentric coordinates. Exact evaluations of Ik,jRBF=ItAkBkCk(ϕ(χkχk,j)), j=1,2,…,n, are described in great detail in [12], where the integration over an arbitrary planar triangle is replaced by a combination of integrals over six right triangles (all available analytically). The results presented at the end of this article use the basis function ϕ(r)=r7, with r=χkχk,j2, where the integral over a right triangle, t, with χk,j a vertex located at one of the acute angles has closed form

tr7dA=α(105α8sinh1(β/α)+βα2+β2(279α6+326α4β2+200α2β4+48β6))3456.

In the preceding expression, α is the distance (the base) between χk,j and the vertex at the right angle and β is the length (the height) of the opposite side. Such expressions have also been found for many of the most popular choices of RBFs (e.g. ϕ(r)=r2k+1 or ϕ(r)=r2klnr, k=1,2,3,…, or for Gaussian, multi-quadric, or inverse multi-quadric basis functions). For a theoretical discussion on the impact of the choice of ϕ on the convergence of the interpolant (which will have an effect on the performance of this method for computing quadrature weights) see, for example, [32] or [31]. Default choices of the number of nearest neighbours and maximum polynomial order are n=80 and m=7, respectively. These choices were made to balance computation time with accuracy and for comparison with the method in [12], which uses the same parameters. An illustration of this balance appears in §4.

(d). Step 4: Convert quadrature weights in the plane to weights for the surface integral

The projections developed in the previous sections amount to changes of variables in the integrals in (2.1) that relate the surface integral to an integral over an area in a plane. Denote the surface normal to S to be nS. This could be given by

nS(x):=h(x)h(x)2ornS(x):=(/u)x(u,v)×(/v)x(u,v)(/u)x(u,v)×(/v)x(u,v)2,

depending on whether S is described implicitly as a level surface or explicitly through a parametrization, respectively. For simplicity let nPk be the unit length vector in the direction of nAkBkCk. Then the surface integral over an individual curved ‘surface’ triangle τk is

τAkBkCkf(x)dS=tAkBkCkf(x(χk))nPk(x(χk)xOk)nS(x(χk))(x(χk)xOk)(nAkBkCk(x(χk)xOk)nAkBkCk(xAkxOk))2dA. 2.4

To understand the last two terms in (2.4) consider a local parametrization, x(η,ξ), of the points on S in a neighbourhood of tAkBkCk, and consider the points x(η,ξ), x(ηη,ξ) and x(η,ξξ). Then

(x(η+Δη,ξ)x(η,ξ)Δη)×(x(η,ξ+Δξ)x(η,ξ)Δξ)ΔηΔξ2

is the area of a parallelogram in three dimensions with these points as three of the vertices. Taking the limit of this area as Δη and Δξ approach zero, the infinitesimal surface area element on S is given by

dS=ηx(η,ξ)×ξx(η,ξ)2dηdξ.

Further, consider the two-dimensional coordinates after projection given by (2.2) of each of the vertices of the parallelogram. The infinitesimal area element in two dimensions with these points as vertices is similarly

dA=ηχk(x(η,ξ))×ξχk(x(η,ξ))2dηdξ=|nAkBkCk(xAkxOk)|2|nAkBkCk(x(η,ξ)xOk)|3|(ηx(η,ξ)×ξx(η,ξ))(x(η,ξ)xOk)|nAkBkCk2,

where the last line follows from (2.2). Noting that dS=(dS/dA) dA and (∂/∂η) x(η,ξ)×(∂/∂ξ) x(η,ξ) is a vector pointing in the same direction (or opposite) as nS, the last two terms in (2.4) follow.

In (2.4), the value of nS can be evaluated in closed form if such expressions describing the surface are available; however, at the start it was assumed that the surface may be given only as the set of points SN on the surface and the triangulation T. In the case where the closed form is not available the surface normal must be approximated (known from solving PDEs on surfaces to be a particularly large source of errors). Notice that after the projection, shifts and rotation in §??sec2b a local ‘explicit’ parametrization of each point x on the surface is available. That is, each point is parametrized by xk(χk), where χk is a point in the two-dimensional coordinate system after projection.

For each of the points in Nkn, the parametrization is known exactly via xk,j=xk(χk,j). Knowledge of the parametrization at these points allows each component to be approximated through interpolation via

xk(χk)sxk(χk):=j=1ncxk,jRBFϕ(χkχk,j)+l=1Mcxk,lpπl(χk),

where sxk:=R2R3. Here the vectors cxk,1RBF,,cxk,nRBF,cxk,1p,,cxk,MpR3 are chosen to satisfy the interpolation conditions sxk(χk,j)=xk(χk,j), j=1,2,…,n, along with constraints j=1ncxk,jRBFπl(χk,j)=0, for l=1,2,…,M. These vectors of coefficients are determined by solving A^kCxk=Xk with

A^k=[AkPkPkT0],Xk=[xk(χk,1)Txk(χk,2)Txk(χk,n)T0M]=[xk,1Txk,2Txk,nT0M]andCxk=[cxk,1RBFTcxk,nRBFTcxk,1pTcxk,MRBFT],

where Ak and Pk are as defined in §??sec2c and 0M is an M×3 zero matrix. Since Ak is symmetric, A^k in this section equals A~k from §??sec2c, allowing the vector Wk and the columns of Cxk to be found efficiently with, for instance, the QR decomposition of A~k in hand. Once the approximation for the explicit parametrization is found an approximation to the normal vector can be computed via the vector cross product between the first partial derivatives of sxk(χk) (with respect to the entries of χk).

Applying step 3 to the double integral (2.4) over a flat triangle tkT gives, for instance,

tAkBkCkf(x(χk))nPk(x(χk)xOk)nS(x(χk))(x(χk)xOk)(nAkBkCk(x(χk)xOk)nAkBkCk(xAkxOk))2dAj=1nwk,jRBFf(xk,j)nPk(xk,jxOk)nS(xk,j)(xk,jxOk)(nAkBkCk(xk,jxOk)nAkBkCk(xAkxOk))2. 2.5

(e). Step 5: Combine the weights over the entire surface

Summing over all of the curved triangles in T leads to the approximation of the surface integral over S

IS(f)k=1Kj=1nwk,jRBFf(xk,j)nPk(xk,jxOk)nS(xk,j)(xk,jxOk)(nAkBkCk(xk,jxOk)nAkBkCk(xAkxOk))2. 2.6

Let Ki, i=1,2,…,N, be the set of all pairs (k,j) such that χk,jxi. Then the surface integral over S can be rewritten as

IS(f)i=1N((k,j)Kiwk,jRBFnPk(xk,jxOk)nS(xk,j)(xk,jxOk)(nAkBkCk(xk,jxOk)nAkBkCk(xAkxOk))2)f(xi)=i=1Nwif(xi). 2.7

3. Computational cost

Just as with the method developed by Reeger & Fornberg [12], the method introduced in this article requires O(N) time and O(N) memory to construct a set of quadrature weights, even on node sets numbering in the millions. This is illustrated in figure 3. Neglecting the construction of the triangulation of the surface of the sphere discussed in [12], the computation time for that method is provided for comparison with the method introduced in this paper. A slight increase in computation time then comes from the determination of the projection point xOk in the case where the exact normal to the surface is known. When the surface normals must be approximated, the cost is greater (but still scales like O(N)) because of the additional systems of linear equations that must be solved. For all choices of N, memory use is the same for each of the methods considered.

Figure 3.

Figure 3.

(a) CPU time (in seconds) to compute quadrature weights for evaluating IS(f), where f is a scalar function. (b) Required memory (in bytes) required to compute the quadrature weights. In both frames, the method from [12] is only applicable to the sphere. The computations in this figure were performed in Matlab on a laptop with 32 GB of DDR3 1500 MHz memory and an Intel Core i7-4900MQ processor featuring four cores at 2.80 GHz. (Online version in colour.)

Since the method considers each curved triangle individually (as in [12]), the method is again embarrassingly parallel. Further, if a GPU is available, the Matlab function pagefun allows all of the linear systems to be solved at near peak GPU speeds.

The ability to parallelize this algorithm warrants that the cost in computation time be further broken down when considering each curved triangle, in turn. The greatest cost when considering each curved triangle is the solution of a linear system or linear systems of size O((n+m2)3). In the Matlab implementation, when considering an individual triangle and the surface normal available, only one linear system is solved using the backslash (‘∖’) command. When the normal to the surface must be approximated, the increase in computation time is more significant, because there are three more linear systems of equations that must be solved for each curved triangle. In this case, the Matlab implementation uses the built-in qr function (at a cost of O((n+m2)3) operations) to construct the decomposition, and then solves each upper triangular linear system using Matlab's linsolve command (O((n+m2)2) operations). The other operations performed in the calculation of the quadrature weights for an individual triangle affect the overall cost much less significantly. For instance, evaluation of the integrals of the RBFs and of the polynomial terms in closed form requires much less time than solving the systems of linear equations at approximately O(n) and O(m3.5), respectively.

The cost of locating the n nearest neighbours to each triangle should also be mentioned, since it could have a more significant effect on the overall computation time when the triangles are not considered in parallel. The method discussed in [33] requires O(NnlogN) operations in the nearest neighbour search using the kd-tree algorithm; however, all computational tests for parallel scalability have not shown this cost to impact the effectiveness of the parallelization.

4. Test integrands and results

The present method is demonstrated on a two-parameter family of surfaces and on three test integrands featuring varying degrees of regularity. The current default settings for the method are n=80 (number of nearest neighbours) and m=7 (maximum order of bivariate polynomial terms in interpolation). Figure 4 illustrates the effects of different choices of m and n on accuracy and computational cost and suggests that the default parameter choices balance these competing attributes. When using the approximate normal the computational cost is roughly double that of when using the exact normal. Further, an order of magnitude is lost in accuracy when approximating the surface normal, although the convergence rate is unaffected.

Figure 4.

Figure 4.

(a) Contour plot of log base 10 of the error when approximating the surface integral of (4.2) over the surface described implicitly by (4.1) when a=λb and b is chosen such that the surface area equals 1 for various m and n. In this case, the approximate normal is used. (b) Contour plots of computation time in seconds when computing the quadrature weights for various m and n. The dashed parabola in both plots represents the boundary n=M below which the linear system A~kWk=I~k becomes singular. The vertical axes are the same in the two plots. These computations were performed in Matlab on a workstation with two Intel Xeon E5-2697 v3 2.6 GHz processors that have 14 cores each (a total of 28 cores) and 256 GB of DDR4 2133 MHz memory. (Online version in colour.)

Consider the level surfaces defined by

h(x)=h(x,y,z)=(x2+y2+z2)22a2(x2y2z2)+a4b4=0, 4.1

which can also be parametrized explicitly via

x(θ,ϕ)=ρ(ϕ)cos(ϕ),y(θ,ϕ)=ρ(ϕ)sin(ϕ)sin(θ)andz(θ,ϕ)=ρ(ϕ)sin(ϕ)cos(θ),

with θ∈[0,2π), ϕ∈[0,π] and ρ(ϕ)=(b4a4)+a4cos2(2ϕ)+a2cos(2ϕ), respectively. This family is a set of surfaces of revolution generated by rotating the Cassini oval in the (x,y)-plane about the x-axis. In either case, the surface depends on the two parameters a and b, and the demonstrations here will consider a=λb for 0<λ<1 (specifically, λ=0,0.8,0.95). Notice that in the case of a=0 (λ=0) the surface reduces to a sphere of radius b. In the case of a=b (λ=1), the surface self-intersects, and the slice in the (x,y)-plane forms the Bernoulli lemniscate. Finally, if a>b (λ>1) is considered, two separate surfaces are generated. The parameter b in this work is chosen so that the surface area is equal to 1. Since the area of this surface of revolution is not known explicitly, b is chosen by finding the root of

R(b)=180a2+b20b4+4a2x2a2x2a2b4(b4+4a2x2)3/2+4a2x2b4+4a2x2a2b4(b4+4a2x2)3/2+4a2x4+4a4x2+b4x2+b4y2+4a2x2y2dydx

with a=λb using Matlab's fsolve command paired with its quad2d function to an absolute and relative tolerance of O(10−15). Figure 5 illustrates the three test surfaces. Node sets in all cases were generated using a modified version of ‘distmeshsurface’, a Matlab code made available in [34] and motivated in [35]. This code generates a set of N points (and triangulation) on the surface with nearly uniform spacing between each point and its neighbours (in Euclidean distance in R3).

Figure 5.

Figure 5.

Examples of the surface S defined implicitly by (4.1) when a=λb and b is chosen such that the surface area equals 1. On each surface, 10 contours are shown indicating the value of f2(x) evaluated at the points on the surface. (Online version in colour.)

Along with the three different test surfaces, demonstrations are performed on three different test integrands. First, recall that the surface S being considered is a surface of revolution about the x-axis, and in the (x,y)-plane r(x):=y(x)=a2x2+b4+4a2x2, which comes from solving h(x,y,0)=0. Therefore, if

f1(x):=13xh(x)h(x)2 4.2

(and 0<ab), then the volume contained by the surface (recalling the divergence theorem) is

IS(f1)=20a2+b2πr(x)2dx=π6a(2a(b22a2)a2+b2+3b4 sinh1(2aa2+b2b2)).

Figure 6 illustrates the error when computing the IS(f1) for various λ. In the case of λ=0 two curves are included. The first is the error when using the weights from the method presented in this paper. The second, labelled ‘from [12]’, uses the weights as computed in that paper. It is clear that, when considering an integrand that is C(S) (with no sharp gradients), convergence rates of O(N−3.5) or better can be achieved when the nodes in SN are nearly uniformly spaced on S. This is true in both of the cases where the exact normal of the surface is known for use in (2.4) and where the normal needs to be approximated.

Figure 6.

Figure 6.

Absolute error in the surface integral of f1. For each N, the error presented here is the maximum over 1000 random rotations of the node set about the x-axis. The label ‘from [12]’ indicates that the weights used were generated using the method from [12]. This curve was included for comparison. The errors presented in (a) are for the case where the exact normal is available and (b) considers when the normal is approximated. (Online version in colour.)

The only difference between the methods that produced the errors in the left and right frames is that an approximate surface normal, nS, was used in (2.7) for the construction of the weight sets in the right frame. This approximate surface normal is the result of RBF-based approximations to the partial derivatives of the local parametrization of the surface that is a consequence of the projection presented in §??sec2b. As with other methods of approximating the derivative, the one presented here falls victim to machine rounding errors. That is, the large increases in error as N moves beyond roughly 104.5 are the result of working in double precision floating point arithmetic. Computational experiments in extended precision (34-digit quadruple precision) using the Advanpix multiprecision computing toolbox [36] available for Matlab resolve these large increases in error at the expense of significantly greater computation time.

Second, consider f2(x,y,z)=(2/π)tan1(100z), such that IS(f2)=0. This test integrand is represented in figure 5 by 10 level curves (contours) evenly spaced between −1 and 1. While f2C(S), the integrand features a sharp gradient where S intersects the plane z=0. Figure 7 displays the absolute error in IS(f2). Note that, while f2C(S), in the presence of the steep gradient the convergence rate is slightly degraded. For N-values beyond the present range, the rate would be expected to again become O(N−3.5).

Figure 7.

Figure 7.

Absolute error in the surface integral of f2. For each N, the error presented here is the maximum over 1000 random rotations of the node set about the x-axis. The label ‘from [12]’ indicates that the weights used were generated using the method from [12]. This curve was included for comparison. The errors presented in (a) are for the case where the exact normal is available and (b) considers when the normal is approximated. (Online version in colour.)

Finally, consider f3(x,y,z)=sign(z), where sign represents the signum function. Therefore, f3 is discontinuous where z=0 intersects S. Figure 8 displays the absolute error in IS(f3). In this case, the integrand is not even continuous, and, as expected, the convergence rate is degraded to less than O(N−1).

Figure 8.

Figure 8.

Absolute error in the surface integral of f3. For each N, the error presented here is the maximum over 1000 random rotations of the node set about the x-axis. The label ‘from [12]’ indicates that the weights used were generated using the method from [12]. This curve was included for comparison. The errors presented in (a) are for the case where the exact normal is available and (b) considers when the normal is approximated. (Online version in colour.)

5. Conclusion

The method presented in this paper allows the computation of quadrature weights for evaluating the surface integral of a scalar function over smooth, closed surfaces. These quadrature weights can be computed in O(N) time and O(N) memory. When applied to C(S) integrands without sharp gradients, the convergence rate will be roughly O(N−3.5). Sharp gradients in the integrand only degrade the convergence marginally. Future work will include tests with still higher N-values, and also consider generalizations to surfaces with boundaries, thereby also allowing improved accuracy in cases of piecewise smooth surfaces and integrands.

Acknowledgements

We would like to thank the referees for their helpful comments and critiques.

Data accessibility

All presented data can be reproduced with the publicly available codes at Matlab Central's File Exchange [24] or on Github for Python or Julia implementations (see [25] or [26]).

Authors' contributions

J.A.R. contributed to the conception and design of the research, acquisition and analysis of the data, and drafting and revising the article; B.F. contributed to the conception and design of the research and revising the article; M.L.W. contributed to acquisition of the data and drafting the article. All authors gave final approval for publication.

Competing interests

We have no competing interests.

Funding

J.A.R. and M.L.W. were supported by the Department of Defense.

Disclaimer

The views expressed in this article are those of the authors and do not reflect the official policy or position of the United States Air Force, Department of Defense, or US Government.

References

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

All presented data can be reproduced with the publicly available codes at Matlab Central's File Exchange [24] or on Github for Python or Julia implementations (see [25] or [26]).


Articles from Proceedings. Mathematical, Physical, and Engineering Sciences are provided here courtesy of The Royal Society

RESOURCES