1 Introduction

Gravity is an economic tool for exploring and discovering natural resources (Jacoby and Smilde 2009). In this respect, density is one of the most diagnostic physical properties of a mineral deposit and is also fundamental to oil and gas exploration. To date, density has been one of the most difficult properties to measure and infer.

During the last decade, there has been significant development in gravity survey, particularly with the advent of GPS and gravity gradiometry. In conventional gravity survey, Earth’s gravity acceleration is measured using gravimeter, whereas in gravity gradiometer survey, the gravity gradient or how the gravitational acceleration changes over distance (or in some cases time) is measured.

Recent reviews (LaFehr 1980; Paterson and Reeves 1985; Hansen 2001) document the continuous evolution of instruments, field operations, data-processing techniques, and methods of interpretation. A steady progression in instrumentation (torsion balance, gravimeters based on land or underwater, in boreholes or on board satellites, aircraft or marine vessels, modern versions of absolute gravimeters, and gravity gradiometers) has enabled the acquisition of gravity data in nearly all environments, see, e.g., Nabighian et al. (2005) for a quite recent historical account.

Despite being eclipsed by seismology, it is impressive to realize that about 40 different commercial gravity sensors and gravity gradiometers are available (Chapin 1998) and about 30 different gravity sensor and gravity gradiometers designs have either been proposed or developed. In particular, gravity gradiometry is still used in exploration (Dransfield 2007) and for regional gravity mapping (Jekeli 2006).

Gravity data sets are effectively used to estimate locations and shapes of bodies, embedded in Earth, exhibiting anomalous mass density with respect to a constant reference value (Zhang et al. 2014). More refined Earth models can be obtained by inverting gravity data (Li and Oldenburg 1998; Zhdanov 2002) in conjunction with seismic and electromagnetic induction data (Moorkamp et al. 2011; Aydemir et al. 2014; Roberts et al. 2016).

Recent improvements in gravimeter efficiency and inversion algorithms have increased the possibility of collecting and inverting huge data sets over extended areas in order to derive 3D density models (Kamm et al. 2015). In particular, gravity methods are extensively used in geoid determination (Bajracharya and Sideris 2004) and mineral exploration (Beiki and Pedersen 2010; Martinez et al. 2013; Abtahi et al. 2016).

In conclusion, it is of paramount importance to efficiently evaluate the gravity anomaly associated with a body characterized by complex density distributions since this represents an important task in forward modeling and inversion.

Due to the mathematical complexity of the problem, the gravity anomaly of an irregular body whose density contrast is spatially variable has been first computed by approximating the body as a collection of vertical rectangular parallelepipeds (prisms) in which the density is assumed to be constant.

Numerical computations were first carried out by Talwani et al. (1959) and Bott (1960). Closed form expressions of the gravity anomaly were subsequently derived by Nagy (1966), Banerjee and Das Gupta (1977), Cady (1980), Nagy et al. (2000), Tsoulis (2000b), Jiancheng and Wenbin (2010) and D’Urso (2012), see also Plouff (1975, 1976), Won and Bevis (1987) and Montana et al. (1992) for computer codes. The case of spheroidal shell has been addressed by Johnson and Litehiser (1972). Analytical expressions of the gravity anomaly for prisms have been derived by D’Urso (2016), for a linearly varying density, by Rao (1985, 1986, 1990), Rao et al. (1994), Gallardo-Delgado et al. (2003) for a quadratic density contrast, by García-Abdeslem (1992, 2005), for a cubic density variation with depth. A good collection of earlier references for 3D prisms can be found in Li and Chouteau (1998) who name, among others, a formula contributed by Sorokin (1951).

Non-polynomial density contrast models for 3D bodies have been considered by Cordell (1973), Chai and Hinze (1988), Litinsky (1989), Rao et al. (1990), Chakravarthi et al. (2002), Silva et al. (2006), Chakravarthi and Sundararajan (2007), Chappell and Kusznir (2008) and Zhou (2009b) and, for 2D bodies, by Gendzwill (1970), Murthy and Rao (1979), Pan (1989), Guspí (1990), Ruotoistenmäki (1992), Martín-Atienza and García-Abdeslem (1999), Zhang et al. (2001) and Zhou (2008, 2009a, 2010). For more complicated forms of the density contrast, see, e.g., Cai and Wang (2005) and Mostafa (2008).

Alternatively to the use of prisms, characterized by complicated functions describing density contrast, is the case of polyhedrons endowed with a simple description of density contrast. Analytical formulas for the gravimetric analysis of polyhedra having constant density have been contributed by Paul (1974), Barnett (1976), Strakhov (1978), Okabe (1979), Waldvogel (1979), Golizdra (1981), Strakhov et al. (1986), Götze and Lahmeyer (1988), Pohanka (1988), Murthy et al. (1989), Kwok (1991b), Werner (1994), Holstein and Ketteridge (1996), Petrović (1996), Werner and Scheeres (1997), Li and Chouteau (1998), Tsoulis (2012), D’Urso (2013a, 2014a), Conway (2015) and Werner (2017). Subsequent advancements have been only concerned with a linear density variation (Pohanka 1998; Hansen 1999; Holstein 2003; Hamayun et al. 2009; D’Urso 2014b); actually, handling more complex density functions in conjunction with polyhedral models considerably increases the difficulties of the treatment, especially if analytical solutions are looked for.

For 2D bodies having density contrast depending only on depth, Zhou (2008) converted the original domain integral for gravity anomaly to a Line Integral (LI) by using Stokes theorem. In particular, he derived two types of LIs for computing the gravity anomaly of bodies. In a subsequent paper (Zhou 2009a), the author extended his method to account for density contrast functions which depended not only on depth but also on horizontal or, jointly, on horizontal and vertical directions. The gravity anomaly at observation points different from the origin has been evaluated in Zhou (2010) since, historically, gravity anomaly was computed only at the origin of the reference frame. In the same paper, Zhou dealt with the singularity of the gravity anomaly arising where the observation point is coincident with the vertices of the integration domain, an issue already discussed in Kwok (1991a), for prism-based modeling, and Tsoulis and Petrović (2001) for polyhedra.

The first approach for evaluating the gravity anomaly of bodies characterized by a complicated density contrast, even in the presence of two-dimensional domains, has been either numerical or of semi-analytical nature based on the use of prisms (Murthy and Rao 1979; Rao et al. 1990; Chakravarthi et al. 2002; Chakravarthi and Sundararajan 2007; Zhou 2009b), or with 2D geometrical shapes (Gendzwill 1970; Murthy and Rao 1979; Pan 1989; Guspí 1990; Ruotoistenmäki 1992; Martín-Atienza and García-Abdeslem 1999; Zhang et al. 2001; Zhou 2008, 2009a, 2010). Actually, this last geometrical assumption, which can be used to model domains extending toward infinity in one direction, significantly simplifies the mathematical treatment of the problem.

Nevertheless, starting from the first researches on the subject (Hubbert 1948), all authors have systematically transformed the original domain integrals into integrals of lower dimension in order to simplify the adoption of quadrature rules for the numerical evaluation of the gravity anomaly.

The derivation of analytical expressions for the gravity anomaly of polygonal bodies has been achieved only recently (D’Urso 2015c) by exploiting the generalized Gauss’ theorem first presented in D’Urso (2012, 2013a), and subsequently applied to several problems ranging from geodesy (D’Urso 2014a, b; D’Urso and Trotta 2015b; D’Urso 2016), to geomechanics (D’Urso and Marmo 2009; Sessa and D’Urso 2013; D’Urso and Marmo 2015a), to geophysics (D’Urso and Marmo 2013b), elasticity (Marmo and Rosati 2016; Marmo et al. 2016a, b, 2017; Trotta et al. 2016a, b) and to heat transfer (Rosati and Marmo 2014).

The methodology outlined in D’Urso (2015c) is here generalized in order to derive an analytical expression of the gravity anomaly for polyhedral bodies having density contrast expressed as a polynomial function of arbitrary degree in both the horizontal and vertical directions, an issue recently addressed in Ren et al. (2017). The result is obtained by first reducing the original domain integral to a 2D boundary integral by virtue of the generalized Gauss’ theorem. Remarkably, this also allows one to prove that the boundary integral expression of the gravity anomaly is singularity-free whatever is the position of the observation point with respect to the body.

Being \(\varOmega\) polyhedral, the 2D expression of the gravity anomaly is written as finite sum of 2D integrals extended to the faces of \(\varOmega\). By a further application of the generalized Gauss’ theorem, each face integral is reduced to the sum of 1D integrals extended to the edges of the face. Such 1D integrals are analytically evaluated as products between the position vectors of the end vertices of each edge and scalar coefficients providing the analytical value of integrals of real variable.

Although these last integrals may exhibit a singularity when the projection of the observation point onto a face belongs to an edge, it is proved that such a singularity produces a null contribution of the i-th edge to the general expression of gravity anomaly; hence, one infers that the derived expression is singularity-free.

By exploiting a suitable change of variables, we also derive an enhanced algebraic formula which expresses the gravity anomaly at an arbitrary point P and specializes to the ordinary one when \(P=O\). Remarkably, the enhanced expression of the gravity anomaly has been derived without any modification of the density contrast function since this is still defined in the original reference frame. The enhanced formula has been implemented in a MATLAB code, and its accuracy and robustness has been assessed by numerical comparisons with examples derived from the literature.

2 Gravity Anomaly of Polyhedral Bodies at the Origin O of the Reference Frame

Let us consider a Cartesian reference frame having origin at an arbitrary point O and a polyhedral body \(\varOmega\). We shall assume that the density \(\Delta \rho\) of the body, usually denominated density contrast, is a function of the generic point whose position with respect to O is defined by the vector \({\mathbf {r}}\). The symbol \(\Delta \rho\) emphasizes the fact that the density of \(\varOmega\) is a variation with respect to that of the surrounding medium.

Denoting by G the gravitational constant, we shall first evaluate the gravity anomaly at O; it is defined by

$$\begin{aligned} \Delta {\mathbf {g}}(O)=G\int \limits _{\varOmega }\frac{\Delta \rho ({\mathbf {r}})\,{\mathbf {r}}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}} {\rm d}V \end{aligned}$$
(1)

and the integrand function represents the magnitude of attraction on a unit mass at O arising from the infinitesimal mass \(\Delta {\varvec{\rho }}{\rm d}V\).

We remark that the denomination of gravity anomaly adopted to denote Eq. (1), though not strictly correct, is based on a common practice in the specialized literature. Actually, Eq. (1) is a formula for the gravitational attraction of a mass body and may be approximately seen as the formula for the influence of a mass body on the gravity anomaly since, for small bodies, the effect on gravity is the dominant part of the effect on the gravity anomaly.

An in-depth discussion on this topic is reported in Vaníček et al. (2004) where the interested reader can find an example of how the effect of a mass body on the gravity anomaly can be formulated in a theoretically consistent manner.

The vertical component of the gravity anomaly at O is provided by

$$\begin{aligned} \Delta g_z(O)=G\int \limits _{\varOmega }\frac{\Delta \rho ({\mathbf {r}}){\mathbf {r}}\cdot \mathbf {k}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}} {\rm d}V, \end{aligned}$$
(2)

\(\mathbf {k}\) being the unit vector directed along the vertical axis. The evaluation of \(\Delta g_z\) at an arbitrary point P will be addressed in Sect. 3 since a considerably more elaborate expression is arrived at.

It is usually of interest to dispose of a procedure to actually compute \(\Delta g_z\) since most gravimeters can only measure the vertical component of the gravity field. Nevertheless, the procedure detailed in the paper can be equally applied to all components of (1) and to physical problems governed by the Poisson equation (Blakely 2010).

The computation of the integral in (2) is a hard task since the density contrast function \(\Delta \rho\) does usually have a very complicated expression for the necessity of modeling 3D anomalies of Earth. For simplicity, this can be modeled as an ensemble of 3D anomalies in a layered medium or a sequence of strata with horizontally undulated interfaces, e.g., sedimentary basins and underlying bedrock. In each layer, mass density typically exhibits depth-dependent variations (García-Abdeslem 1992).

However, geological processes of exogenetic (fluvial, coastal, glacial,...) and endogenetic (rock diagenesis, plate tectonics, volcano eruptions, earthquakes,...) nature can induce both horizontal and vertical variations in mass density (Martín-Atienza and García-Abdeslem 1999). Thus, a suitable expression of the density variation can allow for potentially faithful representations of the Earth subsurface with a relatively smaller amount of computations and parameters. Additionally, disposing of analytical expressions of the gravity anomaly associated with complicated expressions \(\Delta \rho\) can be useful for benchmarking numerical approaches.

A quite general expression for \(\Delta \rho\), able to accommodate a large variety of geological formations, is given by a triple polynomial in xy and z, (García-Abdeslem 2005; Zhou 2009b; Ren et al. 2017)

$$\begin{aligned} \Delta \rho ({\mathbf {r}})=\theta (x,y,z)=\sum\limits_{i=0}^{N_x}\sum\limits_{j=0}^{N_y}\sum _{k=0}^{N_z} c_{ijk} x^i y^jz^k \end{aligned}$$
(3)

where \(N_x\), \(N_y\) and \(N_z\) represent the maximum power of the polynomial density variation along x, y and z, respectively. In the sequel, we shall confine the treatment to the case

$$\begin{aligned} {N_x}+{N_y}+{N_z} =3 \end{aligned}$$
(4)

since this will suffice to address the majority of the practical applications and, at the same time, to present our formulation at a degree of generality sufficient to be generalized to the cases \(N_x+N_y+N_z > 3\).

Thus, under the assumption (4), Eq. (3) specializes to

$$\begin{aligned} \theta ({\mathbf {r}}) &= c_{000} + c_{100} x + c_{010} y + c_{001} z \\ &\quad+ c_{200} x^2 + c_{020} y^2 + c_{002} z^2 + c_{110} xy + c_{011} yz + c_{101} xz \\ &\quad+ c_{300} x^3 + c_{030} y^3 + c_{003} z^3 + c_{210} x^2y + c_{021} y^2z + c_{102} xz^2 \\ &\quad + c_{120} xy^2 + c_{012} yz^2 + c_{201} x^2z + c_{111}xyz. \end{aligned}$$
(5)

The scalars \(c_{ijk}\) represent the coefficients of the polynomial law; they can be estimated from the known data points by a least-squares approach (Jacoby and Smilde 2009).

Paralleling the analogous treatment developed in D’Urso (2015c), we first reformulate the general expression (3) of the density contrast by writing

$$\begin{aligned} \theta ({\mathbf {r}}) = \theta _{\mathbf {o}}+ {\mathbf {c}}\cdot {\mathbf {r}}+ {\mathbf {C}}\cdot {\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}} + {{\mathbf{\mathbb{C}}}}\cdot {{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}} \end{aligned}$$
(6)

where \(\theta _{\varvec{ o }}\) is a scalar denoting the density at \({\mathbf {o}}=(0,0,0)\), \({\mathbf {c}}\) is a vector, \({\mathbf {C}}\) and \({\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}\) are symmetric second-order tensors, \({{\mathbf{\mathbb{C}}}}\) and \({{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}}\) are third-order tensors; furthermore, it has been set

$$\begin{aligned} {\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}} = {\mathbf {r}}\otimes {\mathbf {r}}\qquad {{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}} = {\mathbf {r}}\otimes {\mathbf {r}}\otimes {\mathbf {r}}\,. \end{aligned}$$
(7)

The second-order (rank-two) tensor \({\mathbf {r}}\otimes {\mathbf {r}}\) has the following matrix representation

$$\begin{aligned} [{\mathbf {r}}\otimes {\mathbf {r}}]= \left[ \begin{array}{ccc} x^2 &{} xy &{} xz \\ yx &{} y^2 &{} yz \\ zx &{} zy &{} z^2 \end{array}\right] \,, \end{aligned}$$
(8)

so that, being:

$$\begin{aligned} {\mathbf {C}}\cdot ({\mathbf {r}}\otimes {\mathbf {r}})=C_{11}x^2+2C_{12}xy+2C_{13}xz+C_{22}y^2+2C_{23}yz+C_{33}z^2\,, \end{aligned}$$
(9)

a quadratic distribution of density can be assigned by suitably defining the coefficients of the symmetric tensor \({\mathbf {C}}\). Analogously, the third-order tensors \({{\mathbf{\mathbb{C}}}}\) and \({\mathbf {r}}\otimes {\mathbf {r}}\otimes {\mathbf {r}}\) are represented in matrix form as:

(10)

i.e. as vectors of rank-two tensors. Being

$$\begin{aligned} {{{\mathbf{\mathbb{C}}}} \cdot ({\mathbf {r}}\otimes {\mathbf {r}}\otimes {\mathbf {r}})} &= { {{\mathbb {C}}}_{111} x^3 + {{\mathbb {C}}}_{222} y^3 + {{\mathbb {C}}}_{333} z^3} \\&\quad+ {\left( {{\mathbb {C}}}_{112} + {{\mathbb {C}}}_{121}+ {{\mathbb {C}}}_{211}\right) x^2y +\left( {{\mathbb {C}}}_{113} + {{\mathbb {C}}}_{131}+ {{\mathbb {C}}}_{311}\right) x^2z} \\&\quad+ {\left( {{\mathbb {C}}}_{223} + {{\mathbb {C}}}_{232}+ {{\mathbb {C}}}_{322}\right) y^2z+ \left( {{\mathbb {C}}}_{122} + {{\mathbb {C}}}_{221}+ {{\mathbb {C}}}_{212}\right) xy^2 }\\&\quad+ {\left( {{\mathbb {C}}}_{133} + {{\mathbb {C}}}_{331}+ {{\mathbb {C}}}_{313}\right) xz^2+ \left( {{\mathbb {C}}}_{233} + {{\mathbb {C}}}_{332}+ {{\mathbb {C}}}_{323}\right) yz^2} \\&\quad+ {\left( {{\mathbb {C}}}_{123} + {{\mathbb {C}}}_{132}+ {{\mathbb {C}}}_{213}+{{\mathbb {C}}}_{231} + {{\mathbb {C}}}_{312}+ {{\mathbb {C}}}_{321}\right) xyz}\,, \end{aligned}$$
(11)

the representation (3) of the density contrast is recovered from (6) by setting

$$\begin{aligned} \theta _{0} &= c_{000} \quad c_{1} =c_{100} \quad c_{2} = c_{010} \quad c_3=c_{001} \\ C_{11} &= c_{200} \quad C_{22} = c_{020} \quad C_{33} = c_{002} \\ C_{12} &= c_{110}/2 \quad C_{13} = c_{101}/2 \quad C_{23} = c_{011}/2 \end{aligned}$$
(12)

and

(13)

In conclusion, we derive from (2) the following expression of the gravity anomaly

$$\begin{aligned} \Delta g_z({\mathbf {o}}) = G\left[ \theta _{\mathbf {o}}d_{\mathbf {r}}^\varOmega + {\mathbf {c}}\cdot \mathbf {d}_{\mathbf {r}}^\varOmega + {\mathbf {C}}\cdot {\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^\varOmega + {{\mathbf{\mathbb{C}}}}\cdot {{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}}^\varOmega \right] \end{aligned}$$
(14)

where

$$\begin{aligned} d_{\mathbf {r}}^\varOmega =\int \limits _{\varOmega } \frac{{\mathbf {r}}\cdot \mathbf {k}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}{\rm d}V \qquad \mathbf {d}_{\mathbf {r}}^\varOmega =\int \limits _{\varOmega } \frac{({\mathbf {r}}\cdot \mathbf {k}){\mathbf {r}}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}{\rm d}V \end{aligned}$$
(15)

and

$$\begin{aligned} {\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^\varOmega =\int \limits _{\varOmega } \frac{({\mathbf {r}}\cdot \mathbf {k}){\mathbf {r}}\otimes {\mathbf {r}}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}{\rm d}V \qquad {{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}}^\varOmega =\int \limits _{\varOmega } \frac{({\mathbf {r}}\cdot \mathbf {k}){\mathbf {r}}\otimes {\mathbf {r}}\otimes {\mathbf {r}}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}{\rm d}V \,. \end{aligned}$$
(16)

In order to transform the previous domain integrals into boundary integrals, we apply Gauss’ theorem in the generalized form illustrated in D’Urso (2013a, 2014a) so as to correctly take into account the singularity at \({\mathbf {r}}={\mathbf {o}}=(0,0,0)\).

This will be done in the following two subsections, while in the subsequent ones the boundary integrals extended to the faces of \(\varOmega\) will be further reduced to 1D integrals extended to the edges of each face by means of a further application of Gauss’ theorem. These last integrals will be first expressed as a function of the 2D coordinates of the vertices in the reference frame local to each face and then reformulated in terms of the 3D coordinates representing the basic geometric data defining the polyhedron.

2.1 Analytical Expression of the Gravity Anomaly at O in Terms of 2D Integrals

Let us now illustrate a general approach to express the 3D integrals in (14) as 2D integrals extended to the faces constituting the boundary of \(\varOmega\). Generality lies in the fact that, owing to the symmetry of the integrals, application of Gauss’ theorem can be based upon a unique formula. Actually, we are going to prove the result

$$\begin{aligned} \int \limits _{\varOmega } \frac{k_{\mathbf {r}}[\otimes {\mathbf {r}},m]}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}{\rm d}V= \frac{1}{m+1}\int \limits _{\partial \varOmega } \frac{k_{\mathbf {r}}[\otimes {\mathbf {r}},m]({\mathbf {r}}\cdot \mathbf {n})}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}{\rm d}A \quad m=0,1,\ldots \end{aligned}$$
(17)

where \(k_{\mathbf {r}}={\mathbf {r}}\cdot \mathbf {k}\), \(\mathbf {n}\) is the 3D outward unit normal to the boundary \(\partial \varOmega\) of the polyhedral body and \([\otimes {\mathbf {r}},m]\) denotes a rank-m tensor defined by

$$[\otimes {\mathbf{r}},m]=\left\{\begin{array}{lllll} 1 &\quad {\text {if }} \quad m=0 \\ {\mathbf {r}} &\quad {\text {if }}\quad m=1 \\ {\mathbf {r}}\otimes {\mathbf {r}}&\quad {\text {if }}\quad m=2\\ \ldots \ldots \ldots &\quad \ldots \ldots\ldots \ldots \\ \underbrace{{\mathbf {r}}\otimes {\mathbf {r}}\otimes \cdots \otimes {\mathbf {r}}}_{m \,\,\,\mathrm{times}} &\quad {\text {if }}\quad m>2. \end{array} \right.$$
(18)

To fix the ideas, we shall prove the identity (17) for \(m=2\)

$$\begin{aligned} \int \limits _{\varOmega } \frac{k_{\mathbf {r}}{\mathbf {r}}\otimes {\mathbf {r}}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}{\rm d}V = \frac{1}{3}\int \limits _{\partial \varOmega } \frac{k_{\mathbf {r}}({\mathbf {r}}\otimes {\mathbf {r}})({\mathbf {r}}\cdot \mathbf {n})}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}{\rm d}A \end{aligned}$$
(19)

since it allows us to illustrate our approach to a degree of generality sufficient to extend the final result to all integrals in (14) and to the additional ones, not reported in (14), containing tensors of rank superior to three, i.e. tensors of the kind \([\otimes {\mathbf {r}},m]\) where \(m>3\).

Recalling the identity proved in the appendix of D’Urso (2015c)

$$\begin{aligned} {\text {div}}[\psi (\mathbf {a}\otimes \mathbf {b}\otimes {\mathbf {c}})] &= (\mathbf {a}\otimes \mathbf {b}\otimes {\mathbf {c}}){\text {grad}}\,\psi + \psi [({\text {grad}}\,\mathbf {a}){\mathbf {c}}]\otimes \mathbf {b} \\&\quad+\psi \mathbf {a}\otimes [({\text {grad}}\,\mathbf {b}){\mathbf {c}}]+\psi (\mathbf {a}\otimes \mathbf {b}){\text {div}}\,{\mathbf {c}} \end{aligned}$$
(20)

where \(\mathbf {a}\), \(\mathbf {b}\), \({\mathbf {c}}\) (\(\psi\)) are vector (scalar) differentiable fields, we have

$$\begin{aligned} { {\text {div}}\left[k_{\mathbf {r}}({\mathbf {r}}\otimes {\mathbf {r}})\otimes \frac{\mathbf {r}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}\right] } &= { \left[ ({\mathbf {r}}\otimes {\mathbf {r}})\otimes \frac{\mathbf {r}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}\right] {\text {grad}}\,k_{\mathbf {r}}+ k_{\mathbf {r}}\left[ ({{\text {grad}}}\,{\mathbf{r}})\frac{\mathbf{r}}{({\mathbf{r}}\cdot {\mathbf {r}})^{3/2}}\right] \otimes {\mathbf {r}}} \\&\quad+ k_{\mathbf {r}}{\mathbf {r}}\otimes \left[ ({{\text {grad}}}\,{\mathbf {r}})\frac{\mathbf {r}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}\right] + k_{\mathbf {r}}({\mathbf {r}}\otimes {\mathbf {r}}) \,{\text {div}}\,\frac{\mathbf {r}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}\,. \end{aligned}$$
(21)

Applying the further identity proved in the appendix of D’Urso (2015c)

$$\begin{aligned} {\text {grad}}\, (\mathbf {a}\cdot \mathbf {b})= [{\text {grad}}\,\mathbf {a}]^T\mathbf {b}+[{\text {grad}}\,\mathbf {b}]^T \mathbf {a} \end{aligned}$$
(22)

where \((\cdot )^\mathrm{T}\) stands for transpose, one gets

$$\begin{aligned} {\text {grad}}\,k_{\mathbf {r}}={\text {grad}}\,({\mathbf {r}}\cdot \mathbf {k})=({\text {grad}}\,{\mathbf {r}})\mathbf {k}= \mathbf {k} \end{aligned}$$
(23)

since \(\mathbf {k}\) is a constant vector field and \({\text {grad}}\,{\mathbf {r}}=\mathbf {I}\), \(\mathbf {I}\) being the rank-two identity tensor. Substituting the previous relation in (21), one obtains

$$\begin{aligned} { {\text {div}}\left[ k_{\mathbf {r}}({\mathbf {r}}\otimes {\mathbf {r}})\otimes \frac{\mathbf {r}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}\right] } &= { \left[ ({\mathbf {r}}\otimes {\mathbf {r}})\otimes \frac{\mathbf {r}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}\right] \mathbf {k}} + k_{\mathbf {r}}\left[ \frac{\mathbf {r}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}\otimes {\mathbf {r}}+ {\mathbf {r}}\otimes \frac{\mathbf {r}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}} \right] \\&\quad+ { k_{\mathbf {r}}({\mathbf {r}}\otimes {\mathbf {r}}) \,{\text {div}}\,\frac{\mathbf {r}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}} } \\& =\, { 3 k_{\mathbf {r}}\frac{{\mathbf {r}}\otimes {\mathbf {r}}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}} + k_{\mathbf {r}}({\mathbf {r}}\otimes {\mathbf {r}}) \,{\text {div}}\,\frac{\mathbf {r}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}} }\,. \end{aligned}$$
(24)

Finally, integrating the previous identity over \(\varOmega\) yields

$$\begin{aligned} { \int \limits _\varOmega k_{\mathbf {r}}\frac{{\mathbf {r}}\otimes {\mathbf {r}}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}{\rm d}V} = \frac{1}{3}\int \limits _\varOmega {\text {div}}\left[ k_{\mathbf {r}}({\mathbf {r}}\otimes {\mathbf {r}})\otimes \frac{\mathbf {r}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}\right] {\rm d}V - \frac{1}{3}\int \limits _\varOmega k_{\mathbf {r}}({\mathbf {r}}\otimes {\mathbf {r}}) \,{\text {div}}\,\frac{\mathbf {r}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}} {\rm d}V\,. \end{aligned}$$
(25)

The second integral on the right-hand side can be computed by means of the general result (Tang 2006)

$$\begin{aligned} \int \limits _\varOmega \varphi ({\mathbf {r}}){\text {div}}\,\left[ \frac{\mathbf {r}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}\right] {\rm d}V= \left\{ \begin{array}{ccc} 0 &\quad \text{ if } \quad &{} {\mathbf {o}}\not \in \varOmega \\ \alpha _V({\mathbf {o}})\,\varphi ({\mathbf {o}})&{}\quad \text{ if }\quad &{} {\mathbf {o}}\in \varOmega \end{array} \right. \end{aligned}$$
(26)

where \(\varphi\) is a continuous scalar field and the quantity \(\alpha _V\) represents the angular measure, expressed in steradians, of the intersection between \(\varOmega\) and a spherical neighborhood of the singularity point \({\mathbf {r}}={\mathbf {o}}\), see D’Urso (2012, 2013a, 2014a) for additional details.

The previous expression can be extended to arbitrary tensors by applying it to each scalar component of the tensor.

On account of (26), one infers that the second integral on the right-hand side of (25) is the null rank-two tensor \({\mathbf {O}}\) since

$$\begin{aligned} {\int \limits _\varOmega k_{\mathbf {r}}({\mathbf {r}}\otimes {\mathbf {r}}) \,{\text {div}}\,\frac{\mathbf {r}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}} {\rm d}V } =\left\{ \begin{array}{ll} {\mathbf {O}}\quad & {\text {if }} \quad {\mathbf {o}}\not \in \varOmega \\ \\ \left[ k_{\mathbf {r}}{\mathbf {r}}\otimes {\mathbf {r}}\right] _{{\mathbf {r}}={\mathbf {o}}}\alpha _V({\mathbf {o}}) \quad & {\text {if }}\quad {\mathbf {o}}\in \varOmega \,. \end{array} \right. \end{aligned}$$
(27)

However, the expression \([k_{\mathbf {r}}({\mathbf {r}}\otimes {\mathbf {r}})]_{{\mathbf {r}}={\mathbf {o}}}\) amounts to evaluating the quantity \(k_{\mathbf {r}}({\mathbf {r}}\otimes {\mathbf {r}})\) at the singularity point \({\mathbf {r}}={\mathbf {o}}\), which yields trivially the null tensor \({\mathbf {O}}\). Hence, according to (27), the last integral in (25) is always the null tensor, independently from the position of singularity point \({\mathbf {r}}={\mathbf {o}}\) with respect to the domain \(\varOmega\) of integration.

In conclusion, upon application of Gauss’ theorem to the second integral in (25), we finally infer the identity (19). Remarkably, the derivation of this identity has also allowed us to prove that the singularity at \({\mathbf {r}}={\mathbf {o}}\), of the integrand function appearing on the left-hand side of (19), can be actually ignored.

Furthermore, it is not difficult to rephrase the path of reasoning detailed in formulas (2127) so as to prove the more general formula (17). Hence, defining

$$\begin{aligned}&d_{\mathbf {r}}^{\partial \varOmega }=\int \limits _{\partial \varOmega } \frac{({\mathbf {r}}\cdot \mathbf {k})({\mathbf {r}}\cdot \mathbf {n})}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}{\rm d}A \qquad \mathbf {d}_{\mathbf {r}}^{\partial \varOmega }=\int \limits _{\partial \varOmega } \frac{({\mathbf {r}}\cdot \mathbf {k})\,{\mathbf {r}}\,({\mathbf {r}}\cdot \mathbf {n})}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}{\rm d}A \end{aligned}$$
(28)
$$\begin{aligned}&{\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^{\partial \varOmega }=\int \limits _{\partial \varOmega } \frac{({\mathbf {r}}\cdot \mathbf {k})\,{\mathbf {r}}\otimes {\mathbf {r}}\,({\mathbf {r}}\cdot \mathbf {n})}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}{\rm d}A \qquad {{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}}^{\partial \varOmega }=\int \limits _{\partial \varOmega } \frac{({\mathbf {r}}\cdot \mathbf {k})\,{\mathbf {r}}\otimes {\mathbf {r}}\otimes {\mathbf {r}}\,({\mathbf {r}}\cdot \mathbf {n})}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}}{\rm d}A\,, \end{aligned}$$
(29)

one has, recalling definitions (15) and (16)

$$\begin{aligned} d_{\mathbf {r}}^\varOmega =d_{\mathbf {r}}^{\partial \varOmega }\qquad \mathbf {d}_{\mathbf {r}}^\varOmega =\frac{\mathbf {d}_{\mathbf {r}}^{\partial \varOmega }}{2} \qquad {\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^\varOmega =\frac{{\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^{\partial \varOmega }}{3} \qquad {{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}}^\varOmega =\frac{{{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}}^{\partial \varOmega }}{4}\,. \end{aligned}$$
(30)

In conclusion, application of formula (17) allows us to rewrite formula (14) as follows

$$\begin{aligned} \Delta g_z({\mathbf {o}}) = G\left[ \theta _{\mathbf {o}}d_{\mathbf {r}}^{\partial \varOmega }+ \frac{{\mathbf {c}}\cdot \mathbf {d}_{\mathbf {r}}^{\partial \varOmega }}{2} + \frac{{\mathbf {C}}\cdot {\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^{\partial \varOmega }}{3}+ \frac{{{\mathbf{\mathbb{C}}}}\cdot {{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}}^{\partial \varOmega }}{4} \right] \,, \end{aligned}$$
(31)

an expression that will be further elaborated in the next subsection by transforming the 2D integrals (28), (29) into 1D integrals.

2.2 Analytical Expression of the Gravity Anomaly at O in Terms of Face Integrals

In order to derive an expression suitable for programming, we specialize formula (31) to polyhedral domains since this is by far the most general case in the gravity inversion problems.

Fig. 1
figure 1

Polyhedral domain \(\varOmega\) and decomposition of the position vector of a point on a face

For a polyhedral body characterized by \(N_F\) faces, the integrals in (28, 29) can be written as

$$\begin{aligned} d_{\mathbf {r}}^{\partial \varOmega }&= \sum\limits _{i=1}^{N_F}\int \limits _{F_i} \frac{({\mathbf {r}}_i\cdot \mathbf {k})({\mathbf {r}}_i\cdot \mathbf {n}_i)}{({\mathbf {r}}_i\cdot {\mathbf {r}}_i)^{3/2}}{\rm d}A_i =\sum\limits _{i=1}^{N_F}d_i\int \limits _{F_i} \frac{{\mathbf {r}}_i\cdot \mathbf {k}}{({\mathbf {r}}_i\cdot {\mathbf {r}}_i)^{3/2}}{\rm d}A_i \\ \mathbf {d}_{\mathbf {r}}^{\partial \varOmega }&= \sum \limits _{i=1}^{N_F}\int \limits _{F_i} \frac{({\mathbf {r}}_i\cdot \mathbf {k})\,{\mathbf {r}}_i\,({\mathbf {r}}_i\cdot \mathbf {n}_i)}{({\mathbf {r}}_i\cdot {\mathbf {r}}_i)^{3/2}}{\rm d}A_i =\sum\limits _{i=1}^{N_F}d_i\int \limits _{F_i} \frac{({\mathbf {r}}_i\cdot \mathbf {k}){\mathbf {r}}_i}{({\mathbf {r}}_i\cdot {\mathbf {r}}_i)^{3/2}}{\rm d}A_i\\ {\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^{\partial \varOmega }&= \sum\limits _{i=1}^{N_F}\int \limits _{F_i} \frac{({\mathbf {r}}_i\cdot \mathbf {k})\,({\mathbf {r}}_i\otimes {\mathbf {r}}_i)\,({\mathbf {r}}_i\cdot \mathbf {n}_i)}{({\mathbf {r}}_i\cdot {\mathbf {r}}_i)^{3/2}}{\rm d}A_i =\sum\limits _{i=1}^{N_F}d_i\int \limits _{F_i} \frac{({\mathbf {r}}_i\cdot \mathbf {k})\,{\mathbf {r}}_i\otimes {\mathbf {r}}_i}{({\mathbf {r}}_i\cdot {\mathbf {r}}_i)^{3/2}}{\rm d}A_i \\ {{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}}^{\partial \varOmega }&= \sum\limits _{i=1}^{N_F}\int \limits _{F_i} \frac{({\mathbf {r}}_i\cdot \mathbf {k})\,({\mathbf {r}}_i\otimes {\mathbf {r}}_i\otimes {\mathbf {r}}_i)\,({\mathbf {r}}_i\cdot \mathbf {n}_i)}{({\mathbf {r}}_i\cdot {\mathbf {r}}_i)^{3/2}}{\rm d}A_i =\sum\limits _{i=1}^{N_F}d_i\int \limits _{F_i} \frac{({\mathbf {r}}_i\cdot \mathbf {k})\,{\mathbf {r}}_i\otimes {\mathbf {r}}_i\otimes {\mathbf {r}}_i }{({\mathbf {r}}_i\cdot {\mathbf {r}}_i)^{3/2}}{\rm d}A_i \end{aligned}$$
(32)

where the second equality in each formula above stems from the fact that the vector \({\mathbf {r}}_i\) spanning the i-th face, see, e.g., Fig. 1, can be decomposed as follows

$$\begin{aligned} {\mathbf {r}}_i={\mathbf {r}}_i^\perp +{\mathbf {r}}_i^\parallel \,, \end{aligned}$$
(33)

i.e. as sum of a vector \({\mathbf {r}}_i^\perp\) orthogonal to \(F_i\) and a vector \({\mathbf {r}}_i^\parallel\) parallel to the face. Accordingly, denoting by \(\mathbf {n}_i\) the unit vector pointing outwards \(\varOmega\), one can set \({\mathbf {r}}_i\cdot \mathbf {n}_i={\mathbf {r}}_i^\perp \cdot \mathbf {n}_i=d_i\), since \(d_i\) represents the signed distance between the origin and the i-th face \(F_i\) measured orthogonally to this last one.

The 2D integrals above can be transformed to a line integral by a further application of Gauss’ theorem. To this end, we denote by \(O_i\) the orthogonal projection on \(F_i\) of the observation point O and assume \(O_i\) as origin of a 2D reference frame local to the face.

Furthermore, we express formula (33) in the alternative form

$$\begin{aligned} {\mathbf {r}}_i={\mathbf {r}}_i^\perp +{\mathbf {r}}_i^\parallel =({\mathbf {r}}_i\cdot \mathbf {n}_i)\mathbf {n}_i+{\mathbf {r}}_i^\parallel =d_i\mathbf {n}_i+\mathbf {T}_{F_i}{\varvec{\rho }}_i \end{aligned}$$
(34)

where the vector \({\varvec{\rho }}_i=(\xi _i,\eta _i)\) represents the position vector of a generic point of the i-th face with respect to \(O_i\) and

$$\begin{aligned} \mathbf {T}_{F_i}= \left[ \begin{array}{cc} \mathbf {u}_{i1}&{}\mathbf {v}_{i1}\\ \mathbf {u}_{i2}&{}\mathbf {v}_{i2}\\ \mathbf {u}_{i3}&{}\mathbf {v}_{i3} \end{array} \right] \end{aligned}$$
(35)

is the linear operator mapping the 2D vector \({\varvec{\rho }}_i\) to the 3D one \({\mathbf {r}}_i^\parallel\). In turn, \(\mathbf {u}_i\) and \(\mathbf {v}_i\) represent two distinct, yet arbitrary, 3D unit vectors parallel to \(F_i\).

We emphasize the use of Roman and Greek letters in (34) to denote, respectively, 3D and 2D vectors. The same notational distinction will be adopted throughout the paper.

Setting

$$\begin{aligned} {\mathbf {r}}_i\cdot \mathbf {k}= d_i\mathbf {n}_i\cdot \mathbf {k}+ \mathbf {T}_{F_i} {\varvec{\rho }}_i\cdot \mathbf {k}= d_i n_{i3} + {\varvec{\rho }}_i\cdot \mathbf {T}_{F_i}^T \mathbf {k}= d_i n_{i3}+ {\varvec{\rho }}_i\cdot {\varvec{\kappa }}_i, \end{aligned}$$
(36)

the first two integrals in (32) become

$$\begin{aligned} d_{\mathbf {r}}^{\partial \varOmega } &= \sum _{i=1}^{N_F}d_i \left\{ d_i n_{i3}\int \limits _{F_i} \frac{{\rm d}A_i }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} + {\varvec{\kappa }}_i\cdot \int \limits _{F_i} \frac{{\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i\right\} \\ \end{aligned}$$
(37)
$$\begin{aligned} \mathbf {d}_{\mathbf {r}}^{\partial \varOmega } & = \sum _{i=1}^{N_F}d_i \left\{ d_i^2 n_{i3} \mathbf {n}_i\int \limits _{F_i} \frac{{\rm d}A_i }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} + d_i n_{i3}\int \limits _{F_i} \frac{\mathbf {T}_{F_i}{\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i\right. \\&\left. +\,d_i \mathbf {n}_i\left[ \int \limits _{F_i} \frac{{\varvec{\rho }}_i {\rm d}A_i }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}\cdot {\varvec{\kappa }}_i\right] +\int \limits _{F_i} \frac{\mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes {\varvec{\rho }}_i {\rm d}A_i }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\varvec{\kappa }}_i\right\} \,. \end{aligned}$$
(38)

Thus, defining

$$\begin{aligned} \varphi _{F_i}=\int \limits _{F_i} \frac{{\rm d}A_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} \quad {\varvec{\varphi }}_{F_i}=\int \limits _{F_i} \frac{{\varvec{\rho }}_i {\rm d}A_i }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}\quad {\mathbf \Phi }_{F_i}=\int \limits _{F_i} \frac{{\varvec{\rho }}_i \otimes {\varvec{\rho }}_i {\rm d}A_i }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}\,, \end{aligned}$$
(39)

one finally has

$$\begin{aligned} d_{\mathbf {r}}^{\partial \varOmega }= \sum\limits _{i=1}^{N_F}d_i \left\{ d_i n_{i3}\varphi _{F_i} + {\varvec{\kappa }}_i\cdot {\varvec{\varphi }}_{F_i}\right\} \end{aligned}$$
(40)

and

$$\begin{aligned} \mathbf {d}_{\mathbf {r}}^{\partial \varOmega }= \sum _{i=1}^{N_F}d_i \left\{ d_i^2 n_{i3}\varphi _{F_i}\mathbf {n}_i +d_i n_{i3}\mathbf {T}_{F_i}{\varvec{\varphi }}_{F_i}+ d_i \mathbf {n}_i \left( {\varvec{\kappa }}_i \cdot {\varvec{\varphi }}_{F_i}\right) + \mathbf {T}_{F_i} {\mathbf \Phi }_{F_i}{\varvec{\kappa }}_i\right\} \,. \end{aligned}$$
(41)

To suitably shorten the expression of the last two integrals in (32) we set

$$\begin{aligned}& {\mathfrak {C}}_{F_i}= \int \limits _{F_i} \frac{{\varvec{\rho }}_i \otimes {\varvec{\rho }}_i \otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i\qquad {\mathfrak {D}}_{F_i}= \int \limits _{F_i} \frac{{\varvec{\rho }}_i \otimes {\varvec{\rho }}_i \otimes {\varvec{\rho }}_i \otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i \end{aligned}$$
(42)
$$\begin{aligned}&\begin{array}{rl} {\mathfrak {C}}_{F_i}{\varvec{\kappa }}_{i} =\int \limits _{F_i} \frac{({\varvec{\rho }}_i\cdot {\varvec{\kappa }}_i){\varvec{\rho }}_i\otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\rm d}A_i \qquad {\mathfrak {D}}_{F_i}{\varvec{\kappa }}_i= \int \limits _{F_i} \frac{({\varvec{\rho }}_i\cdot {\varvec{\kappa }}_i){\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i{\rm d}A_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} \end{array} \end{aligned}$$
(43)

and introduce the formal operator \({{\mathbf{\mathbb{T}}}}_{F_i}^{b...b}\) where the symbol b...b denotes an arbitrary sequence of 0 and 1. In particular

$$\begin{aligned}&{{\mathbf{\mathbb{T}}}}_{F_i}^{11} {\mathbf \Phi }_{F_i}= {{\mathbf{\mathbb{T}}}}_{F_i}^{11} \int \limits _{F_i}\frac{{\varvec{\rho }}_i \otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i= \int \limits _{F_i}\frac{\mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i= \mathbf {T}_{F_i}{\mathbf \Phi }_{F_i}\mathbf {T}_{F_i}^T\,, \end{aligned}$$
(44)
$$\begin{aligned}&{{\mathbf{\mathbb{T}}}}_{F_i}^{111} {\mathfrak {C}}_{F_i}= {{\mathbf{\mathbb{T}}}}_{F_i}^{111} \int \limits _{F_i} \frac{{\varvec{\rho }}_i \otimes {\varvec{\rho }}_i \otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i= \int \limits _{F_i} \frac{\mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes \mathbf {T}_{F_i} {\varvec{\rho }}_i \otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i \end{aligned}$$
(45)

and

$$\begin{aligned} {{\mathbf{\mathbb{T}}}}_{F_i}^{1010} {\mathfrak {D}}_{F_i}= {{\mathbf{\mathbb{T}}}}_{F_i}^{1010} \int \limits _{F_i} \frac{{\varvec{\rho }}_i \otimes {\varvec{\rho }}_i \otimes {\varvec{\rho }}_i \otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i= \int \limits _{F_i} \frac{\mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes {\varvec{\rho }}_i \otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i \end{aligned}$$
(46)

since the suffix 1 (0) of \({{\mathbf{\mathbb{T}}}}_{F_i}\) indicates that the operator \(\mathbf {T}_{F_i}\) has (not) to be applied to the vector \({\varvec{\rho }}_i\).

Accordingly, the third integral in (32) becomes

$$\begin{aligned} {\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^{\partial \varOmega } &= \sum _{i=1}^{N_F}d_i \left\{ d_in_{i3}\left[ d_i^2 \varphi _{F_i}\mathbf {n}_i\otimes \mathbf {n}_i +d_i \left( \mathbf {n}_i\otimes \mathbf {T}_{F_i}{\varvec{\varphi }}_{F_i}+ \mathbf {T}_{F_i}{\varvec{\varphi }}_{F_i} \otimes \mathbf {n}_i\right) + \mathbf {T}_{F_i}{\mathbf \Phi }_{F_i} \mathbf {T}_{F_i}^T\right] \right. \\&\left. +d_i^2 \mathbf {n}_i\otimes \mathbf {n}_i\left( {\varvec{\kappa }}_i\cdot {\varvec{\varphi }}_{F_i}\right) +d_i\left[ \mathbf {n}_i\otimes \mathbf {T}_{F_i}\left( {\mathbf \Phi }_{F_i} {\varvec{\kappa }}_i\right) + \mathbf {T}_{F_i}\left( {\mathbf \Phi }_{F_i} {\varvec{\kappa }}_i\right) \otimes \mathbf {n}_i \right] +\mathbf {H}_{i} \right\} \end{aligned}$$
(47)

where

$$\begin{aligned} \mathbf {H}_i= \mathbf {T}_{F_i} \left( {\mathfrak {C}}_{F_i}{\varvec{\kappa }}_i\right) \mathbf {T}_{F_i}^T. \end{aligned}$$
(48)

Furthermore, setting

$$\begin{aligned} \begin{array}{ll} &{} {\mathbf \Phi }_{F_i} \wedge \mathbf {n}_i=\int \limits _{F_i} \frac{{\varvec{\rho }}_i \otimes \mathbf {n}_i\otimes {\varvec{\rho }}_i }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i\qquad {\mathbf \Phi }_{F_i}\wedge \left( \mathbf {n}_i\otimes \mathbf {n}_i\right) =\int \limits _{F_i} \frac{{\varvec{\rho }}_i \otimes \mathbf {n}_i\otimes \mathbf {n}_i\otimes {\varvec{\rho }}_i }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i\\ \\ &{} {\mathfrak {C}}_{F_i}\wedge \mathbf {n}_i =\int \limits _{F_i} \frac{{\varvec{\rho }}_i \otimes \mathbf {n}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i\qquad {\mathfrak {C}}_{F_i}\vee \mathbf {n}_i =\int \limits _{F_i} \frac{{\varvec{\rho }}_i \otimes {\varvec{\rho }}_i \otimes \mathbf {n}_i\otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i\,, \end{array} \end{aligned}$$
(49)

it turns out to be

$$\begin{aligned} {{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}}^{\partial \varOmega } &= \sum _{i=1}^{N_F}d_i \left\{ d_in_{i3}\left[ d_i^3\varphi _{F_i}\mathbf {n}_i\otimes \mathbf {n}_i\otimes \mathbf {n}_i +d_i^2 \left( \mathbf {n}_i\otimes \mathbf {n}_i\otimes \mathbf {T}_{F_i}{\varvec{\varphi }}_{F_i}+\mathbf {n}_i\otimes \mathbf {T}_{F_i}{\varvec{\varphi }}_{F_i}\otimes \mathbf {n}_i \right. \right. \right. \\&\left. + {\mathbf {T}}_{F_i}{\varvec{\varphi }}_{F_i} \otimes \mathbf {n}_i\otimes \mathbf {n}_i\right) + d_i \mathbf {n}_i\otimes {\mathbf{\mathbb{T}}}_{F_i}^{11} {\mathbf \Phi }_{F_i} +d_i {\mathbf{\mathbb{T}}}_{F_i}^{101}\left( {\mathbf \Phi }_{F_i}\wedge \mathbf {n}_i\right) \\&\left. + d_i {\mathbf{\mathbb{T}}}_{F_i}^{11}{\mathbf \Phi }_{F_i}\otimes \mathbf {n}_i+{\mathbf{\mathbb{T}}}_{F_i}^{111}{\mathfrak {C}}_{F_i}\right] +d_i^3 \mathbf {n}_i\otimes \mathbf {n}_i\otimes \mathbf {n}_i \left( {\varvec{\kappa }}_i\cdot {\varvec{\varphi }}_{F_i}\right) \\& +d_i^2\left[ \mathbf {n}_i\otimes \mathbf {n}_i\otimes \mathbf {T}_{F_i}\left( {\mathbf \Phi }_{F_i}{\varvec{\kappa }}_i\right) +\mathbf {n}_i \otimes {\mathbf{\mathbb{T}}}_{F_i}^{101} \left( {\mathbf \Phi }_{F_i}\wedge \mathbf {n}_i\right) {\varvec{\kappa }}_i\right. \\&\left. + {\mathbf{\mathbb{T}}}_{F_i}^{1000}{\mathbf \Phi }_{F_i} \wedge \left( \mathbf {n}_i\otimes \mathbf {n}_i\right) {\varvec{\kappa }}_i\right] +d_i\left[ \mathbf {n}_i\otimes {\mathbf{\mathbb{T}}}_{F_i}^{110}{\mathfrak {C}}_{F_i}{\varvec{\kappa }}_i + {\mathbf{\mathbb{T}}}_{F_i}^{1010} \left( {\mathfrak {C}}_{F_i}\wedge \mathbf {n}_i \right) {\varvec{\kappa }}_i\right. \\&\left.\left. + {\mathbf{\mathbb{T}}}_{F_i}^{1100} \left( {\mathfrak {C}}_{F_i}\vee \mathbf {n}_i\right) {\varvec{\kappa }}_i\right] +{\mathbf{\mathbb{T}}}_{F_i}^{1110}{\mathfrak {D}}_{F_i}{\varvec{\kappa }}_i \right\} \end{aligned}$$
(50)

being

$$\begin{aligned}&{\mathbf{\mathbb{T}}}_{F_i}^{101}\left( {\mathbf \Phi }_{F_i}\wedge \mathbf {n}_i\right) = \int \limits _{F_i} \frac{\mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes \mathbf {n}_i\otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\rm d}A_i\,, \end{aligned}$$
(51)
$$\begin{aligned}&{\mathbf{\mathbb{T}}}_{F_i}^{1000}{\mathbf \Phi }_{F_i} \wedge \left( \mathbf {n}_i\otimes \mathbf {n}_i\right) = \int \limits _{F_i} \frac{\mathbf {T}_{F_i}{\varvec{\rho }}_i\otimes \mathbf {n}_i\otimes \mathbf {n}_i\otimes {\varvec{\rho }}_i {\rm d}A_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\varvec{\kappa }}_i\,, \end{aligned}$$
(52)
$$\begin{aligned}&{\mathbf{\mathbb{T}}}_{F_i}^{110}{\mathfrak {C}}_{F_i}{\varvec{\kappa }}_i=\int \limits _{F_i} \frac{\mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i\otimes {\varvec{\rho }}_i {\rm d}A_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\varvec{\kappa }}_i= \int \limits _{F_i} \frac{({\varvec{\rho }}_i\cdot {\varvec{\kappa }}_i)\mathbf {T}_{F_i}{\varvec{\rho }}_i\otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\rm d}A_i \,, \end{aligned}$$
(53)
$$\begin{aligned}&{\mathbf{\mathbb{T}}}_{F_i}^{1010} \left( {\mathfrak {C}}_{F_i}\wedge \mathbf {n}_i \right) =\int \limits _{F_i} \frac{\mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes \mathbf {n}_i\otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes {\varvec{\rho }}_i {\rm d}A_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}\,, \end{aligned}$$
(54)
$$\begin{aligned}&{\mathbf{\mathbb{T}}}_{F_i}^{1100} \left( {\mathfrak {C}}_{F_i}\vee \mathbf {n}_i\right) =\int \limits _{F_i} \frac{\mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes \mathbf {n}_i\otimes {\varvec{\rho }}_i{\rm d}A_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}\,, \end{aligned}$$
(55)
$$\begin{aligned}&{\mathbf{\mathbb{T}}}_{F_i}^{1110}{\mathfrak {D}}_{F_i}{\varvec{\kappa }}_i=\int \limits _{F_i} \frac{\mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i\otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes {\varvec{\rho }}_i {\rm d}A_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\varvec{\kappa }}_i= \int \limits _{F_i} \frac{({\varvec{\rho }}_i\cdot {\varvec{\kappa }}_i)\mathbf {T}_{F_i}{\varvec{\rho }}_i\otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i\otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\rm d}A_i\,. \end{aligned}$$
(56)

Notice that the symbols in (49), as well as the ones in (50), are purely formal since they involve the tensor product of 2D and 3D vectors. They have been deliberately introduced to focus the reader’s attention on the main issues involved in the evaluation of the quantities \(d_{\mathbf {r}}^{\partial \varOmega }\), \(\mathbf {d}_{\mathbf {r}}^{\partial \varOmega }\), \({\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^{\partial \varOmega }\), and \({{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}}^{\partial \varOmega }\). Actually, one first evaluates the integrals

$$\begin{aligned} \int \limits _{F_i} \frac{[\otimes {\varvec{\rho }}_i,m]}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\rm d}A_i \quad m\in [0,4] \end{aligned}$$
(57)

as a tensor product of 2D vectors, see, e.g., Appendix 1 and 2. Only subsequently the resulting formula is combined with the 2D vector \({\varvec{\kappa }}_i\) and expressed in terms of 3D vectors, by means of the operator \(\mathbf {T}_{F_i}\), or suitably combined with the 3D vector \(\mathbf {n}_i\) to evaluate the integrals in (50).

The simultaneous presence in (57) of the quantity \(d_i\) and of the exponent 3/2 in the denominator makes the evaluation of the integrals in (57) far more diffult than the analogous ones addressed in D’Urso (2015c) for polygonal bodies. Actually the case \(d_i=0\), meaning that the observation point O belongs to the face \(F_i\), or equivalently that \(O_i\equiv O\), needs to be properly addressed since the integrals can become singular.

For the same reason, we shall not consider the fact that the integrals in (57) need to be composed with the vector \({\varvec{\kappa }}_i\) producing

$$\begin{aligned} \left[ \int \limits _{F_i} \frac{[\otimes {\varvec{\rho }}_i,m]}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\rm d}A_i\right] {\varvec{\kappa }}_i = \int \limits _{F_i} \frac{[\otimes {\varvec{\rho }}_i, m-1]({\varvec{\rho }}_i \cdot {\varvec{\kappa }}_i)}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\rm d}A_i \quad m\in [1,4]\,, \end{aligned}$$
(58)

since this would require us to consider separately these cases in the discussion of the singularities of the algebraic expressions resulting from (57); instead, we shall perform the combination after the integration. Moreover, due to the presence of the exponent 3/2, the definite integrals that need to be computed to transform the integrals (57) into their algebraic counterparts do not exhibit anymore the useful recurrence property invoked in the appendix of D’Urso (2015c) so that it is more convenient to evaluate the integrals in (57) prior to their composition with \({\varvec{\kappa }}_i\).

Last, but not least, most of the integrals in (57) have already been computed in D’Urso (2013a, 2014a, b) so that we include in Appendix 1 only the explicit evaluation of the new ones.

2.3 Analytical Expression of Face Integrals in Terms of 1D Integrals

It has been emphasized in the previous subsection that the main burden associated with the evaluation of the expressions (37), (38), (47) and (50) is the evaluation of the integrals (57). Similarly to the integrals (15) and (16), they can be transformed into simpler 1D integrals by a further application of the generalized Gauss’ theorem (Tang 2006).

For some of them, namely the ones in (57) defined by \(m=0\), \(m=1\), and \(m=2\), this has been done in previous papers (D’Urso 2013a, 2014a, b); for \(m=3\) and \(m=4\) this has been carried out in Appendix 1. For the sake of clarity their expressions are collected hereafter for increasing values of m.

  • Integral (57) for \(m=0\)

    $$\begin{aligned} \varphi _{F_i}=\int \limits _{F_i}\frac{{\rm d}A_i}{\left( {\varvec{\rho }}_i\cdot {\varvec{\rho }}_i+d_i^2\right) ^{3/2}}= \frac{\alpha _i}{|d_i|} - \int \limits _{\partial F_i}\frac{{\varvec{\rho }}_i(s_i)\cdot {\varvec{\nu }}(s_i)}{\left[ {\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)\right] \left[ {\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\right] ^{1/2}}{\rm d}s_i\,. \end{aligned}$$
    (59)

    where \(s_i\) is the curvilinear abscissa along the boundary \(\partial F_i\) of the face \(F_i\), \({\varvec{\nu }}\) is the outward unit normal to \(F_i\) and \(\alpha _i\) is a scalar, defined in Appendix 2, representing the measure, expressed in radians, of the intersection between \(F_i\) and a circular neighborhood of the singularity point \({\varvec{\rho }}={\varvec{ o }}\) when \(d_i=0\).

  • Integral (57) for \(m=1\)

    $$\begin{aligned} {\varvec{\varphi }}_{F_i}=\int \limits _{F_i}\frac{{\varvec{\rho }}_i{\rm d}A_i}{\left( {\varvec{\rho }}_i\cdot {\varvec{\rho }}_i+d_i^2\right) ^{3/2}}= - \int \limits _{\partial F_i}\frac{{\varvec{\nu }}(s_i)}{\left[ {\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\right] ^{1/2}}{\rm d}s_i\,. \end{aligned}$$
    (60)
  • Integral (57) for \(m=2\)

    $$\begin{aligned} {\mathbf \Phi }_{F_i}=\int \limits _{F_i}\frac{{\varvec{\rho }}_i\otimes {\varvec{\rho }}_i{\rm d}A_i}{\left( {\varvec{\rho }}_i\cdot {\varvec{\rho }}_i+d_i^2\right) ^{3/2}}= - \int \limits _{\partial F_i}\frac{{\varvec{\rho }}_i(s_i)\otimes {\varvec{\nu }}(s_i)}{\left[ {\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\right] ^{1/2}}{\rm d}s_i + \psi _{F_i}\mathbf {I}_{2{\rm D}} \end{aligned}$$
    (61)

    where \(\mathbf {I}_{2{\rm D}}\) is the rank-two two-dimensional identity tensor,

    $$\begin{aligned} \psi _{F_i}=\int \limits _{F_i}\frac{{\rm d}A_i}{\left( {\varvec{\rho }}_i\cdot {\varvec{\rho }}_i+d_i^2\right) ^{1/2}}= \int \limits _{\partial F_i}\frac{\left[ {\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\right] ^{1/2}\left[ {\varvec{\rho }}_i(s_i)\cdot {\varvec{\nu }}(s_i)\right] }{{\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)} {\rm d}s_i -\alpha _i|d_i| \end{aligned}$$
    (62)

    and \(\alpha _i\) has been introduced just before formula (60).

  • Integral (57) for \(m=3\)

    $$\begin{aligned} {\mathfrak {C}}_{F_i}=\int \limits _{F_i}\frac{{\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i {\rm d}A_i}{\left( {\varvec{\rho }}_i\cdot {\varvec{\rho }}_i+d_i^2\right) ^{3/2}}= - \int \limits _{\partial F_i}\frac{{\varvec{\rho }}_i(s_i)\otimes {\varvec{\rho }}_i(s_i)\otimes {\varvec{\nu }}(s_i)}{\left( {\varvec{\rho }}_i\cdot {\varvec{\rho }}_i+d_i^2\right) ^{1/2}} {\rm d}s_i + \mathbf {I}_{2{\rm D}}\otimes _{23} {\varvec{\psi }}_{F_i} + {\varvec{\psi }}_{F_i} \otimes \mathbf {I}_{2{\rm D}} \end{aligned}$$
    (63)

    where the symbol \(\otimes _{23}\) denotes the tensor product obtained by interchanging the second and third index of the rank-three tensor \(\mathbf {I}_{2{\rm D}}\otimes {\varvec{\psi }}_{F_i}\) and

    $$\begin{aligned} {\varvec{\psi }}_{F_i}=\int \limits _{F_i}\frac{{\varvec{\rho }}_i {\rm d}A_i}{\left( {\varvec{\rho }}_i\cdot {\varvec{\rho }}_i+d_i^2\right) ^{1/2}} = \int \limits _{\partial F_i}\left[ {\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\right] ^{1/2} {\varvec{\nu }}(s_i){\rm d}s_i\,. \end{aligned}$$
    (64)
  • Integral (57) for \(m=4\)

    $$\begin{aligned} {\mathfrak {D}}_{F_i}=\int \limits _{F_i}\frac{{\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i {\rm d}A_i}{\left( {\varvec{\rho }}_i\cdot {\varvec{\rho }}_i+d_i^2\right) ^{3/2}} = & - \int \limits _{\partial F_i}\frac{{\varvec{\rho }}_i(s_i)\otimes {\varvec{\rho }}_i(s_i)\otimes {\varvec{\rho }}_i(s_i)\otimes {\varvec{\nu }}(s_i)}{\left( {\varvec{\rho }}_i\cdot {\varvec{\rho }}_i+d_i^2\right) ^{1/2}} {\rm d}s_i \\ \\ &{} + \mathbf {I}_{2{\rm D}}\otimes _{24} {\varvec{\varPsi }}_{F_i} + {\varvec{\varPsi }}_{F_i} \otimes _{23} \mathbf {I}_{2{\rm D}} +{\varvec{\varPsi }}_{F_i} \otimes \mathbf {I}_{2{\rm D}} \end{aligned}$$
    (65)

    where the symbol \(\otimes _{24}\) denotes the tensor product obtained by interchanging the second and fourth index of the rank-four tensor \(\mathbf {I}_{2{\rm D}}\otimes {\varvec{\varPsi }}_{F_i}\) and

    $$\begin{aligned} {\varvec{\varPsi }}_{F_i}=\int \limits _{F_i}\frac{{\varvec{\rho }}_i\otimes {\varvec{\rho }}_i {\rm d}A_i}{\left( {\varvec{\rho }}_i\cdot {\varvec{\rho }}_i+d_i^2\right) ^{1/2}} = &- \int \limits _{\partial F_i}\left[ {\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\right] ^{1/2} {\varvec{\rho }}_i(s_i)\otimes {\varvec{\nu }}(s_i){\rm d}s_i\\ \\ &- \frac{\mathbf {I}_{2{\rm D}}}{3}\left\{ \int \limits _{\partial F_i}\left[ {\varvec{\rho }}_i(s_i)\cdot {\varvec{\rho }}_i(s_i)+d_i^2\right] ^{1/2}{\varvec{\rho }}_i(s_i)\cdot {\varvec{\nu }}(s_i){\rm d}s_i-d_i^2\psi _{F_i}\right\}. \end{aligned}$$
    (66)

Since each face is polygonal, the previous line integrals can be further expressed as sums extended to the \(N_{E_i}\) edges that define the boundary \(\partial F_i\). For the j-th edge, a suitable parameterization allows one to transform each 1D integral into an integral of a real variable; this is scaled by a suitable combination of the vectors \({\varvec{\rho }}_j\) and \({\varvec{\rho }}_{j+1}\) that define the position vectors of the end vertices of the edge in the 2D reference frame local to \(F_i\).

In particular, we set

$$\begin{aligned} \hat{{\varvec{\rho }}}_i(\lambda _j)={\varvec{\rho }}_j+\lambda _j({\varvec{\rho }}_{j+1}-{\varvec{\rho }}_j)={\varvec{\rho }}_j+\lambda _j\Delta {\varvec{\rho }}_j \end{aligned}$$
(67)

where the function \(\hat{{\varvec{\rho }}_i}\) associates with each value of the dimensionless abscissa

$$\begin{aligned} \lambda _j= s_j/l_j, \end{aligned}$$
(68)

the position vector spanning the j-th edge. The quantity \(s_j\), \(s_j\in [0,\;l_j]\), is the curvilinear abscissa along the j-th edge and \(l_j = |{\varvec{\rho }}_{j+1}-{\varvec{\rho }}_j|\) is the edge length. The position vector spanning the j-th edge of \(F_i\) can also be expressed as a function of \(s_j\) and a new function \({\varvec{\rho }}_i\), fulfilling the condition \({\varvec{\rho }}_i(s_i)=\hat{{\varvec{\rho }}}_i(\lambda _j)\). Hence

$$\begin{aligned} {\varvec{\rho }}_i(s_j)\cdot {\varvec{\rho }}_i(s_j)=\hat{{\varvec{\rho }}}_i(\lambda _j)\cdot \hat{{\varvec{\rho }}}_i(\lambda _j)=p_j\lambda _j^2+2q_j\lambda _j+u_j = P_u(\lambda _j) \end{aligned}$$
(69)

where, according to (67)

$$\begin{aligned} p_j=\Delta {\varvec{\rho }}_j\cdot \Delta {\varvec{\rho }}_j\qquad q_j={\varvec{\rho }}_j\cdot \Delta {\varvec{\rho }}_j\qquad u_j={\varvec{\rho }}_j\cdot {\varvec{\rho }}_j\,. \end{aligned}$$
(70)

Furthermore

$$\begin{aligned} {\varvec{\rho }}(s_j)\cdot {\varvec{\rho }}(s_j)+d_i^2=p_j\lambda _j^2+2q_j\lambda _j+v_j \end{aligned}$$
(71)

where \(v_j=u_j+d_i^2\). We shall also set \(P_v(\lambda _j)=P_u(\lambda _j)+d_i^2\).

2.4 Algebraic Expression of Face Integrals in Terms of 2D Vectors

Referring to Appendices 1 and 2 for further details, we hereby report the algebraic counterparts of the integrals (57) for m= 0,…,4.

  • Integral (57) for \(m=0\)

    $$\begin{aligned} \varphi _{F_i}= \frac{\alpha _i}{|d_i|} - \sum _{j=1}^{N_{E_i}}\left( {\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \right) \int \limits _0^1\frac{d\lambda _j}{P_u(\lambda _j) \left[ P_v(\lambda _j)\right] ^{1/2}} = \frac{\alpha _i}{|d_i|} -\sum _{j=1}^{N_{E_i}} \varphi _j \,\left( {\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \right) \end{aligned}$$
    (72)

    where \(\varphi _j\) is defined in (221). The symbol \((\cdot )^\perp\) denotes a clockwise rotation of the 2D vector \((\cdot )\) necessary to express the outward unit normal \({\varvec{\nu }}_j\) to the j-th edge according to the formula

    $$\begin{aligned} {\varvec{\nu }}_j= \frac{\left( {\varvec{\rho }}_{j+1} - {\varvec{\rho }}_j\right) ^\perp }{l_j} = \frac{\Delta {\varvec{\rho }}_{j}^\perp }{l_j}\,. \end{aligned}$$
    (73)

    The clockwise rotation indicated by the symbol \((\cdot )^\perp\) depends on the convention adopted to circulate along the boundary \(\partial F_i\). In particular, we have assumed that the vertices of each face have been numbered consecutively by circulating along \(\partial F_i\) in a counterclockwise sense with respect to the normal \(\mathbf {n}_i\) to the face. Thus

    $$\begin{aligned} \Delta {\varvec{\rho }}_j=\left[ \begin{array}{c} \Delta \xi _j\\ \Delta \eta _j\end{array}\right] \Rightarrow \Delta {\varvec{\rho }}_j^\perp =\left[ \begin{array}{c} -\Delta \eta _j \\ \Delta \xi _j\end{array}\right] = \left[ \begin{array}{cc} 0&{}-1\\ 1&{}0\end{array}\right] \Delta {\varvec{\rho }}_j\,. \end{aligned}$$
    (74)
  • Integral (57) for \(m=1\)

    $$\begin{aligned} {\varvec{\varphi }}_{F_i}&= \ - \sum\limits _{j=1}^{N_{E_i}}\Delta {\varvec{\rho }}_{j}^\perp \int \limits _0^1\frac{d\lambda _j}{\left[ P_v(\lambda _j)\right] ^{1/2}} = -\sum _{j=1}^{N_{E_i}} I_{0j}\;\Delta {\varvec{\rho }}_{j}^\perp \end{aligned}$$
    (75)

    where the scalar \(I_{0j}\) is defined in (211).

  • Integral (57) for \(m=2\)

    $$\begin{aligned}{\mathbf \Phi }_{F_i} &= -\sum \limits_{j=1}^{N_{E_i}}\int \limits _0^1\frac{\hat{{\varvec{\rho }}}_i(\lambda _j)}{\left[ P_v(\lambda _j)\right] ^{1/2}}d\lambda _j \otimes \Delta {\varvec{\rho }}_{j}^\perp + \psi _{F_i}\mathbf {I}_{2{\rm D}} \\&= \ -\sum _{j=1}^{N_{E_i}}\left[ I_{0j}\;{\varvec{\rho }}_j\otimes \Delta {\varvec{\rho }}_{j}^\perp +I_{1j}\;\Delta {\varvec{\rho }}_j\otimes \Delta {\varvec{\rho }}_{j}^\perp \right] + \psi _{F_i}\mathbf {I}_{2{\rm D}}\end{aligned}$$
    (76)

    where \(I_{0j}\) is defined in (211), \(I_{1j}\) in (212) while \(\psi _{F_i}\) is provided by

    $$\begin{aligned} \psi _{F_i}= \sum _{j=1}^{N_{E_i}}\int \limits _0^1\frac{\left[ P_v(\lambda _j)\right] ^{1/2}}{\left[ P_u(\lambda _j)\right] }d\lambda _j = \sum _{j=1}^{N_{E_i}} \psi _j^i\, \left( {\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \right) -|d_i|\alpha _i \end{aligned}$$
    (77)

    and \(\psi _j^i\) is defined in (219).

  • Integral (57) for \(m=3\)

    $$\begin{aligned} {\mathfrak {C}}_{F_i}&=-\sum \limits_{j=1}^{N_{E_i}}\int \limits _{0}^{1} \frac{\hat{{\varvec{\rho }}}_i(\lambda _j)\otimes \hat{{\varvec{\rho }}}_i(\lambda _j)d\lambda _j}{\left[ P_v(\lambda _j)\right] ^{1/2}}+ \mathbf {I}_{2{\rm D}}\otimes _{23}{\varvec{\psi }}_{F_i} + {\varvec{\psi }}_{F_i}\otimes \mathbf {I}_{2{\rm D}}\\ \\ &{} = -\sum \limits_{j=1}^{N_{E_i}} \left[ I_{0j}\,\mathbf {E}_{{\varvec{\rho }}_j\,{\varvec{\rho }}_j}+ I_{1j}\,\mathbf {E}_{{\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j}+ I_{2j}\,\mathbf {E}_{\Delta {\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j}\right] \otimes \Delta {\varvec{\rho }}_{j}^\perp + \mathbf {I}_{2{\rm D}}\otimes _{23}{\varvec{\psi }}_{F_i} + {\varvec{\psi }}_{F_i}\otimes \mathbf {I}_{2{\rm D}}\end{aligned}$$
    (78)

    where \(I_{0j}\), \(I_{1j}\), \(I_{2j}\) are defined in (211), (212) and (213), respectively, \(\mathbf {E}_{{\varvec{\rho }}_j\,{\varvec{\rho }}_j}\), \(\mathbf {E}_{{\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j}\) and \(\mathbf {E}_{\Delta {\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j}\) are defined in (180) and

    $$\begin{aligned} {\varvec{\psi }}_{F_i}&= \sum _{j=1}^{N_{E_i}}l_j{\varvec{\nu }}_j \int \limits _0^1 \left[ P_v(\lambda _j)\right] ^{1/2}d\lambda _j=\sum _{j=1}^{N_{E_i}}I_{4j}\,\Delta {\varvec{\rho }}_{j}^\perp, \end{aligned}$$
    (79)

    the scalar \(I_{4j}\) being defined in (215).

  • Integral (57) for \(m=4\)

    $$\begin{aligned} {\mathfrak {D}}_{F_i} &= -\sum _{j=1}^{N_{E_i}}\left\{ \int \limits _{0}^{1}\frac{\hat{{\varvec{\rho }}}_i(\lambda _j)\otimes \hat{{\varvec{\rho }}}_i(\lambda _j)\otimes \hat{{\varvec{\rho }}}_i(\lambda _j)d\lambda _j}{\left[ P_v(\lambda _j)\right] ^{1/2}}\otimes \Delta {\varvec{\rho }}_{j}^\perp \right\} + \mathbf {I}_{2{\rm D}}\otimes _{24}{\varvec{\varPsi }}_{F_i} + {\varvec{\varPsi }}_{F_i}\otimes _{23}\mathbf {I}_{2{\rm D}} +{\varvec{\varPsi }}_{F_i}\otimes \mathbf {I}_{2{\rm D}} \\ & = -\sum _{j=1}^{N_{E_i}} \left[ I_{0j}\,{\mathbf{\mathbb{E}}}_{{\varvec{\rho }}_j\,{\varvec{\rho }}_j\,{\varvec{\rho }}_j}+ I_{1j}\,{\mathbf{\mathbb{E}}}_{{\varvec{\rho }}_j\,{\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j}+ {\mathbf{\mathbb{E}}}_{{\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j}+ I_{3j}\,{\mathbf{\mathbb{E}}}_{\Delta {\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j}\right] \otimes \Delta {\varvec{\rho }}_{j}^\perp \\&\quad + \mathbf {I}_{2{\rm D}}\otimes _{24}{\varvec{\varPsi }}_{F_i} + {\varvec{\varPsi }}_{F_i}\otimes _{23}\mathbf {I}_{2{\rm D}} +{\varvec{\varPsi }}_{F_i}\otimes \mathbf {I}_{2{\rm D}} \end{aligned}$$
    (80)

    where \(I_{0j}\), \(I_{1j}\), \(I_{2j}\), \(I_{3j}\) are defined in (211), (212), (213) and (214) respectively, \({\mathbf{\mathbb{E}}}_{{\varvec{\rho }}_j\,{\varvec{\rho }}_j\,{\varvec{\rho }}_j}\), \({\mathbf{\mathbb{E}}}_{{\varvec{\rho }}_j\,{\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j}\), \({\mathbf{\mathbb{E}}}_{{\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j}\) and \({\mathbf{\mathbb{E}}}_{\Delta {\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j}\) are defined in (191), (192) and (193) and

    $$\begin{aligned} {\varvec{\varPsi }}_{F_i} &= \ \sum _{j=1}^{N_{E_i}}\left\{ \left[ \int \limits _0^1\left[ \hat{{\varvec{\rho }}}_i(\lambda _j)\cdot \hat{{\varvec{\rho }}}_i(\lambda _j)+d_i^2\right] ^{1/2} \left( {\varvec{\rho }}_j+ \lambda _j\Delta {\varvec{\rho }}_j\right) d\lambda _j\right] \otimes \Delta {\varvec{\rho }}_{j}^\perp \right. \\&\left.\quad - \frac{\mathbf {I}_{2{\rm D}}}{3} \left( {\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \right) \int \limits _0^1\left[ \hat{{\varvec{\rho }}}_i(\lambda _j)\cdot \hat{{\varvec{\rho }}}_i(\lambda _j)+d_i^2\right] ^{1/2} d\lambda _j\right\} +\frac{d_i^2}{3} \left( \psi _i - |d_i|\alpha _i\right) \\ &= \ \sum _{j=1}^{N_{E_i}}\left[ \left( I_{4j}{\varvec{\rho }}_j+ I_{5j}\Delta {\varvec{\rho }}_j\right) \otimes \Delta {\varvec{\rho }}_{j}^\perp - \frac{\mathbf {I}_{2{\rm D}}}{3} ({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp )I_{4j}\right] +\frac{d_i^2}{3} \left( \psi _i - |d_i|\alpha _i\right) \,, \end{aligned}$$
    (81)

    \(I_{4j}\), \(I_{5j}\), and \(\psi _i\) being defined in (215), (216) and (219), respectively.

    For future reference, we also include the algebraic expressions of the integrals in formula (43).

    $$\begin{aligned} {\mathfrak {C}}_{F_i}{\varvec{\kappa }}_i &= -\sum _{j=1}^{N_{E_i}} \left( {\varvec{\kappa }}_i\cdot \Delta {\varvec{\rho }}_{j}^\perp \right) \left( I_{0j}\,\mathbf {E}_{{\varvec{\rho }}_j\,{\varvec{\rho }}_j}+ I_{1j}\,\mathbf {E}_{{\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j}+ I_{2j}\,\mathbf {E}_{\Delta {\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j}\right) + {\varvec{\kappa }}_i\otimes {\varvec{\psi }}_{F_i} + {\varvec{\psi }}_{F_i}\otimes {\varvec{\kappa }}_i \end{aligned}$$
    (82)
    $$\begin{aligned} {\mathfrak {D}}_{F_i}{\varvec{\kappa }}_i &= -\sum _{j=1}^{N_{E_i}} \left( {\varvec{\kappa }}_i\cdot \Delta {\varvec{\rho }}_{j}^\perp \right) \left( I_{0j}\,{\mathbf{\mathbb{E}}}_{{\varvec{\rho }}_j\,{\varvec{\rho }}_j\,{\varvec{\rho }}_j}+ I_{1j}\,{\mathbf{\mathbb{E}}}_{{\varvec{\rho }}_j\,{\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j}+ I_{2j}\,{\mathbf{\mathbb{E}}}_{{\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j}\right. \\&\left. \quad \quad +\,I_{3j}\,{\mathbf{\mathbb{E}}}_{\Delta {\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j}\right) +{\varvec{\varPsi }}_{F_i}\otimes {\varvec{\kappa }}_i + {\varvec{\varPsi }}_{F_i}\otimes _{23}{\varvec{\kappa }}_i +{\varvec{\kappa }}_i\otimes {\varvec{\varPsi }}_{F_i}\,. \end{aligned}$$
    (83)

All the previous quantities are expressed in terms of 2D vectors representing the coordinates of the end vertices of each edge in the reference frame local to each face \(F_i\). Conversely, all tensors appearing in (37), (38), (47) and (50) have to expressed in terms of the 3D position vectors defining the vertices of the polyhedron \(\varOmega\) since these represent the basic geometric entities that define it. This task will be accomplished in the following subsection.

2.5 Algebraic Expression of the Integrals in Terms of 3D Vectors

The aim of this subsection is to show how the algebraic expressions derived in the previous subsection can be expressed in terms of 3D vectors in order to apply formula (31), which is fully accounted for in the next subsection. This is done by inverting (34) so as to express 2D coordinates of each vertex as a function of the relevant 3D ones. In particular, premultiplying relation (34) by \(\mathbf {T}_{F_i}^\mathrm{T}\), where \((\cdot )^\mathrm{T}\) stands for transpose, one obtains

$$\begin{aligned} {\varvec{\rho }}_j= \mathbf {T}_{F_i}^\mathrm{T} ({\mathbf {r}}_j - d_i \mathbf {n}_i) \end{aligned}$$
(84)

since it is easy to check that \(\mathbf {T}_{F_i}^\mathrm{T}\mathbf {T}_{F_i}=\mathbf {I}_{2{\rm D}}\).

Additional quantities that need to be expressed in terms of 3D vectors are

$$\begin{aligned} \mathbf {T}_{F_i}\Delta {\varvec{\rho }}_j={\mathbf {r}}_{j+1}-{\mathbf {r}}_i=\Delta {\mathbf {r}}_j \end{aligned}$$
(85)

and

$$\begin{aligned} \mathbf {T}_{F_i}\,\Delta {\varvec{\rho }}_{j}^\perp =\mathbf {T}_{F_i}\left[ \mathbf {T}_{F_i}^T\,\Delta {\mathbf {r}}_j\right] ^\perp. \end{aligned}$$
(86)

We also set

$$\begin{aligned} \mathbf {f}_i= \mathbf {T}_{F_i} {\varvec{\varphi }}_{F_i}=-\sum\limits _{j=1}^{N_{E_i}}I_{0j}\mathbf {T}_{F_i}\,\Delta {\varvec{\rho }}_{j}^\perp \end{aligned}$$
(87)

according to (75) and

$$\begin{aligned} {\mathbf {g}}_i= \mathbf {T}_{F_i} {\mathbf \Phi }_{F_i}{\varvec{\kappa }}_i=-\sum\limits _{j=1}^{N_{E_i}} \left( \Delta {\varvec{\rho }}_{j}^\perp \cdot {\varvec{\kappa }}_i\right) \left[ I_{0j} {\mathbf {r}}_j + I_{1j}\,\Delta {\mathbf {r}}_j\right] +\psi _{F_i}\mathbf {T}_{F_i} \mathbf {T}_{F_i}^T\mathbf {k} \end{aligned}$$
(88)

according to (36) and (76); furthermore, we set

$$\begin{aligned} \mathbf {G}_i=\mathbf {T}_{F_i}{\mathbf \Phi }_{F_i}\mathbf {T}_{F_i}^T \end{aligned}$$
(89)

see, e.g., formula (44).

Finally, recalling (44), (46), (48) and (49), it turns out to be

$$\begin{aligned}& {\mathbf{\mathbb{T}}}_{F_i}^{101} \left( {\mathbf \Phi }_{F_i}\wedge \mathbf {n}_i\right) =\int \limits _{F_i} \frac{\mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes \mathbf {n}_i\otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i= \mathbf {G}_i\otimes _{23}\mathbf {n}_i\,, \end{aligned}$$
(90)
$$\begin{aligned}& {\mathbf{\mathbb{T}}}_{F_i}^{110} {\mathbf \Phi }_{F_i}\otimes \mathbf {n}_i=\int \limits _{F_i} \frac{\mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i \otimes \mathbf {n}_i = \mathbf {G}_i\otimes \mathbf {n}_i\,, \end{aligned}$$
(91)
$$\begin{aligned}& {{\mathbf{\mathbb{G}}}}_i ={\mathbf{\mathbb{T}}}_{F_i}^{111} {\mathfrak {C}}_{F_i}=\int \limits _{F_i} \frac{\mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i\otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i\,, \end{aligned}$$
(92)
$$\begin{aligned}&\begin{array}{rl} {\mathbf{\mathbb{T}}}_{F_i}^{101} \left( {\mathbf \Phi }_{F_i}\wedge \mathbf {n}_i\right) {\varvec{\kappa }}_i &= \mathbf {T}_{F_i}\int \limits _{F_i} \frac{\left( {\varvec{\rho }}_i \cdot {\varvec{\kappa }}_i \right) {\varvec{\rho }}_i{\rm d}A_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} \otimes \mathbf {n}_i = \mathbf {T}_{F_i}\int \limits _{F_i} \frac{\left( {\varvec{\rho }}_i \otimes {\varvec{\rho }}_i\right) \, {\rm d}A_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\varvec{\kappa }}_i\otimes \mathbf {n}_i\\ \\ &= \mathbf {T}_{F_i}{\mathbf \Phi }_{F_i}{\varvec{\kappa }}_i\otimes \mathbf {n}_i={\mathbf {g}}_i\otimes \mathbf {n}_i\,, \end{array} \end{aligned}$$
(93)
$$\begin{aligned}&\begin{array}{rl} {\mathbf{\mathbb{T}}}_{F_i}^{100} {\mathbf \Phi }_{F_i}\wedge \left( \mathbf {n}_i\otimes \mathbf {n}_i\right) {\varvec{\kappa }}_i = \int \limits _{F_i} \frac{\mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes \mathbf {n}_i\otimes \mathbf {n}_i\otimes {\varvec{\rho }}_i }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\rm d}A_i {\varvec{\kappa }}_i&= \mathbf {T}_{F_i}\int \limits _{F_i} \frac{\left( {\varvec{\rho }}_i \cdot {\varvec{\kappa }}_i \right) {\varvec{\rho }}_i{\rm d}A_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}\otimes \mathbf {n}_i \otimes \mathbf {n}_i \\ \\ &= \mathbf {T}_{F_i}{\mathbf \Phi }_{F_i}{\varvec{\kappa }}_i\otimes \mathbf {n}_i\otimes \mathbf {n}_i = {\mathbf {g}}_i\otimes \mathbf {n}_i\otimes \mathbf {n}_i \,, \end{array} \end{aligned}$$
(94)
$$\begin{aligned}{\mathbf{\mathbb{T}}}_{F_i}^{110} {\mathfrak {C}}_{F_i}{\varvec{\kappa }}_i &= \int \limits _{F_i} \frac{\mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i\otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i {\varvec{\kappa }}_i= \int \limits _{F_i} \frac{\left( {\varvec{\rho }}_i \cdot {\varvec{\kappa }}_i \right) \left( \mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i\right) }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i \\& =\mathbf {T}_{F_i}\int \limits _{F_i}\frac{\left( {\varvec{\rho }}_i \cdot {\varvec{\kappa }}_i\right) \left( {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\right) }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\rm d}A_i\mathbf {T}_{F_i}^T= \mathbf {T}_{F_i}\left[ \int \limits _{F_i}\frac{\left( {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i\right) {\rm d}A_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\varvec{\kappa }}_i\right] \mathbf {T}_{F_i}^T\\&=\mathbf {T}_{F_i}\left( {\mathfrak {C}}_{F_i}{\varvec{\kappa }}_i\right) \mathbf {T}_{F_i}^T =\mathbf {H}_i, \end{aligned}$$
(95)
$$\begin{aligned} {\mathbf{\mathbb{T}}}_{F_i}^{1010} \left( {\mathfrak {C}}_{F_i}\wedge \mathbf {n}_i\right) {\varvec{\kappa }}_i &= \int \limits _{F_i} \frac{\mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes \mathbf {n}_i \otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i\otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\rm d}A_i {\varvec{\kappa }}_i =\int \limits _{F_i} \frac{\left( {\varvec{\rho }}_i \cdot {\varvec{\kappa }}_i \right) \mathbf {T}_{F_i}{\varvec{\rho }}_i\otimes \mathbf {n}_i\otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\rm d}A_i\\ &= \int \limits _{F_i} \frac{\left( {\varvec{\rho }}_i \cdot {\varvec{\kappa }}_i \right) \mathbf {T}_{F_i}{\varvec{\rho }}_i\otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\rm d}A_i\otimes _{23}\mathbf {n}_i =\mathbf {H}_i\otimes _{23}\mathbf {n}_i, \end{aligned}$$
(96)
$$\begin{aligned}{\mathbf{\mathbb{T}}}_{F_i}^{1100} \left( {\mathfrak {C}}_{F_i}\vee \mathbf {n}_i\right) &= \int \limits _{F_i} \frac{\mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i\otimes \mathbf {n}_i \otimes {\varvec{\rho }}_i }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\rm d}A_i{\varvec{\kappa }}_i = \int \limits _{F_i} \frac{\left( {\varvec{\rho }}_i \cdot {\varvec{\kappa }}_i \right) \mathbf {T}_{F_i}{\varvec{\rho }}_i\otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i\otimes \mathbf {n}_i }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\rm d}A_i\\&= \mathbf {T}_{F_i}\left[ \int \limits _{F_i} \frac{\left( {\varvec{\rho }}_i \cdot {\varvec{\kappa }}_i \right) {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\rm d}A_i\right] \mathbf {T}_{F_i}^T\otimes \mathbf {n}_i= \left[ \mathbf {T}_{F_i}\left( {\mathfrak {C}}_{F_i}{\varvec{\kappa }}_i\right) \mathbf {T}_{F_i}^T \right] \otimes \mathbf {n}_i =\mathbf {H}_i \otimes \mathbf {n}_i, \end{aligned}$$
(97)
$$\begin{aligned}{\mathbf{\mathbb{H}}}_i={\mathbf{\mathbb{T}}}_{F_i}^{1110} {\mathfrak {D}}_{F_i}{\varvec{\kappa }}_i &= \int \limits _{F_i} \frac{(\mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i\otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i\otimes {\varvec{\rho }}_i) }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\rm d}A_i {\varvec{\kappa }}_i \\&=\int \limits _{F_i} \frac{({\varvec{\kappa }}_i\cdot {\varvec{\rho }}_i)\mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i\otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i. \end{aligned}$$
(98)

The explicit evaluation of the last integral will be dealt with in the next subsection together with further considerations on actual evaluation of all third-order tensors appearing in (50).

2.6 Algebraic Expression of the Gravity Anomaly at O

In order to make the reader fully acquainted with the operative steps required to compute the gravity anomaly at O, it is instructive to further comment on the formulas derived in the previous subsections in order to apply formula (31). As a matter of fact, the evaluation of \(d_{\mathbf {r}}^{\partial _i\varOmega }\), \(\mathbf {d}_{\mathbf {r}}^{\partial _i\varOmega }\), \({\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^{\partial _i\varOmega }\), provided by formulas (37), (38) and (47), respectively, is trivial since they can be obtained by standard matrix operations.

More difficult is the evaluation of the third-order tensors appearing in (50), by taking also into account the fact that they have to first expressed in terms of 2D vectors and only subsequently, as specified in the previous subsection, reformulated in terms of 3D vectors.

To fix the ideas, let us start from the last addend in (50) that has been further detailed in (98). By means of formula (83), we actually dispose of an expression that can be written more concisely as

$$\begin{aligned} \int \limits _{F_i}\frac{({\varvec{\kappa }}_i\cdot {\varvec{\rho }}_i){\varvec{\rho }}_i \otimes {\varvec{\rho }}_i\otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}} {\rm d}A_i =\sum _{j=1}^{N_{E_i}} \left[ \alpha _j {\mathbb {D}}_{{\varvec{\rho }}\,{\varvec{\rho }}\,{\varvec{\rho }}}^{(j)}+ {\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}} \otimes {\varvec{\beta }}+ {\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}} \otimes _{23} {\varvec{\beta }}+ {\varvec{\beta }}\otimes {\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}} \right] \end{aligned}$$
(99)

where the right-hand side is a symbolic representation of the linear combination between third-order tensors \({\mathbb {D}}_{{\varvec{\rho }}\,{\varvec{\rho }}\,{\varvec{\rho }}}^{(j)}\), such as \({\mathbb {D}}_{{\varvec{\rho }}_j\,{\varvec{\rho }}_j\,{\varvec{\rho }}_j}\), \({\mathbb {D}}_{{\varvec{\rho }}_j\,{\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j}\), \({\mathbb {D}}_{{\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j}\), \({\mathbb {D}}_{\Delta {\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j\,\Delta {\varvec{\rho }}_j}\), and tensor products between 2D vectors \({\varvec{\beta }}\) and rank-two tensors \({\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}}\), this last one expressed as tensor product of 2D vectors.

Hence, to evaluate the left-hand side of (98) starting from (99) we have to transform the rank-three tensors on the right-hand side of (99) defined in terms of 2D vectors by applying the formal operator \({\mathbf{\mathbb{T}}}_{F_i}^{111}\) to get

$$\begin{aligned} \int \limits _{F_i} \frac{\mathbf {T}_{F_i}{\varvec{\rho }}_i \otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i\otimes \mathbf {T}_{F_i}{\varvec{\rho }}_i\otimes {\varvec{\rho }}_i }{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{3/2}}{\rm d}A_i {\varvec{\kappa }}_i ={\mathbf{\mathbb{T}}}_{F_i}^{111}\sum _{j=1}^{N_{E_i}} \left[ \alpha _j {\mathbb {D}}_{{\varvec{\rho }}\,{\varvec{\rho }}\,{\varvec{\rho }}}^{(j)}+ {\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}} \otimes {\varvec{\beta }}+ {\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}} \otimes _{23} {\varvec{\beta }}+ {\varvec{\beta }}\otimes {\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}} \right] \,. \end{aligned}$$
(100)

This is trivial for the rank-three tensor \({\mathbb {D}}_{{\varvec{\rho }}\,{\varvec{\rho }}\,{\varvec{\rho }}}^{(j)}\) since it is expressed as the tensor product of three 2D vectors \({\varvec{\gamma }}\), \({\varvec{\delta }}\), \({\varvec{\varepsilon }}\), so that

$$\begin{aligned} {\mathbf{\mathbb{T}}}_{F_i}^{111} {\mathbb {D}}_{{\varvec{\rho }}\,{\varvec{\rho }}\,{\varvec{\rho }}}^{(j)}={\mathbf{\mathbb{T}}}_{F_i}^{111} ({\varvec{\gamma }}\otimes {\varvec{\delta }}\otimes {\varvec{\varepsilon }}) = \mathbf {T}_{F_i}{\varvec{\gamma }}\otimes \mathbf {T}_{F_i}{\varvec{\delta }}\otimes \mathbf {T}_{F_i}{\varvec{\varepsilon }}=\mathbf {t}\otimes \mathbf {v}\otimes \mathbf {w} \end{aligned}$$
(101)

and the last tensor product between 3D vectors can be expressed in matrix form according to the rule which one adopts to define the matrix associated with a rank-three tensor, a rule that usually depends upon the adopted programming language.

For instance, extending the rule defined in (10) to three arbitrary 3D vectors one has

(102)

where, for typographical reasons, we have represented the matrix associated with \(\mathbf {t}\otimes (\mathbf {v}\otimes \mathbf {w})\) as a row rather than as a column.

Let us now apply the formal operator \({\mathbf{\mathbb{T}}}_{F_i}^{111}\), already exploited in (101), to the last three addends in (100). Differently from \({\mathbb {D}}_{{\varvec{\rho }}\,{\varvec{\rho }}\,{\varvec{\rho }}}^{(j)}\), that is computed recursively as a function of the j-th edge of \(F_i\), the rank-two tensor \({\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}}\) is already available as a whole since it has been evaluated elsewhere, e.g. in a different subroutine. Hence, we already dispose of

$$\begin{aligned} {\mathbf{\mathbb{T}}}_{F_i}^{11}{\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}}= \mathbf {T}_{F_i} {\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}}\mathbf {T}_{F_i}^T =\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}} \end{aligned}$$
(103)

where the roman letter \(\mathbf {L}\) has been adopted to emphasize that the matrix associated with \(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}}\) is \(3\times 3\). Accordingly

$$\begin{aligned} {\mathbf{\mathbb{T}}}_{F_i}^{111}\left( {\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}}\otimes {\varvec{\beta }}\right) = \mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}}\otimes \mathbf {T}_{F_i}{\varvec{\beta }}= \mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}}\otimes \mathbf {b} \end{aligned}$$
(104)

where \(\mathbf {b}\) is a 3D vector.

Thus, we can exploit the general scheme in (102) by writing

$$\begin{aligned} \left[ \mathbf {L}\otimes \mathbf {b}\right] = \left[ \left( \mathbf {L}\otimes \mathbf {b}\right) _1,\quad \left( \mathbf {L}\otimes \mathbf {b}\right) _2,\quad \left( \mathbf {L}\otimes \mathbf {b}\right) _3 \right] ^{\rm T} \,. \end{aligned}$$
(105)

where

$$\begin{aligned}& \left[ \left( \mathbf {L}\otimes \mathbf {b}\right) _1\right] =\left[ \begin{array}{ccc} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{11}b_1 &{} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{11}b_2 &{} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{11}b_3 \\ \\ (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{12}b_1 &{} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{12}b_2 &{} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{12}b_3 \\ \\ (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{13}b_1 &{} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{13}b_2 &{} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{13}b_3 \end{array}\right] \,, \end{aligned}$$
(106)
$$\begin{aligned}& \left[ \left( \mathbf {L}\otimes \mathbf {b}\right) _2\right] =\left[ \begin{array}{ccc} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{21}b_1 &{} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{21}b_2 &{} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{21}b_3 \\ \\ (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{22}b_1 &{} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{22}b_2 &{} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{22}b_3 \\ \\ (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{23}b_1 &{} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{23}b_2 &{} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{23}b_3 \end{array}\right] \,, \end{aligned}$$
(107)
$$\begin{aligned}& \left[ \left( \mathbf {L}\otimes \mathbf {b}\right) _3\right] =\left[ \begin{array}{ccc} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{31}b_1 &{} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{31}b_2 &{} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{31}b_3 \\ \\ (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{32}b_1 &{} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{32}b_2 &{} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{32}b_3 \\ \\ (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{33}b_1 &{} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{33}b_2 &{} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{33}b_3 \end{array}\right] \,. \end{aligned}$$
(108)

Analogously one has

$$\begin{aligned} {\mathbf{\mathbb{T}}}_{F_i}^{111}\left( {\varvec{\beta }}\otimes {\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}}\right) = \mathbf {T}_{F_i}{\varvec{\beta }}\otimes \mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}}= \mathbf {b}\otimes \mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}} \end{aligned}$$
(109)

so that the associated matrix is

$$\begin{aligned} \left[ \mathbf {b}\otimes \mathbf {L}\right] = \left[ \left( \mathbf {b}\otimes \mathbf {L}\right) _1,\quad \left( \mathbf {b}\otimes \mathbf {L}\right) _2,\quad \left( \mathbf {b}\otimes \mathbf {L}\right) _3 \right] ^{\rm T} \end{aligned}$$
(110)

where

$$\begin{aligned}& \left[ \left( \mathbf {b}\otimes \mathbf {L}\right) _1\right] =\left[ \begin{array}{ccc} b_1 \left( \begin{array}{ccc} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{11}&{}(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{12}&{}(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{13}\\ (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{21}&{}(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{22}&{}(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{23}\\ (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{31}&{}(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{32}&{}(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{33} \end{array}\right) \end{array}\right] \,, \end{aligned}$$
(111)
$$\begin{aligned}& \left[ \left( \mathbf {b}\otimes \mathbf {L}\right) _2\right] =\left[ \begin{array}{ccc} b_2 \left( \begin{array}{ccc} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{11}&{}(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{12}&{}(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{13}\\ (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{21}&{}(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{22}&{}(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{23}\\ (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{31}&{}(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{32}&{}(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{33} \end{array}\right) \end{array}\right] \,, \end{aligned}$$
(112)
$$\begin{aligned}& \left[ \left( \mathbf {b}\otimes \mathbf {L}\right) _3\right] =\left[ \begin{array}{ccc} b_3 \left( \begin{array}{ccc} (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{11}&{}(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{12}&{}(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{13}\\ (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{21}&{}(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{22}&{}(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{23}\\ (\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{31}&{}(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{32}&{}(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{33} \end{array}\right) \end{array}\right] \,. \end{aligned}$$
(113)

A little bit more awkward is how to address the tensor product \({\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}} \otimes _{23} {\varvec{\beta }}\). This case has been deliberately left to last since constructing the matrix associated with the rank-three tensor \({\mathbf{\mathbb{T}}}_{F_i}^{111}\left( {\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}}\otimes _{23} {\varvec{\beta }}\right)\) allows us to solve the problem concerning the tensor in (90).

Actually, if we could split the tensor \({\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}}\) as a tensor product of two 2D vectors in the form \({\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}}={\varvec{\gamma }}\otimes {\varvec{\delta }}\) we would trivially have

$$\begin{aligned} {\mathbf{\mathbb{T}}}_{F_i}^{111}\left( {\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}}\otimes {\varvec{\beta }}\right) = {\mathbf{\mathbb{T}}}_{F_i}^{111}\left( {\varvec{\gamma }}\otimes {\varvec{\delta }}\otimes _{23}{\varvec{\beta }}\right) ={\mathbf{\mathbb{T}}}_{F_i}^{111}\left( {\varvec{\gamma }}\otimes {\varvec{\beta }}\otimes {\varvec{\delta }}\right) = \mathbf {t}\otimes \mathbf {b}\otimes \mathbf {v} \end{aligned}$$
(114)

and exploit the general scheme in (102) to construct the relevant matrix. Unfortunately, we directly dispose of the matrix \(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}}\) whose entries have to appear as first and third entries in the previous, purely illustrative, scheme.

This does not represent a real problem since, coherently with the matrix representation (102), we can define the matrix associated with

$$\begin{aligned} {\mathbf{\mathbb{T}}}_{F_i}^{111}\left( {\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}}\otimes _{23}{\varvec{\beta }}\right) =\mathbf {L}_{{\mathbf {r}}\mathbf {b}{\mathbf {r}}} \end{aligned}$$
(115)

as

$$\begin{aligned} \left[ \mathbf {L}_{{\mathbf {r}}\mathbf {b}{\mathbf {r}}}\right] = \left[ \left( {\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}}\otimes _{23}{\varvec{\beta }}\right) _1, \quad \left( {\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}}\otimes _{23}{\varvec{\beta }}\right) _2 , \quad \left( {\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}}\otimes _{23}{\varvec{\beta }}\right) _3 \right] ^{\rm T} \end{aligned}$$
(116)

where

$$\begin{aligned}& \left[ \left( {\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}}\otimes _{23}{\varvec{\beta }}\right) _1\right] = \left[ \begin{array}{ccc} b_1(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{11} &{} b_1(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{12} &{} b_1(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{13} \\ \\ b_2(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{11} &{} b_2(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{12} &{} b_2(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{13} \\ \\ b_3(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{11} &{} b_3(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{12} &{} b_3(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{13} \end{array}\right] \,, \end{aligned}$$
(117)
$$\begin{aligned}& \left[ \left( {\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}}\otimes _{23}{\varvec{\beta }}\right) _2\right] = \left[ \begin{array}{ccc} b_1(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{21} &{} b_1(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{22} &{} b_1(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{23} \\ \\ b_2(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{21} &{} b_2(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{22} &{} b_2(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{23} \\ \\ b_3(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{21} &{} b_3(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{22} &{} b_3(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{23} \end{array}\right] \,, \end{aligned}$$
(118)
$$\begin{aligned}& \left[ \left( {\varvec{\varLambda }}_{{\varvec{\rho }}{\varvec{\rho }}}\otimes _{23}{\varvec{\beta }}\right) _3\right] = \left[ \begin{array}{ccc} b_1(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{31} &{} b_1(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{32} &{} b_1(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{33} \\ \\ b_2(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{31} &{} b_2(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{32} &{} b_2(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{33} \\ \\ b_3(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{31} &{} b_3(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{32} &{} b_3(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}})_{33} \end{array}\right] \,, \end{aligned}$$
(119)

and \(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}}\) is obtained from (103) and \(\mathbf {b}= \mathbf {T}_{F_i}{\varvec{\beta }}\).

Remarkably, the same notational scheme as in the previous formula can be exploited for the tensor in (90) since \(\mathbf {G}_i\) can be obtained from (44) by standard matrix operations.

Furthermore, setting \({\mathbf{\mathbb{M}}}=\mathbf {G}_i\otimes _{23} \mathbf {n}_i\), the matrix \([{\mathbf{\mathbb{M}}}]\) can be obtained analogously to (116). Stated equivalently, to construct the matrix associated with the rank-three tensor \({\mathbf{\mathbb{M}}}\), one has to first evaluate \({\mathbf \Phi }_{F_i}\), transform it as in (44) to get \(\mathbf {G}_i\), and exploit the notational scheme (116) by replacing \(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}}\) with \(\mathbf {G}_i\).

The notational schemes detailed in (101, 102), (104, 105), (109, 110) and (115, 116) can be suitably exploited to evaluate the tensors in (9197) and, hence, the tensor \({{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}}^{\partial \varOmega }\) in (50). Namely, the tensors \(\mathbf {G}_i\otimes \mathbf {n}_i\) in (91) and \(\mathbf {H}_i\otimes \mathbf {n}_i\) in (97) can be evaluated by applying the scheme (105), the tensor \({{\mathbf{\mathbb{G}}}}_i\) in (92) by applying the scheme (101, 102) and the tensor \(\mathbf {H}_i\otimes _{23}\mathbf {n}_i\) in (96) by applying the scheme (115, 116). Finally, the tensors in (93) and (95) are rank-two tensors and the tensor in (94) can be evaluated as in (102).

3 Gravity Anomaly of Polyhedral Bodies at an Arbitrary Point P

In the previous sections, it has been assumed that the observation point P would coincide with the origin of the reference frame in which the anomalous density of a body is assigned. This has allowed us to set the stage and to define the most problematic issues to address, from both the analytical and numerical point of view.

Fig. 2
figure 2

Representation of geometric quantities used to assign density contrast (\(\mathbf {s}\)) and define the position of \(\varOmega\) with respect to an arbitrary point P

However, when gravity measures are carried out at several points and/or when multiple bodies are taken into account it is by far more convenient to fix an arbitrary reference frame in which both the coordinates of each observation point and the density of all bodies are simultaneously assigned.

To suitably extend the formulas contributed in the previous section, one can exploit a coordinate transformation (Zhou 2010) by translating the origin of the reference frame to the observation point and modifying in accordance the expression of the density contrast by expressing the coefficients of the polynomial law in the new reference frame.

Alternatively, one can follow the approach outlined in D’Urso (2015c) and define the position vector \({\mathbf {r}}\) entering the definition of the gravity anomaly as follows

$$\begin{aligned} {\mathbf {r}}=\mathbf {s}-\mathbf {p} \end{aligned}$$
(120)

where \(\mathbf {p}\) is the position vector of the observation point and \(\mathbf {s}\) is the position vector of an arbitrary point belonging to \(\varOmega\), see, e.g., Fig. 2. In this way, we can leave the expression (6) unchanged by writing

$$\begin{aligned} \Delta \rho (\mathbf {s}) = \theta (x,y,z)= \theta _{\mathbf {o}}+{\mathbf {c}}\cdot \mathbf {s}+ {\mathbf {C}}\cdot {\mathbf {D}}_{\mathbf {s}\mathbf {s}} + {{\mathbf{\mathbb{C}}}}\cdot {{\mathbf{\mathbb{D}}}}_{\mathbf {s}\mathbf {s}\mathbf {s}} \end{aligned}$$
(121)

where \({\mathbf {D}}_{\mathbf {s}\mathbf {s}}\) and \({{\mathbf{\mathbb{D}}}}_{\mathbf {s}\mathbf {s}\mathbf {s}}\) are defined as in (7) and write

$$\begin{aligned} \Delta g_z(P)=G\int \limits _{\varOmega }\frac{\Delta \rho (\mathbf {s}){\mathbf {r}}\cdot \mathbf {k}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}} {\rm d}V. \end{aligned}$$
(122)

Clearly, in the case of multiple observation points \(P_i\) and/or bodies one can simply write

$$\begin{aligned} \Delta g_z(P_i) = G \sum _{j=1}^{N_B}\int \limits _{\varOmega _j}\frac{\Delta \rho (\mathbf {s}_j){\mathbf {r}}_j\cdot \mathbf {k}}{({\mathbf {r}}_j\cdot {\mathbf {r}}_j)^{3/2}} {\rm d}V \end{aligned}$$
(123)

where \(\varOmega _j\) is the domain of the j-th body, \(N_B\) is the number of bodies to analyze and \({\mathbf {r}}_j=\mathbf {s}_j-\mathbf {p}_i\), \(\mathbf {p}_i\) being the position vector of \(P_i\) with respect to the assigned reference frame having origin at an arbitrary point O. However, being mainly interested to illustrate the rationale of our approach, we shall make reference in the sequel to the case of a single observation point and a single body.

To exploit the results illustrated in the previous section, it is convenient to express \(\mathbf {s}\) as a function of \({\mathbf {r}}\) by means of (120). For brevity, this is detailed only for the rank-three tensor \({{\mathbf{\mathbb{D}}}}_{\mathbf {s}\mathbf {s}\mathbf {s}}\) since it is the more cumbersome to handle. In particular, we infer from (120)

$$\begin{aligned} \begin{array}{rcl} {{\mathbf{\mathbb{D}}}}_{\mathbf {s}\mathbf {s}\mathbf {s}} = \mathbf {s}\otimes \mathbf {s}\otimes \mathbf {s}= ({\mathbf {r}}+\mathbf {p})\otimes ({\mathbf {r}}+\mathbf {p})\otimes ({\mathbf {r}}+\mathbf {p})= {{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}}+ {{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}\mathbf {p}}+ {{\mathbf{\mathbb{D}}}}_{\mathbf {p}\mathbf {p}{\mathbf {r}}}+ {{\mathbf{\mathbb{D}}}}_{\mathbf {p}\mathbf {p}\mathbf {p}} \end{array} \end{aligned}$$
(124)

where \({{\mathbf{\mathbb{D}}}}_{\mathbf {p}\mathbf {p}\mathbf {p}}=\mathbf {p}\otimes \mathbf {p}\otimes \mathbf {p}\),

$$\begin{aligned} {{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}\mathbf {p}}= {\mathbf {r}}\otimes {\mathbf {r}}\otimes \mathbf {p}+ {\mathbf {r}}\otimes \mathbf {p}\otimes {\mathbf {r}}+ \mathbf {p}\otimes {\mathbf {r}}\otimes {\mathbf {r}} \end{aligned}$$
(125)

and

$$\begin{aligned} \begin{array}{rcl} {{\mathbf{\mathbb{D}}}}_{\mathbf {p}\mathbf {p}{\mathbf {r}}}= \mathbf {p}\otimes \mathbf {p}\otimes {\mathbf {r}}+ \mathbf {p}\otimes {\mathbf {r}}\otimes \mathbf {p}+ {\mathbf {r}}\otimes \mathbf {p}\otimes \mathbf {p}= { {\mathbf {D}}_{\mathbf {p}\mathbf {p}}\otimes {\mathbf {r}}+ \mathbf {p}\otimes {\mathbf {r}}\otimes \mathbf {p}+ {\mathbf {r}}\otimes {\mathbf {D}}_{\mathbf {p}\mathbf {p}} }\,. \end{array} \end{aligned}$$
(126)

Hence, the expression (122) for the gravity anomaly becomes

$$\begin{aligned} \Delta g_z(\mathbf {p})&= G\left\{ { [ \theta _{\mathbf {o}}+ {\mathbf {c}}\cdot \mathbf {p}+ {\mathbf {C}}\cdot {\mathbf {D}}_{\mathbf {p}\mathbf {p}} + {{\mathbf{\mathbb{C}}}}\cdot {{\mathbf{\mathbb{D}}}}_{\mathbf {p}\mathbf {p}\mathbf {p}}] d_{\mathbf {r}}^\varOmega + {\mathbf {c}}\cdot \mathbf {d}_{\mathbf {r}}^\varOmega}\right. \\& { +\,{\mathbf {C}}\cdot [ \mathbf {d}_{\mathbf {r}}^\varOmega \otimes \mathbf {p}+ \mathbf {p}\otimes \mathbf {d}_{\mathbf {r}}^\varOmega + {\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^\varOmega ] + {{\mathbf{\mathbb{C}}}}\cdot [{\mathbf {D}}_{\mathbf {p}\mathbf {p}}\otimes \mathbf {d}_{\mathbf {r}}^\varOmega + \mathbf {p}\otimes \mathbf {d}_{\mathbf {r}}^\varOmega \otimes \mathbf {p}+ \mathbf {d}_{\mathbf {r}}^\varOmega \otimes {\mathbf {D}}_{\mathbf {p}\mathbf {p}}]} \\&\left. +\,{{\mathbf{\mathbb{C}}}}\cdot [{\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^{\varOmega }\otimes \mathbf {p}+ \mathbf {d}_{\mathbf {r}}^\varOmega \otimes \mathbf {p}\otimes \mathbf {d}_{\mathbf {r}}^\varOmega + \mathbf {p}\otimes {\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^{\varOmega }] +{{\mathbf{\mathbb{C}}}}\cdot {{\mathbf{\mathbb{D}}}}^\varOmega _{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}} \right\} \,, \end{aligned}$$
(127)

which represents the generalization of (14) to the case \(\mathbf {p}\not ={\mathbf {o}}\).

Special attention has to be paid to the symbol \(\mathbf {d}_{\mathbf {r}}^\varOmega \otimes \mathbf {p}\otimes \mathbf {d}_{\mathbf {r}}^\varOmega\) which is a shorthand to denote the third-order tensor

$$\begin{aligned} \mathbf {d}_{\mathbf {r}}^\varOmega \otimes \mathbf {p}\otimes \mathbf {d}_{\mathbf {r}}^\varOmega = \int \limits _\varOmega \frac{({\mathbf {r}}\cdot \mathbf {k}){\mathbf {r}}\otimes \mathbf {p}\otimes {\mathbf {r}}}{({\mathbf {r}}\cdot {\mathbf {r}})^{3/2}} {\rm d}V= {\mathbf {D}}^\varOmega _{{\mathbf {r}}{\mathbf {r}}}\otimes _{23}\mathbf {p}\,. \end{aligned}$$
(128)

In spite of its symbol, which has been adopted to emphasize its symmetric expression, the tensor above cannot be obtained as the triple tensor product of the vectors \(\mathbf {d}_{\mathbf {r}}^\varOmega\) and \(\mathbf {p}\). Rather, it is conveniently computed starting from the rank-two tensor \({\mathbf {D}}^\varOmega _{{\mathbf {r}}{\mathbf {r}}}\), after having computed its algebraic expression, as detailed in Sect. 2.6.

Although \({\mathbf {r}}\) is now defined from (120), it can be shown that formula (17) holds as well. Thus, recalling (30) and setting

$$\begin{aligned} \theta _{\mathbf {p}}={\mathbf {c}}\cdot \mathbf {p}+ {\mathbf {C}}\cdot {\mathbf {D}}_{\mathbf {p}\mathbf {p}}+ {{\mathbf{\mathbb{C}}}}\cdot {{\mathbf{\mathbb{D}}}}_{\mathbf {p}\mathbf {p}\mathbf {p}}\,, \end{aligned}$$
(129)

formula (127) specializes to

$$\begin{aligned} \Delta g_z(\mathbf {p})=\,&G\left\{ { ( \theta _{\mathbf {o}}+ \theta _{\mathbf {p}}) d_{\mathbf {r}}^{\partial \varOmega }+ \frac{{\mathbf {c}}\cdot \mathbf {d}_{\mathbf {r}}^{\partial \varOmega }}{2}} + {\mathbf {C}}\cdot \left[ \frac{\mathbf {d}_{\mathbf {r}}^{\partial \varOmega }}{2} \otimes \mathbf {p}+ \mathbf {p}\otimes \frac{\mathbf {d}_{\mathbf {r}}^{\partial \varOmega }}{2} + \frac{{\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^{\partial \varOmega }}{3} \right] \right. \\&\quad + {{\mathbf{\mathbb{C}}}}\cdot \left[ \frac{1}{2}\left( {\mathbf {D}}_{\mathbf {p}\mathbf {p}}\otimes \mathbf {d}_{\mathbf {r}}^{\partial \varOmega }+ \mathbf {p}\otimes \mathbf {d}_{\mathbf {r}}^{\partial \varOmega }\otimes \mathbf {p}+ \mathbf {d}_{\mathbf {r}}^{\partial \varOmega }\otimes {\mathbf {D}}_{\mathbf {p}\mathbf {p}}\right) \right. \\&\quad \left. \left. +\frac{1}{3}\left( {\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^{\partial \varOmega }\otimes \mathbf {p}+ \mathbf {d}_{\mathbf {r}}^{\partial \varOmega }\otimes \mathbf {p}\otimes \mathbf {d}_{\mathbf {r}}^{\partial \varOmega }+ \mathbf {p}\otimes {\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^{\partial \varOmega }\right) + \frac{{{\mathbf{\mathbb{D}}}}^{\partial \varOmega }_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}}}{4} \right] \right\} \,. \end{aligned}$$
(130)

Obviously, (130) coincides with (31) when \(\mathbf {p}={\mathbf {o}}\).

Formula (130) can be operatively evaluated for a polyhedral body by considering formulas (37), (38), (47) and (50) for \(d_{\mathbf {r}}^\varOmega\), \(\mathbf {d}_{\mathbf {r}}^\varOmega\), \({\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^\varOmega\) and \({{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}}^\varOmega\), respectively, and the procedures detailed in Sect. 2.32.6 to express them in terms of 3D vectors. In particular, the third-order tensor \(\mathbf {d}_{\mathbf {r}}^{\partial \varOmega }\otimes \mathbf {p}\otimes \mathbf {d}_{\mathbf {r}}^{\partial \varOmega }\) is obtained by applying the notational scheme (115, 116) and replacing \(\mathbf {L}_{{\varvec{\rho }}{\varvec{\rho }}}\) with \({\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^\varOmega\) and \(\mathbf {b}\) with \(\mathbf {p}\), respectively.

4 Eliminable Singularities of the Algebraic Expressions of the Gravity Anomaly

It has already been shown that the analytical expression (31) of the gravity anomaly is singularity-free in the sense that its expression holds rigorously whatever is the position of the point O with respect to \(\varOmega\). The same property holds true for the expression (130) referred to an arbitrary point P. However, their algebraic counterparts, being expressed by means of the quantities detailed in Sect. 2.4, do include further singularities.

They are associated with the expression of the line integrals provided in the Appendices since they become singular when the generic face \(F_i\) contains the observation point, either O or P, and this belongs to the line containing the j-th edge of the boundary \(\partial F_i\).

However, we are going to prove analytically that the contribution of the singular line integral to the domain integral in which its computation is required is zero. Hence, from the computational point of view, the singularity of the j-th line integral does not have any practical effect and it can be simply ignored when computing the associated domain integral.

As shown in Appendix 2, some of the 2D domain integrals required in the present context have already been computed in previous papers by D’Urso (2013a, 2014a, b) so that the discussion on their singularity-free nature can be found in the quoted reference. Nevertheless, we shall systematically prove this property also for these last integrals, namely the ones having \(\left( {\varvec{\rho }}_i\cdot {\varvec{\rho }}_i+d_i^2\right) ^{1/2}\) in the denominator, since we are going to use new and simpler arguments; the same arguments will be exploited to prove the singularity-free nature of the integrals having \(\left( {\varvec{\rho }}_i\cdot {\varvec{\rho }}_i+d_i^2\right) ^{3/2}\) in the denominator.

4.1 Eliminable Singularity of the Integral \(\psi _{F_i}\)

We know from formulas (218) and (219) that

$$\begin{aligned} \psi _{F_i}= \int \limits _{F_i}\frac{{\rm d}A_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{1/2}} &=\sum _{j=1}^{N_{E_i}}\left( {\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \right) \int \limits _0^{1} \frac{\left[ \hat{{\varvec{\rho }}}_i(\lambda _j)\cdot \hat{{\varvec{\rho }}}_i(\lambda _j)+d_i^2\right] ^{1/2} }{\hat{{\varvec{\rho }}}_i(\lambda _j)\cdot \hat{{\varvec{\rho }}}_i(\lambda _j)} d\lambda _j - \alpha _i|d_i|\\ \\ &= \sum _{j=1}^{N_{E_i}}\left( {\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \right) \int \limits _0^{1}\frac{\left( p_j\lambda _j^2 +2q_j\lambda _j +v_j\right) ^{1/2}}{p_j\lambda _j^2 +2q_j\lambda _j +u_j} d\lambda _j - \alpha _i|d_i| \\&=\sum _{j=1}^{N_{E_i}}\left( {\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \right) I_{6j}- \alpha _i|d_i| \end{aligned}$$
(131)

where see also (70), we have set

$$\begin{aligned} p_j=\Delta {\varvec{\rho }}_j\cdot \Delta {\varvec{\rho }}_j=l_j^2\quad q_j={\varvec{\rho }}_j\cdot \Delta {\varvec{\rho }}_j\quad u_j={\varvec{\rho }}_j\cdot {\varvec{\rho }}_j\quad v_j=u_j+d_i^2 = |{\mathbf {r}}_j|^2\,. \end{aligned}$$
(132)

Useful in the sequel are also the quantities (D’Urso 2013a, 2014a, b)

$$\begin{aligned} p_j+q_j={\varvec{\rho }}_{j+1}\cdot \Delta {\varvec{\rho }}_j\quad p_j+2q_j+v_j={\varvec{\rho }}_{j+1}\cdot {\varvec{\rho }}_{j+1}+d_i^2= |{\mathbf {r}}_{j+1}|^2 \end{aligned}$$
(133)

and the discriminant \(\Delta _j=q_j^2-p_ju_j\) of the denominator in (131). In particular, it turns out to be

$$\begin{aligned} -\Delta _j= p_ju_j-q_j^2=\left( {\varvec{\rho }}_{j+1}\cdot {\varvec{\rho }}_{j+1}\right) \cdot \left( {\varvec{\rho }}_j\cdot {\varvec{\rho }}_j\right) -\left( {\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}\right) ^2\ge 0 \end{aligned}$$
(134)

by virtue of the Cauchy-Schwartz inequality (Tang 2006).

Clearly, our main concern is when \(\Delta _j=0\). In particular, setting \({\varvec{ o }}=(0,0)\), it is apparent from the previous expression that the denominator of the j-th integral on the right-hand side of (131) can become singular if \({\varvec{\rho }}_j={\varvec{ o }}\), \({\varvec{\rho }}_{j+1}={\varvec{ o }}\) or \({\varvec{\rho }}_j\) and \({\varvec{\rho }}_{j+1}\) are parallel and point in opposite directions, i.e. if the projection of the observation point onto \(F_i\) belongs to the segment \(\left[ {\varvec{\rho }}_j,\;{\varvec{\rho }}_{j+1}\right]\). In turn, this may happen independently from the value of \(d_i\), i.e. whether or not the i-th face of the polyhedron \(\varOmega\) does contain the observation point.

In both cases, \(d_i\ne 0\) or \(d_i=0\), we are going to prove by mathematical arguments that the contribution of such an edge to \(\psi _{F_i}\) is zero so that its computation can be skipped. Let us first consider the case \(d_i\ne 0\).

As shown in D’Urso (2013a, 2014a), the evaluation of the line integral on the right-hand side of (131) is carried out by setting \(t=\lambda _j+q_j/p_j\); this yields

$$\begin{aligned} I_{6j}=\int \limits _0^{1}\frac{\left( p_j\lambda _j^2 +2q_j\lambda _j +v_j\right) ^{1/2}}{p_j\lambda _j^2 +2q_j\lambda _j +u_j} d\lambda _j= \frac{1}{\sqrt{p_j}} \int \limits _{q_j/p_j}^{1+q_j/p_j}\frac{\sqrt{t^2+B_j}}{t^2+A_j}dt \end{aligned}$$
(135)

where

$$\begin{aligned} A_j=-\frac{\Delta _j}{p_j^2}=\frac{p_ju_j-q_j^2}{p_j^2}\qquad B_j=\frac{p_jv_j-q_j^2}{p_j^2}=A_j + \frac{d_i^2}{p_j} = A_j + \frac{d_i^2}{l_j^2}\,. \end{aligned}$$
(136)

Notice that the denominator in (135) is positive if \(-\Delta _j=p_j^2A_j>0\). In this case, the primitive of the integrand on the right-hand side of (135) becomes

$$\begin{aligned} I_{6j}= \frac{1}{\sqrt{p_j}} \left\{ \sqrt{\frac{B_j-A_j}{A_j}} \arctan \frac{\sqrt{B_j-A_j}}{\sqrt{A_j}\sqrt{B_j+t^2}} +\ln \left( t+\sqrt{B_j+t^2}\right) \right\} _{q_j/p_j}^{1+q_j/p_j} \end{aligned}$$
(137)

or equivalently

$$\begin{aligned} I_{6j}=\left\{ \frac{|d_i|}{\sqrt{-\Delta _j}} \arctan \frac{|d_i|}{\sqrt{-\Delta _j}\sqrt{B_j+t^2}} +\frac{\ln \left( t+\sqrt{B_j+t^2}\right) }{\sqrt{p_j}}\right\} _{q_j/p_j}^{1+q_j/p_j}\,. \end{aligned}$$
(138)

Conversely, should it be \(\Delta _j=0\), and hence \(A_j=0\), the integrand on the right-hand side of (135) becomes singular at one point belonging to the interval \(\left[ q_j/p_j,\;1+q_j/p_j\right]\). Actually, we infer from (134) and the properties of the Cauchy-Schwartz inequality that \(\Delta _j=0\) if and only if \({\varvec{\rho }}_j={\varvec{ o }}\), \({\varvec{\rho }}_{j+1}={\varvec{ o }}\) or the segment \([{\varvec{\rho }}_j,\;{\varvec{\rho }}_{j+1}]\) contains the null vector in its interior.

Actually if \({\varvec{\rho }}_j={\varvec{ o }}\) \(\left( {\varvec{\rho }}_{j+1}={\varvec{ o }}\right)\), it turns out to be \(q_j/p_j=0\) \(\left( 1+q_j/p_j=0\right)\); hence, the denominator in (135) becomes singular since \(t^2+A_j={\varvec{\rho }}_j\cdot {\varvec{\rho }}_j/p_j\) \(\left( {\varvec{\rho }}_{j+1}\cdot {\varvec{\rho }}_{j+1}/p_j\right) =0\) at the left (right) extreme of the integration integral.

Furthermore, should the projection of the observation point fall within the segment \([{\varvec{\rho }}_j,\;{\varvec{\rho }}_{j+1}]\), one has \({\varvec{\rho }}_{j+1}=\beta _j{\varvec{\rho }}_j\) \((\beta _j< 0)\) where \(q_j/p_j=(\beta _j-1){\varvec{\rho }}_j\cdot {\varvec{\rho }}_j/p_j<0\) and \(1+q_j/p_j=\beta _j(\beta _j-1){\varvec{\rho }}_j\cdot {\varvec{\rho }}_j/p_j>0\). Accordingly, the integration interval in (135) splits in two intervals having 0 as right (left) extreme. At that point, however, \(t=0\) and \(A_j = -\Delta _j/p_j^2=0\) by assumption so that the integrand in (135) becomes singular.

However, we are going to prove that, in the previous three cases, the singularity is eliminable and that the integral attains a finite value. Let us discuss separately the three cases, namely \({\varvec{\rho }}_j={\varvec{ o }}\), \({\varvec{\rho }}_{j+1}={\varvec{ o }}\) and \({\varvec{\rho }}_{j+1}=\beta _j\,{\varvec{\rho }}_j\;\;(\beta _j<0)\).

In this first case, \({\varvec{\rho }}_j={\varvec{ o }}\), the integration interval is \([0,\;1]\) and we have singularity of the integrand in (135) at the left extreme, while the argument of the logarithm is positive. Thus, recalling (131) and (138), the contribution of the integral \(I_{6j}\) to \(\psi _{F_i}\) is provided by

$$\begin{aligned} \left( {\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \right) \; I_{6j}& = {\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \left[ \frac{|d_i|}{\sqrt{-\Delta _j}} \arctan \frac{|d_i|}{\sqrt{-\Delta _j}\sqrt{B_j+t^2}} +\frac{\ln \left( t+\sqrt{B_j+t^2}\right) }{\sqrt{p_j}}\right] _{0}^{1}. \end{aligned}$$
(139)

Setting \({\varvec{\rho }}_j=|{\varvec{\rho }}_j|\mathbf {e}=\varepsilon \,\mathbf {e}\) and observing that, on account of (134),

$$\begin{aligned} -\Delta _j= \left( {\varvec{\rho }}_{j+1}\cdot {\varvec{\rho }}_{j+1}\right) |{\varvec{\rho }}_j|^2-\left( |{\varvec{\rho }}_j|\mathbf {e}\cdot {\varvec{\rho }}_{j+1}\right) ^2=\varepsilon ^2\left[ {\varvec{\rho }}_{j+1}\cdot {\varvec{\rho }}_{j+1}-\left( \mathbf {e}\cdot {\varvec{\rho }}_{j+1}\right) ^2\right] \,, \end{aligned}$$
(140)

we infer that \(\sqrt{-\Delta _j}\) is infinitesimal of the same order as \(\varepsilon =|{\varvec{\rho }}_j|\) when \(\varepsilon \rightarrow 0\), a property we state by writing \(\sqrt{-\Delta _j}={\mathcal {O}}(\varepsilon )\). Hence, (139) becomes

$$\begin{aligned} \left( {\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \right) \; I_{6j}&= \lim _{\varepsilon \rightarrow 0}\varepsilon \left\{ \left[ \frac{|d_i|}{\sqrt{-\Delta _j(\varepsilon )}} \arctan \frac{|d_i|}{\sqrt{-\Delta _j(\varepsilon )}\sqrt{B_j+t^2}}\right] _{\varepsilon }^1 +\frac{1}{\sqrt{p_j}}\left[ \ln \left( t+\sqrt{B_j+t^2}\right) \right] _0^1\right\} \end{aligned}$$
(141)

since the \({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp ={\mathcal {O}}(\varepsilon )\) if \(\varepsilon \rightarrow 0\).

Since the arctan function is finite at \(t=1\) and the same does occur for the ln function at \(t=0\) and \(t=1\), we finally have

$$\begin{aligned} \left( {\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \right) \; I_{6j} =-|d_i|\lim _{\varepsilon \rightarrow 0}\frac{\varepsilon }{\sqrt{-\Delta _j(\varepsilon )}} \arctan \frac{|d_i|}{\sqrt{-\Delta _j(\varepsilon )}\sqrt{B_j+\varepsilon ^2}}=-\frac{\pi }{2}|d_i|\,. \end{aligned}$$
(142)

However, if \({\varvec{\rho }}_j={\varvec{ o }}\) for the j-th edge, it will turn out to be \({\varvec{\rho }}_{j+1}={\varvec{ o }}\) for the \((j-1)\)-th edge. Hence, the arctan function in (138) will be evaluated in the interval \([-1,\; \varepsilon ]\), with \(\varepsilon \rightarrow 0\), and one has \(\left( {\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \right) \; I_{6j}=\pi \,|d_i|/2\).

To conclude the total contribution provided to \(\varphi _{F_i}\) by the two edges for which it simultaneously happens that \({\varvec{\rho }}_j={\varvec{ o }}\) for the j-th edge and \({\varvec{\rho }}_{j+1}={\varvec{ o }}\) for the \((j-1)\)-th edge is zero.

A null contribution to \(\varphi _{F_i}\) is also provided by edges for which the projection of the observation point is internal to the edge. In this case \({\varvec{\rho }}_j\) and \({\varvec{\rho }}_{j+1}\) are parallel so that the product \({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp\) is zero. Accordingly, both \({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp\) and \(\sqrt{-\Delta _j}\) are \({\mathcal {O}}(\varepsilon )\), that is both of them are infinitesimal of order \(\varepsilon\) as \(\varepsilon \rightarrow 0\). In conclusion, (139) yields

$$\begin{aligned} \begin{array}{ll} \left( {\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \right) \; I_{6j} =& |d_i|\lim _{\varepsilon \rightarrow 0}\left\{ \frac{\varepsilon }{\sqrt{-\Delta _j(\varepsilon )}} \left[ \arctan \frac{|d_i|}{\sqrt{-\Delta _j(\varepsilon )}\sqrt{B_j+t^2}}\right] _{-1}^{0}\right. \\ \\ &\quad \left. +\frac{\varepsilon }{\sqrt{-\Delta _j(\varepsilon )}} \left[ \arctan \frac{|d_i|}{\sqrt{-\Delta _j(\varepsilon )}\sqrt{B_j+t^2}}\right] _{0}^{1} +\frac{\varepsilon }{\sqrt{p_j}}\left[ \ln \left( t+\sqrt{B_j+t^2}\right) \right] _0^1\right\} =0\,. \end{array} \end{aligned}$$
(143)

Actually, the ln function is finite both at \(t=0\) and at \(t=1\). Furthermore, by repeating the arguments exploited in (142), the arctan function attains finite and opposite values both at \(t=0\) and \(t\pm 1\).

In conclusion, we have proved that, when \(d_i\ne 0\) and the projection of the observation point does belong to the closed interval having \({\varvec{\rho }}_j\) and \({\varvec{\rho }}_{j+1}\) as extremes, the contribution of the relevant edge can be skipped since the overall contribution to \(\varphi _{F_i}\) associated with such a singular case is lumped within the addend \(\alpha _i|d_i|\).

Let us now prove that the same result is obtained if \(|d_i|=0\), i.e. if the face \(F_i\) does contain the observation point. In this case, the integral in (131) can be expressed as follows

$$\begin{aligned} \psi _{F_i}=\sum _{j=1}^{N_{E_i}}\left( {\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \right) \,I_{6j} =\sum _{j=1}^{N_{E_i}}\left( {\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \right) \int \limits _0^{1} \frac{d\lambda _j}{\left[ \hat{{\varvec{\rho }}}_i(\lambda _j)\cdot \hat{{\varvec{\rho }}}_i(\lambda _j)\right] ^{1/2}} - \alpha _i |d_i|\,. \end{aligned}$$
(144)

Also in this case, the j-th edge characterized by \({\varvec{\rho }}_j={\varvec{ o }}\) or \({\varvec{\rho }}_{j+1}={\varvec{ o }}\) or \({\varvec{\rho }}_{j+1}=\beta _j{\varvec{\rho }}_j\;\;(\beta _j<0)\) does not give any contribution to \(\varphi _{F_i}\). Let us examine separately the three cases

  • \({\varvec{\rho }}_j={\varvec{ o }}\)

    In this case, the parameterization (67) yields \(\hat{{\varvec{\rho }}}_i(\lambda _j)=\lambda _j {\varvec{\rho }}_{j+1}\) so that the j-th integral in (144) becomes

    $$\begin{aligned} I_{6j}=\int \limits _0^{1} \frac{d\lambda _j}{\lambda _j\left( {\varvec{\rho }}_{j+1}\cdot {\varvec{\rho }}_{j+1}\right) ^{1/2}}= \frac{1}{\sqrt{p_j}}\int \limits _0^{1} \frac{d\lambda _j}{\lambda _j}\,. \end{aligned}$$
    (145)

    Setting \(\varepsilon =|{\varvec{\rho }}_j|\) and being \({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp\) infinitesimal of order \(\varepsilon\), it turns out to be

    $$\begin{aligned} \left( {\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \right) \,I_{6j} =\frac{1}{\sqrt{p_j}} \lim _{\varepsilon \rightarrow 0} \varepsilon \left[ \ln \lambda _j\right] _\varepsilon ^1=0 \end{aligned}$$
    (146)

    since the logarithm tends to infinite with an arbitrarily low degree.

  • \({\varvec{\rho }}_{j+1}={\varvec{ o }}\)

    Setting \(\hat{{\varvec{\rho }}}_i(\lambda _j)=(1-\lambda _j){\varvec{\rho }}_j\) the integral in (144) can be written

    $$\begin{aligned} I_{6j}=\frac{1}{\sqrt{u_j}}\int \limits _0^{1} \frac{d\lambda _j}{1-\lambda _j}= -\frac{1}{\sqrt{u_j}}\int \limits _1^{0} \frac{d\eta _j}{\eta _j} \end{aligned}$$
    (147)

    where \(\eta _j=1-\lambda _j\). Hence, setting \(\varepsilon =|{\varvec{\rho }}_{j+1}|\), one has

    $$\begin{aligned} \left( {\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \right) \,I_{6j}= -\frac{1}{\sqrt{u_j}} \lim _{\varepsilon \rightarrow 0} \varepsilon \left[ \ln \eta _j\right] _1^\varepsilon =0 \end{aligned}$$
    (148)

    due to the behavior of the logarithm at infinity.

  • \({\varvec{\rho }}_{j+1}\) parallel to \({\varvec{\rho }}_j\)

    We are considering the case in which the observation point is projected onto the face \(F_i\) inside the j-th edge \(\left[ {\varvec{\rho }}_j,\;{\varvec{\rho }}_{j+1}\right]\). Hence, we can set \({\varvec{\rho }}_{j+1}=\beta _j{\varvec{\rho }}_j\), \(\beta _j<0\), since \({\varvec{\rho }}_j\) and \({\varvec{\rho }}_{j+1}\) point in opposite directions. Setting

    $$\begin{aligned} {\varvec{\rho }}_j(\lambda _j) = \left[ 1+\lambda _j (\beta _j-1)\right] {\varvec{\rho }}_j= \tau _j{\varvec{\rho }}_j\,, \end{aligned}$$
    (149)

    the integral in (144) becomes

    $$\begin{aligned} I_{6j}=&\frac{1}{\sqrt{u_j}}\int \limits _0^{1} \frac{d\lambda _j}{|1+\lambda _j(\beta _j-1)|}= \frac{1}{(\beta _j-1)\sqrt{u_j}}\int \limits _1^{\beta _j} \frac{d\tau _j}{|\tau _j|}=& \frac{1}{(1-\beta _j)\sqrt{u_j}}\int \limits _{\beta _j}^1 \frac{d\tau _j}{|\tau _j|}\\ =& \frac{1}{(1-\beta _j)\sqrt{u_j}}\left[ \int \limits _{\beta _j}^0 \frac{d\tau _j}{|\tau _j|} +\int \limits _0^1 \frac{d\tau _j}{|\tau _j|}\right]\\ =& \frac{1}{(1-\beta _j)\sqrt{u_j}}\left\{ \left[ \ln \tau _j\right] _0^{|\beta _j|}+\left[ \ln \tau _j\right] _0^1\right\}. \end{aligned}$$
    (150)

    Being \({\varvec{\rho }}_j\) and \({\varvec{\rho }}_{j+1}\) parallel, \({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp =0\). Hence, setting \(\varepsilon =|{\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp |\)

    $$\begin{aligned} \left( {\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp \right) \,I_{6j}= \frac{1}{(1-\beta _j)\sqrt{u_j}} \lim _{\varepsilon \rightarrow 0} \varepsilon \left[ \ln |\beta _j|-2\ln \varepsilon \right] =0 \end{aligned}$$
    (151)

    similarly to (146).

4.2 Eliminable Singularity of the Integral \({\varvec{\psi }}_{F_i}\)

The expression (220) of the integral

$$\begin{aligned} {\varvec{\psi }}_{F_i}&= \int \limits _{F_i}\frac{{\varvec{\rho }}_i{\rm d}A_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i + d_i^2)^{1/2}} = \sum _{j=1}^{N_{E_i}}I_{4j}\,\Delta {\varvec{\rho }}_{j}^\perp \\ \\&= \sum _{j=1}^{N_{E_i}}\frac{1}{2\sqrt{p_j}}\left\{ \frac{p_j v_j-q_j^2}{p_j} {\rm LN}_j + \frac{1}{\sqrt{p_j}} \left[ \left( p_j+q_j\right) \sqrt{p_j + 2 q_j +v_j} - q_j\sqrt{v_j} \right] \right\} \Delta {\varvec{\rho }}_{j}^\perp \end{aligned}$$
(152)

is composed of two addends. The second one is well defined, according to (132) and (133), whatever is the value of \(d_i\) and the position of j-th edge with respect to the observation point.

The first addend in (152) is well defined for \(d_i\ne 0\) since

$$\begin{aligned} {\rm LN}_j=\ln k_j= \ln \frac{{\varvec{\rho }}_{j+1}\cdot \left( {\varvec{\rho }}_{j+1}-{\varvec{\rho }}_j\right) + l_j|{\mathbf {r}}_{j+1}|}{{\varvec{\rho }}_j\cdot \left( {\varvec{\rho }}_{j+1}-{\varvec{\rho }}_j\right) + l_j|{\mathbf {r}}_{j}|} \end{aligned}$$
(153)

on the basis of formula (73) in D’Urso (2014b).

Conversely, should it be \(d_i=0\) and \({\varvec{\rho }}_i={\varvec{ o }}\) or \({\varvec{\rho }}_j={\varvec{ o }}\) or \({\varvec{\rho }}_{j+1}=\beta _j{\varvec{\rho }}_j\;(\beta _j<0)\), one has

$$\begin{aligned} \frac{p_j v_j-q_j^2}{p_j} {\rm LN}_j = \frac{-\Delta _j}{p_j}{\rm LN}_j= \lim _{\varepsilon \rightarrow 0}\frac{-\Delta _j(\varepsilon ^2) {\rm LN}_j(\varepsilon )}{2p_j}=0 \end{aligned}$$
(154)

since \(-\Delta _j\) tends to zero quadratically and \({\rm LN}_j\) tends to infinity with an arbitrary low degree.

In conclusion, edges characterized by singularities of the relevant integral \(I_{4j}\) give no contribution to \({\varvec{\psi }}_{F_i}\).

4.3 Eliminable Singularity of the Integral \({\varvec{\varPsi }}_{F_i}\)

The expression (208) of the integral

$$\begin{aligned} {\varvec{\varPsi }}_{F_i}= \ \sum _{j=1}^{N_{E_i}}\left[ \left( I_{4j}{\varvec{\rho }}_j+ I_{5j}\Delta {\varvec{\rho }}_j\right) \otimes \Delta {\varvec{\rho }}_{j}^\perp - \frac{\mathbf {I}_{2{\rm D}}}{3} ({\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp )I_{4j}\right] +\frac{ d_i^2}{3} \left( \psi _i - |d_i|\alpha _i\right) \end{aligned}$$
(155)

depends upon the integrals \(\psi _i\), \(I_{4j}\) and \(I_{5j}\). The discussion on the well-posedness on \(\psi _i\) has already been detailed in Sect. 4.1.

Conversely, the integrals \(I_{4j}\) and \(I_{5j}\) are composed, according to their expressions (215) and (216), of the quantities

$$\begin{aligned} \sqrt{v_j}\quad \sqrt{p_j+2q_j+v_j} \end{aligned}$$
(156)

and of the additional integral \(I_{0j}\). On the basis of the definition (132) and (134), the radicals in (156) are well defined whatever is the value of \(d_i\) and the position of the j-th edge with respect to the observation point.

The dependence of the integrals \(I_{4j}\) and \(I_{5j}\) upon \(I_{0j}\) does not give any problem since its expression, according to (211), depends upon \({\rm LN}_j\). Differently from (152), the quantity \({\rm LN}_j\) is not scaled by \(p_jv_j-q_j^2\), so that we cannot invoke the result (154). However, the integral \({\varvec{\varPsi }}_{F_i}\), and hence \({\rm LN}_j\), is required for computing the integrals \({\mathfrak {C}}_{F_i}\) and \({\mathfrak {D}}_{F_i}\) in (42) that, in turn, are scaled by \(d_i\) in the expressions (47) and (50).

Hence, when \(d_i\) is zero, which makes \({\rm LN}_j\) undefined, we can invoke a result similar to (154) by writing

$$\begin{aligned} d_i {\rm LN}_j =\lim _{\varepsilon \rightarrow 0} d_i(\varepsilon ){\rm LN}_j(\varepsilon )=0\,. \end{aligned}$$
(157)

Stated equivalently, when \(d_i=0\) the contribution to the integral \({\varvec{\varPsi }}_{F_i}\) provided by the face \(F_i\) can be skipped.

4.4 Eliminable Singularity of the Integral \({\varvec{\varphi}}_{F_i}\)

The expression provided in (221) for the integral

$$\begin{aligned} \varphi _{F_i} = \int \limits _{F_i}\frac{{\rm d}A_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i+d^2_i)^{3/2}} = \frac{\alpha _i}{|d_i|} -\sum _{j=1}^{N_{E_i}} \left[ \frac{{\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp }{|d_i|\sqrt{p_j u_j - q_j^2}}({\rm ATN}1_j-{\rm ATN}2_j)\right] \end{aligned}$$
(158)

is well defined whatever is the value of \(d_i\) and the position of the j-th edge with respect to the observation point.

Also the case \(d_i=0\) does not represent a problem since \(\varphi _{F_i}\) is premultiplied by \(d_i\) in the formulas (37), (38) (47) and (50) for \(d_{\mathbf {r}}^\varOmega\), \(\mathbf {d}_{\mathbf {r}}^\varOmega\), \({\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^\varOmega\) and \({{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}}^\varOmega\) respectively. Furthermore, the discussion on the well-posedness of the quantity

$$\begin{aligned} \frac{{\varvec{\rho }}_j\cdot {\varvec{\rho }}_{j+1}^\perp }{\sqrt{p_j v_j-q_j^2}} \left( {\rm ATN}1_j - {\rm ATN}2_j\right) \end{aligned}$$
(159)

when \(d_i=0\) and the projection of the observation point lies within the segment \(\left[ {\varvec{\rho }}_j,\;{\varvec{\rho }}_{j+1}\right]\) is completely similar to that reported in Sect. 4.1

4.5 Eliminable Singularity of the Integral \({\varvec{\varphi}}_{F_i}\)

We know from formula (222) that

$$\begin{aligned} {\varvec{\varphi }}_{F_i} = \int \limits _{F_i}\frac{{\varvec{\rho }}_i {\rm d}A_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i+d^2_i)^{3/2}} = -\sum _{j=1}^{N_{E_i}} I_{0j}\;\Delta {\varvec{\rho }}_{j}^\perp \end{aligned}$$
(160)

where \(I_{0j}\) is provided by (211). Hence, the discussion on its well-posedness can be carried out similarly to (157) when \(d_i=0\) and the j-th edge does contain the observation point in its interior.

Actually, the integral \({\varvec{\varphi }}_{F_i}\) in the expression (37), (38) (47) and (50) for \(d_{\mathbf {r}}^\varOmega\), \(\mathbf {d}_{\mathbf {r}}^\varOmega\), \({\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^\varOmega\) and \({{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}}^\varOmega\) is always scaled by \(d_i\).

4.6 Eliminable Singularity of the Integral \({\mathbf \Phi }_{F_i}\)

Recalling the expression (223)

$$\begin{aligned} {\mathbf \Phi }_{F_i} = \int \limits _{F_i}\frac{{\varvec{\rho }}_i\otimes {\varvec{\rho }}_i}{({\varvec{\rho }}_i\cdot {\varvec{\rho }}_i+d_i^2)^{3/2}} = - \sum _{j=1}^{N_{E_i}}\left[ {\rm LN}_j\,{\varvec{\rho }}_j\otimes \Delta {\varvec{\rho }}_{j}^\perp + I_{1j}\,\Delta {\varvec{\rho }}_j\,\otimes \Delta {\varvec{\rho }}_{j}^\perp \right] + \psi _{F_i}\mathbf {I}_{2{\rm D}}\,, \end{aligned}$$
(161)

we infer that \({\mathbf \Phi }_{F_i}\) is well defined whatever is the value of \(d_i\) and the position of the observation point with respect to the j-th edge of the face \(F_i\). This is trivial if \(d_i\ne 0\) since \({\rm LN}_j\), \(I_{1j}\) and \(\psi _{F_i}\) in the previous expression are well defined.

To discuss the well-posedness of \({\mathbf \Phi }_{F_i}\) in the case \(d_i=0\) and when the projection of the observation point onto \(F_i\) does belong to the segment \(\left[ {\varvec{\rho }}_j,\;{\varvec{\rho }}_{j+1}\right]\) we remind the reader that \({\mathbf \Phi }_{F_i}\), as well as \(\varphi _{F_i}\) and \({\varvec{\varphi }}_{F_i}\), is scaled by \(d_i\) in the expressions (47) and (50) for \({\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^\varOmega\) and \({{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}}^\varOmega\). Hence, the well-posedness of \(d_i {\rm LN}_j\) can be assessed as in (157), while that of \(\psi _{F_i}\) has been already proved in Sect. 4.1.

Finally, according to formula (212), the well-posedness of \(I_{1j}\) depends upon that of \(I_{0j}\); in turn, this last one depends upon the product \(d_i {\rm LN}_j\) discussed above.

In conclusion, we have proved that the gravity anomaly at an arbitrary point P can be computed effectively whatever is its position with respect to the polyhedron \(\varOmega\). Actually, the potential singularity of the integrals involved in the formulas (37), (38), (47) and (50) for \(d_{\mathbf {r}}^\varOmega\), \(\mathbf {d}_{\mathbf {r}}^\varOmega\), \({\mathbf {D}}_{{\mathbf {r}}{\mathbf {r}}}^\varOmega\) and \({{\mathbf{\mathbb{D}}}}_{{\mathbf {r}}{\mathbf {r}}{\mathbf {r}}}^\varOmega\) gives no contribution to the gravity anomaly.

5 Numerical Examples

The formulas developed in the previous sections have been coded in a Matlab program in order to check their correctness and robustness. They have been applied to model tests and case studies derived from the specialized literature by assuming the density contrast to vary separately along the horizontal and the vertical directions or along both of them. In all examples, the density contrast is expressed in units of kilometers per cubic meter, while distances are expressed in kilometers; the value of the gravitational constant G is \(6.67259 \,10^{-11} \mathrm{m}^3\,\mathrm{kg}^{-1}\mathrm{s}^{-2}\).

Results obtained by the proposed approach have been carefully checked by comparing them with those resulting from a numerical integration of the integrals involved in the computation of the gravity anomaly. They can be useful to allow for a comparison with computations carried out by using different methods or with more complex modelings, e.g., those required to evaluate the gravitational effects of an arbitrary volumetric mass layer in which a laterally varying radial density change has been assumed (Kingdon et al. 2009; Tenzer et al. 2012). To give an idea of the computational burden required in both approaches, we have included the computing time (CT) obtained by running the Matlab code on a INTEL CORE2 PC with 16Gb of RAM and a i7-4700HQ CPU having clock speed of 2.40 GHz.

The first test has been taken from García-Abdeslem (2005) and refers to a prism extending along x and y between 10 and 20 km and delimited by the planes z = 0 and z = 8 km. Density contrast is expressed by the function

$$\begin{aligned} \Delta \rho (z) = -747.7 + 203.435z - 26.764 z^2 + 1.4247z^3 = p+qz+rz^2+sz^3 \end{aligned}$$
(162)

where the density is expressed in \(\hbox {kg/m}^3\) and z in kilometers.

In order to compare our results with those reported in García-Abdeslem (2005), the gravity anomaly has been computed at points P having \(y=15\) km, \(z=-0.15\) m and x ranging from 0 to 30 km. In particular, the observer location was taken by García-Abdeslem (2005) \(-15\) cm of the top of the prism to avoid a singularity in the analytic solution occurring when the observation and the source coordinates coincide.

Although our approach is singularity-free, as proved in Sect. 4, we have deliberately repeated the computations made by García-Abdeslem (2005) to draw the reader’s attention to the incorrect values reported in Fig. 3 of the quoted paper.

As a matter of fact, all mathematical formulas in García-Abdeslem (2005) are correct, but, for some reasons, the values of the gravity anomaly plotted in Fig. 3 have been calculated by assuming wrong integration limits in formula (8) of his paper, namely \(x_1\), \(y_1\), \(z_1\), \(x_2\), \(y_2\), \(z_2\) (lowercase letters) instead of the correct \(X_1\), \(Y_1\), \(Z_1\), \(X_2\), \(Y_2\), \(Z_2\) (capital letters).

In other words, formula (8) in García-Abdeslem (2005), reported herewith for completeness

$$\begin{aligned} I_k = \int \limits _{X_1}^{X_2}\mathrm{d}X\int \limits _{Y_1}^{Y_2}{\rm d}Y\int \limits _{Z_1}^{Z_2}{\rm d}Z \left\{ \rho _k\frac{Z^k}{R^3}\right\} \qquad k=1,2,3,4 \end{aligned}$$
(163)

is correct but the results plotted in Fig. 3 of the quoted paper have been obtained by considering \(x_1\) instead \(X_1\), \(y_1\) instead \(Y_1\) ... and so on. Please notice that, apart from \(\rho _k\), the notation in (163) is taken from the original paper so that the observation point is defined by the coordinates \(P=(x_0\), \(y_0\), \(z_0\)) and (x,y,z) denote the source coordinates. According to García-Abdeslem (2005) the prism is bounded by the planes \(x=x_1\), \(y=y_1\), \(z=z_1\), \(x=x_2\), \(y=y_2\), \(z=z_2\) and it has been set \(X=x-x_0\), \(Y=y-y_0\), \(Z=z-z_0\).

In conclusion, the correct values of the gravity anomaly at \(x_0 \in [0, \; 30]\) km, \(y_0 =15\) km and \(z_0 = -15\) cm, where we have used the notation of García-Abdeslem (2005), are reported in Figs. 3a–d, respectively, for the separate cases of \(\Delta \rho = p=\rho _1\), \(\Delta \rho = qz=\rho _2\), \(\Delta \rho = rz^2=\rho _3\), \(\Delta \rho = sz^3=\rho _4\),

Fig. 3
figure 3

Gravitational attraction at P = [0,30]\(\times\)15\(\times\)(−0.00015) associated with the prism \(\varOmega \equiv [10,\,20]\times [10,\,20]\times [0,\,8]\) (dimensions in kilometers) and density contrast given by (162). a Constant term in (162). b Linear term in (162). c Quadratic term in (162). d Cubic term in (162)

Fig. 4
figure 4

Differences \(\Delta\) between the analytical and numerical values plotted in Fig. 3. a Constant term in (162). b Linear term in (162). c Quadratic term in (162). d Cubic term in (162)

The correctness of the values reported in Fig. 3 has been checked by numerically integrating formula (162) with the aid of the adaptive quadrature procedure implemented in Matlab and by setting \(X_1=10-x_0\), \(Y_1=10-y_0\), \(Z_1=0.00015\), \(X_2=20-x_0\), \(Y_2=20-y_0\), \(Z_2=8-0.00015\). For completeness, the differences between the analytical and numerical values reported in Fig. 3 are plotted in Fig. 4.

To fully test the correctness of the proposed formulation and the robustness of the relevant implementation, we have systematically carried out a comparison of the results associated with the analytical and the numerical evaluation of the integrals involved in the computation of the gravity anomaly. To emphasize the singularity-free nature of our solution, this has been done by considering the example in García-Abdeslem (2005) and evaluating the anomaly at z = 0 and for several values of y, namely y = 10, y = 11 km, y = 12.5 km and y = 15 km.

The gravity anomaly has been evaluated for values of x ranging in the interval [0, 30] km, and the relevant values are plotted in Fig. 5. For completeness, the analytical results are reported in Table 1 together with those obtained by numerically evaluating the integrals in formula (163); for the reader’s convenience, the differences between the analytical and numerical values are plotted in Fig. 6. The symbol NaN in Table 1 for x = 15 km, is due to the fact that the numerical procedure, adopted by Matlab to numerically evaluate the integrals in (163), failed to converge. Notice as well that the numerical procedure, besides being computationally more expensive, gives less precise results when the observation point belongs to \(\varOmega\), i.e. y = 10 km and y = 15 km, and x moves toward the center of \(\varOmega\); actually the numerical solution has only three significant digits at x = 10 km and x = 20 km.

Fig. 5
figure 5

Gravitational attraction at \(P\,=\,[0,30]\times \,y_k \times [0]\) (k = 1,2,3,4) associated with the prism \(\varOmega \equiv [10,\,20]\times [10,\,20]\times [0,\,8]\) (dimensions in kilometers) and density contrast given by (162). a \(y_1\,=\,10\,\hbox {km}\). b \(y_2\,=\,11\hbox { km}\). c \(y_3\,=\,12,5\hbox { km}\). d \(y_4\,=\,15\hbox { km}\)

Fig. 6
figure 6

Differences \(\Delta\) between the analytical and numerical values plotted in Fig. 5. a \(y_1=10\hbox { km}\). b \(y_2=11\hbox { km}\). c \(y_3=12,5\hbox { km}\). d \(y_4=15\hbox { km}\)

To give a quick overlook of the symmetric nature of the solution with respect to the planes \(x=15\) km and \(y=15\) km, we report in Fig. 7a the contour plot of the gravity anomaly at \(z=0\). The surface distribution of the gravity anomaly becomes unsymmetric, as shown in Fig. 7b, by considering a density contrast depending upon an a horizontal direction such as the expression considered in Zhou (2009b)

$$\begin{aligned} \Delta \rho (z) = -747.7 + 203.435z - 26.764 z^2 + 1.4247z^3 -23.205 x\,. \end{aligned}$$
(164)

To emphasize the dependence of the solution upon the monomials appearing in the expression of the density contrast, we plot in Fig. 8a, b the surface distribution of the gravity anomaly for the density contrast

$$\begin{aligned}& \Delta \rho (z) = -747.7 + 203.435z - 26.764 z^2 + 1.4247z^3 -23.205 y\,, \end{aligned}$$
(165)
$$\begin{aligned}& \Delta \rho (z) = -747.7 + 203.435z - 26.764 z^2 + 1.4247z^3 -23.205 x - 23.205 y. \end{aligned}$$
(166)
Fig. 7
figure 7

Gravity anomaly distribution at z = 0 associated with the prism \(\varOmega \equiv [10,\,20]\times [10,\,20]\times [0,\,8]\) (dimensions in kilometers) and density contrast given by (162) (on the left) and (164) (on the right). a Density contrast as in (162). b Density contrast as in (164)

It is apparent from the last two plots that the gravity anomaly vanishes less rapidly than in Fig. 7a.

Fig. 8
figure 8

Gravity anomaly distribution at z = 0 associated with the prism \(\varOmega \equiv [10,\,20]\times [10,\,20]\times [0,\,8]\) (dimensions in kilometers) and density contrast given by (165) (on the left) and (166) (on the right). a Density contrast as in (165). b Density contrast as in (166)

Table 1 Gravity anomaly (mGal) associated with prism \(\varOmega \equiv [10,\,20]\times [10,\,20]\times [0,\,8]\) (dimensions in kilometers and density contrast (162)) at several locations; a) analytical values; b) numerical values. Computing Time (CT) in seconds

6 Conclusions

The gravity anomaly at arbitrary points induced by a polyhedral body of arbitrary shape and characterized by polynomial density contrast has been obtained in closed form. It is expressed as the sum of quantities that depend only upon the 3D coordinates of the vertices of the polyhedron and upon the parameters defining the density contrast. The solution procedure, based upon a generalized application of Gauss’ theorem, takes consistently into account the singularity intrinsic to the integrals to be evaluated. In particular, by means of rigorous mathematical arguments, singularities are proved to give no contribution both to the analytical expression of the gravity anomaly and to its algebraic counterpart.

The formulation presented in the paper has been limited to a polynomial density contrast varying with a cubic law as a maximum, but it can be easily extended to polynomials of higher degree. The effectiveness of the proposed approach has been intensively tested by numerical comparisons, carried out by means of a Matlab code, with several examples derived from the specialized literature. Future contributions will concern the cases of density contrast variable with exponential law for 2D and 3D domains.