# [aspect-devel] How to grab the radius of every interior sphere made up from cell faces in the domain and some MPI questions

Wolfgang Bangerth bangerth at tamu.edu
Sun Oct 25 09:43:55 PDT 2015

On 10/25/2015 11:32 AM, Ian Rose wrote:
> That is almost what I am describing, but I am also questioning whether it is
> necessary to do the binning in radius. A general multipole expansion is
> already written in terms of an integral over volume. The traditional approach
> of splitting that up into radial slices is nice for a spherical harmonic
> transform, but I do not think it is strictly required. That is to say, the
> formula Wolfgang and Shangxin wrote have pulled the radius out of the
> integral, and we could just keep it in there.

Correct. In general, however, you need to expand the function drho(x,y,z) in
terms of something that takes into account radius and angles, i.e., you have
to have a basis of functions in radial direction as well. Whether you want to
use piecewise constants (i.e., the characteristic functions of spherical
shells) or a polynomial basis in radial direction is a choice one can make.
The generalization of the formula I stated would be to have to compute
integrals of the form

r_{lmi} =
\int \int \int  drho(r,phi,theta) Y_{lm} R_i(r) dtheta dphi dr

where R_i(r) are the basis functions in radial direction.

> The downside of this (as Rene pointed out) is that extra work would be
> required to get the values of the potential at points interior to the domain.
> The radially binned approach has a very natural (if expensive) way to do that.
> But if we are only interested in the potential at the surface and the CMB,
> then this would be enough.

Correct. If you only need it for postprocessing, then it probably doesn't
matter which way you do it because you don't necessarily want to do it in
every time step.

It's a different matter if you want to use this to compute the gravity
potential because you want to compute the gravity vector at every point. In
that case...

> That being said, if we really wanted the internal potential, it would not be
> too expensive to do a basic finite-element Poisson solve for the interior,
> since we have the appropriate boundary conditions after the expansion.

...it would indeed be possibly to think about solving a Poisson equation
instead that gives us the potential as a finite element field that is easily
evaluated at all points.

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth               email:            bangerth at math.tamu.edu
www: http://www.math.tamu.edu/~bangerth/