Abstract

A collection of algorithms in object-oriented MATLAB is described for numerically computing with smooth functions defined on the unit ball in the Chebfun software. Functions are numerically and adaptively resolved to essentially machine precision by using a three-dimensional analogue of the double Fourier sphere method to form “Ballfun" objects. Operations such as function evaluation, differentiation, integration, fast rotation by an Euler angle, and a Helmholtz solver are designed. Our algorithms are particularly efficient for vector calculus operations, and we describe how to compute the poloidal-toroidal and Helmholtz--Hodge decompositions of a vector field defined on the ball.

Keywords

  1. functions
  2. spherical
  3. double Fourier sphere method
  4. poloidal-toroidal decomposition
  5. Helmholtz--Hodge decomposition

MSC codes

  1. 65D05

Get full access to this article

View all available purchase options and get full access to this article.

References

1.
G. B. Arfken, Mathematical Methods for Physicists, 3rd ed., Academic Press, Orlando, FL, 1985.
2.
J. L. Aurentz and L. N. Trefethen, Chopping a Chebyshev series, ACM Trans. Math. Software, 43 (2017), pp. 33:1--33:21.
3.
G. Backus, Poloidal and toroidal fields in geomagnetic field modeling, Rev. Geophys., 24 (1986), pp. 75--109.
4.
R. H. Bartels and G. W. Stewart, Solution of the matrix equation $AX+ XB= C$, Commun. ACM, 15 (1972), pp. 820--826.
5.
Z. Battles and L. N. Trefethen, An extension of MATLAB to continuous functions and operators, SIAM J. Sci. Comput., 25 (2004), pp. 1743--1770.
6.
E. R. Benton and K. A. Whaler, Rapid diffusion of the poloidal geomagnetic field through the weakly conducting mantle: A perturbation solution, Geophys. J. Internat., 75 (1983), pp. 77--100.
7.
H. Bhatia, G. Norgard, V. Pascucci, and P.-T. Bremer, The Helmholtz--Hodge decomposition--A survey, IEEE Trans. Visual. Comput. Graph., 19 (2013), pp. 1386--1404.
8.
P. Boronski and L. S. Tuckerman, Poloidal--toroidal decomposition in a finite cylinder. I: Influence matrices for the magnetohydrodynamic equations, J. Comput. Phys., 227 (2007), pp. 1523--1543.
9.
P. Boronski and L. S. Tuckerman, Poloidal--toroidal decomposition in a finite cylinder: II. Discretization, regularization and validation, J. Comput. Phys., 227 (2007), pp. 1544--1566.
10.
J. P. Boyd, The choice of spectral functions on a sphere for boundary and eigenvalue problems: A comparison of Chebyshev, Fourier and associated Legendre expansions, Monthly Weather Rev., 106 (1978), pp. 1184--1191.
11.
R. Bridson, Fluid Simulation for Computer Graphics, AK Peters/CRC Press, Boca Raton, FL, 2015.
12.
K. J. Burns, G. M. Vasil, J. S. Oishi, D. Lecoanet, and B. P. Brown, Dedalus: A flexible framework for numerical simulations with spectral methods, Phys. Rev. Res., 2 (2020), 023068.
13.
H.-B. Cheong, Application of double Fourier series to the shallow-water equations on a sphere, J. Comput. Phys., 165 (2000), pp. 261--287.
14.
A. J. Chorin, A numerical method for solving incompressible viscous flow problems, J. Comput. Phys., 2 (1967), pp. 12--26.
15.
A. J. Chorin, Numerical solution of the Navier--Stokes equations, Math. Comp., 22 (1968), pp. 745--762.
16.
A. J. Chorin, On the convergence of discrete approximations to the Navier--Stokes equations, Math. Comp., 23 (1969), pp. 341--353.
17.
C. Clenshaw, A note on the summation of Chebyshev series, Math. Comp., 9 (1955), pp. 118--120.
18.
J. Coiffier, Fundamentals of Numerical Weather Prediction, Cambridge University Press, Cambridge, UK, 2011.
19.
J. W. Cooley and J. W. Tukey, An algorithm for the machine calculation of complex Fourier series, Math. Comp., 19 (1965), pp. 297--301.
20.
P. A. Davidson, An Introduction to Magnetohydrodynamics, Cambridge University Press, Cambridge, UK, 2002.
21.
T. A. Driscoll, N. Hale, and L. N. Trefethen, Chebfun Guide, Pafnuty Publications, Oxford, UK, 2014, http://www.chebfun.org/docs/guide/.
22.
C. F. Dunkl and Y. Xu, Orthogonal Polynomials of Several Variables, Cambridge University Press, Cambridge, UK, 2014.
23.
N. Flyer and G. B. Wright, A radial basis function method for the shallow water equations on a sphere, Proc. A, 471 (2009), pp. 1--28.
24.
B. Fornberg, A pseudospectral approach for polar and spherical geometries, SIAM J. Sci. Comput., 16 (1995), pp. 1071--1081.
25.
B. Fornberg and D. Merrill, Comparison of finite difference-and pseudospectral methods for convective flow over a sphere, Geophys. Res. Lett., 24 (1997), pp. 3245--3248.
26.
D. Fortunato and A. Townsend, Fast Poisson solvers for spectral methods, IMA J. Numer. Anal., (2019).
27.
H. Gao, M. K. Mandal, G. Guo, and J. Wan, Singular point detection using discrete Hodge Helmholtz decomposition in fingerprint images, in Proceedings of the IEEE International Conference on Acoustics, Speech, and Signal Processing, 2010, pp. 1094--1097.
28.
J. D. Gardiner, A. J. Laub, J. J. Amato, and C. B. Moler, Solution of the Sylvester matrix equation $AXB^T+ CXD^T= E$, ACM Trans. Math. Software, 18 (1992), pp. 223--231.
29.
I. M. Gelfand, R. A. Minlos, and Z. Y. Shapiro, Representations of the Rotation and Lorentz Groups and their Applications, Courier Dover Publications, New York, 2018.
30.
W. M. Gentleman, Implementing Clenshaw--Curtis quadrature, I. Methodology and experience, Commun. ACM, 15 (1972), pp. 337--342.
31.
W. M. Gentleman, Implementing Clenshaw--Curtis quadrature, II. Computing the cosine transformation, Commun. ACM, 15 (1972), pp. 343--346.
32.
G. H. Golub and C. F. Van Loan, Matrix Computations, 3rd ed., Johns Hopkins University Press, Baltimore, MD, 2012.
33.
Q. Guo, M. K. Mandal, G. Liu, and K. M. Kavanagh, Cardiac video analysis using Hodge--Helmholtz field decomposition, Comput. Biol. Med., 36 (2006), pp. 1--20.
34.
B. Hashemi and L. N. Trefethen, Chebfun in three dimensions, SIAM J. Sci. Comput., 39 (2017), pp. C341--C363.
35.
W. Heinrichs, Spectral collocation schemes on the unit disc, J. Comput. Phys., 199 (2004), pp. 66--86.
36.
R. Hollerbach, Magnetohydrodynamic Ekman and Stewartson layers in a rotating spherical shell, Proc. A, 444 (1994), pp. 333--346.
37.
S. Horn and O. Shishkina, Toroidal and poloidal energy in rotating Rayleigh--Bénard convection, J. Fluid Mech., 762 (2015), pp. 232--255.
38.
R. Kerswell, Recent progress in understanding the transition to turbulence in a pipe, Nonlinearity, 18 (2005), R17.
39.
W. Kuang and J. Bloxham, Numerical modeling of magnetohydrodynamic convection in a rapidly rotating spherical shell: Weak and strong field dynamo action, J. Comput. Phys., 153 (1999), pp. 51--81.
40.
W. Lowrie, Fundamentals of Geophysics, Cambridge University Press, Cambridge, UK, 2007.
41.
J. C. Mason and D. C. Handscomb, Chebyshev Polynomials, CRC Press, Boca Raton, FL, 2002.
42.
P. E. Merilees, The pseudospectral approximation applied to the shallow water equations on a sphere, Atmosphere, 11 (1973), pp. 13--20.
43.
S. Olver, G. Goretkin, R. M. Slevinsky, and A. Townsend, Approxfun, 2019, https://github.com/JuliaApproximation/ApproxFun.jl.
44.
S. Olver and A. Townsend, A fast and well-conditioned spectral method, SIAM Rev., 55 (2013), pp. 462--489.
45.
S. A. Orszag, Fourier series on spheres, Monthly Weather Rev., 102 (1974), pp. 56--75.
46.
M. Pharr, W. Jakob, and G. Humphreys, Physically Based Rendering: From Theory to Implementation, Morgan Kaufmann, Cambridge, MA, 2016.
47.
D. Ruiz-Antolin and A. Townsend, A nonuniform fast Fourier transform based on low rank approximation, SIAM J. Sci. Comput., 40 (2018), pp. A529--A547.
48.
E. Serre and J. Pulicani, A three-dimensional pseudospectral method for rotating flows in a cylinder, Comput. Fluids, 30 (2001), pp. 491--519.
49.
R. M. Slevinsky, Fast and backward stable transforms between spherical harmonic expansions and bivariate Fourier series, Appl. Comput. Harmon. Anal., 47 (2019), pp. 585--606.
50.
W. F. Spotz, M. A. Taylor, and P. N. Swarztrauber, Fast shallow-water equation solvers in latitude-longitude coordinates, J. Comput. Phys., 145 (1998), pp. 432--444.
51.
P. N. Swarztrauber, The approximation of vector functions and their derivatives on the sphere, SIAM J. Numer. Anal., 18 (1981), pp. 191--210.
52.
J. Tan and X. Yang, Physically-based fluid animation: A survey, Sci. China Inf. Sci., 52 (2009), pp. 723--740.
53.
A. Townsend and S. Olver, The automatic solution of partial differential equations using a global spectral method, J. Comput. Phys., 299 (2015), pp. 106--123.
54.
A. Townsend and L. N. Trefethen, An extension of Chebfun to two dimensions, SIAM J. Sci. Comput., 35 (2013), pp. C495--C518.
55.
A. Townsend, M. Webb, and S. Olver, Fast polynomial transforms based on Toeplitz and Hankel matrices, Math. Comput., 87 (2018), pp. 1913--1934.
56.
A. Townsend, H. Wilber, and G. B. Wright, Computing with functions in spherical and polar geometries I. The sphere, SIAM J. Sci. Comput., 38 (2016), pp. C403--C425.
57.
L. N. Trefethen, Spectral Methods in MATLAB, SIAM, Philadelphia, PA, 2000.
58.
L. N. Trefethen, Approximation Theory and Approximation Practice, SIAM, Philadelphia, PA, 2013.
59.
G. M. Vasil, D. Lecoanet, K. J. Burns, J. S. Oishi, and B. P. Brown, Tensor calculus in spherical coordinates using Jacobi polynomials. Part-I: Mathematical analysis and derivations, J. Comput. Phys., 3 (2019), 100013.
60.
H. Wilber, A. Townsend, and G. B. Wright, Computing with functions in spherical and polar geometries II. The disk, SIAM J. Sci. Comput., 39 (2017), pp. C238--C262.
61.
G. B. Wright, N. Flyer, and D. A. Yuen, A hybrid radial basis function--pseudospectral method for thermal convection in a 3-D spherical shell, Geochem. Geophys. Geosyst., 11 (2010), Q07003.
62.
G. B. Wright, M. Javed, H. Montanelli, and L. N. Trefethen, Extension of Chebfun to periodic functions, SIAM J. Sci. Comput., 37 (2015), pp. C554--C573.
63.
S. Y. K. Yee, Studies on Fourier series on spheres, Monthly Weather Rev., 108 (1980), pp. 676--678.
64.
K. Zhang and G. Schubert, Magnetohydrodynamics in rapidly rotating spherical systems, Ann. Rev. Fluid Mech., 32 (2000), pp. 409--443.
65.
K.-K. Zhang and F. Busse, Convection driven magnetohydrodynamic dynamos in rotating spherical shells, Geophys. Astrophys. Fluid Dynam., 49 (1989), pp. 97--116.

Information & Authors

Information

Published In

cover image SIAM Journal on Scientific Computing
SIAM Journal on Scientific Computing
Pages: C169 - C191
ISSN (online): 1095-7197

History

Submitted: 1 November 2019
Accepted: 29 June 2020
Published online: 17 August 2020

Keywords

  1. functions
  2. spherical
  3. double Fourier sphere method
  4. poloidal-toroidal decomposition
  5. Helmholtz--Hodge decomposition

MSC codes

  1. 65D05

Authors

Affiliations

Funding Information

National Science Foundation https://doi.org/10.13039/100000001 : 1818757
Engineering and Physical Sciences Research Council https://doi.org/10.13039/501100000266 : EP/L05803/1

Metrics & Citations

Metrics

Citations

If you have the appropriate software installed, you can download article citation data to the citation manager of your choice. Simply select your manager software from the list below and click Download.

Cited By

View Options

View options

PDF

View PDF

Media

Figures

Other

Tables

Share

Share

Copy the content Link

Share with email

Email a colleague

Share on social media