  We solve Poisson's equation by combining a spectral-element method with a
mapped infinite-element method. We focus on problems in geostatics and
geodynamics, where Earth's gravitational field is determined by Poisson's
equation inside the Earth and Laplace's equation in the rest of space. Spectral
elements are used to capture the internal field, and infinite elements are used
to represent the external field. To solve the weak form of Poisson/Laplace
equation, we use Gauss-Legendre-Lobatto quadrature in spectral elements inside
the domain of interest. Outside the domain, we use Gauss-Radau quadrature in
the infinite direction, and Gauss-Legendre-Lobatto quadrature in the other
directions. We illustrate the efficiency and accuracy of the method by
comparing the gravitational fields of a homogeneous sphere and the Preliminary
Reference Earth Model (PREM) with (semi-)analytical solutions.
