<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Performance-E ective Algorithm for Solving Large-Scale Forward Gravity Problem for Elliptical Ob jects</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Petr S. Martyshko</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Igor V. Ladovskii</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Denis D. Byzov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alexander I. Chernoskutov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Bulashevich Institute of Geophysics, Ural branch of Russian Academy of Sciences</institution>
          ,
          <addr-line>Yekaterinburg</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Yeltsin Ural Federal University</institution>
          ,
          <addr-line>Yekaterinburg</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <fpage>96</fpage>
      <lpage>102</lpage>
      <abstract>
        <p>In this paper we purpose a performance-e ective algorithm for solving forward gravity problem for elliptical objects. The algorithm is subject to parallel computations, it was implemented and tested with the CUDA technology. In general, the suggested method can be applied to density distribution models of arbitrary geometry that can be triangulated.</p>
      </abstract>
      <kwd-group>
        <kwd>computational geophysics</kwd>
        <kwd>potential elds</kwd>
        <kwd>gravity eld</kwd>
        <kwd>spherical Earth crust models</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>(p)dVp
where is the gravitational constant, dVp is a volume element of integration, nq
is the outer normal to S in the orthogonal projection of the point q to S, r and
r0 are the radius vectors of the points p and q, respectively.</p>
      <p>Assume the ellipsoid of rotation for our spherical model D has equatorial
and polar radii equal to a and b. The position of the point on the surface of the
ellipsoid of rotation is uniquely de ned by the geodesic latitude B 2 [ =2; =2]
and the longitude L 2 ( ; ] (except for the \poles", where longitude is not
de ned). As a third coordinate H we employ the distance between the given
point and the ellipsoid surface; it has a plus sign if the point lies outside the
ellipsoid, and the minus sign if the point lies inside it. Position of the given point
in space is uniquely de ned by three values: (L; B; H), where H &gt; N (1 e2),
e = pa2 b2=a (the eccentricity of the ellipsoid), and N = a=p1 e2 sin2 B.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Gravity eld of a spherical model</title>
      <p>Assume Di;j;k is a descrete element of D and the density of a descrete element
be a constant i;j;k. Then the eld g at point q generated by D is equals to
where Gi;j;k(q) is the eld at the point q of Di;j;k up to a coe cient . In order to
calculate Gi;j;k(q), we introduce in the space of a spherical model a rectangular
Cartesian coordinate system O0x0y0z0. The center O0 coincides with the center of
the ellipsoid, O0z0 axis is ellipsoid's axis of rotation and directed from the \south
pole" to the \north" (i.e. when B = =2, then z0 &gt; 0), the O0x0 axis points to
(0; 0; 0) in (L; B; H), the axis O0y0 complements the system to the right-handed
and
axis set. Equations for transition from (L; B; H) to O0x0y0z0 are then as follows:
8x0
&gt;
&lt;</p>
      <p>y0
&gt;:z0
= (N + H) cos B cos L
= (N + H) cos B sin L
= (N (1 e2) + H) sin B</p>
      <p>;
0cos B cos L1
n = @cos B sin LA ;</p>
      <p>sin B
where n is a unit vector of the external normal to the ellipsoid at the point
(L; B; 0).</p>
      <p>
        Integral (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) for the Gi;j;k(q) eld can not be expressed analytically. It is also
problematic to calculate in numerically (with the help of the cubature formulas),
since the boundaries of Di;j;k usually have a very complex description in the
(L; B; H) or (x0; y0; z0) coordinate system and, in order to achieve acceptable
accuracy, a large number of nodes is required [1, 6]. Therefore, we propose to
calculate integral (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) not for Di;j;k, but for the polyhedron of approximation
^
Di;j;k formed by the triangulation of Di;j;k. Thereby,
      </p>
      <p>Gi;j;k(q)</p>
      <p>G^i;j;k(q) =
(p)dVp
:</p>
      <p>
        In formula (
        <xref ref-type="bibr" rid="ref5">5</xref>
        ), we proceed to integration over the surface, using the
Ostrogradsky theorem
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        )
(
        <xref ref-type="bibr" rid="ref4">4</xref>
        )
(
        <xref ref-type="bibr" rid="ref5">5</xref>
        )
(
        <xref ref-type="bibr" rid="ref6">6</xref>
        )
G^i;j;k(q) =
nq;
      </p>
      <p>Z</p>
      <p>D^i;j;k
rp jr
1
r0j</p>
      <p>!
dVp
=
nq;</p>
      <p>I</p>
      <p>Next, we divide the surface integral into parts along the faces of D^ i;j;k and
take into account that the outer normal np at the integration point is constant
for each face</p>
      <p>G^i;j;k(q) =</p>
      <p>X
Si12S(D^i;j;k)
(nq; ni1)</p>
      <p>Z</p>
      <p>Si1 jr
dS
r0j
;
for the integral RSi1 jr
where ni1 is the outer normal to the face Si1. Now we need to acquire a formula
dS</p>
      <p>over a triangle (which is the gravitational potential
r0j
of a triangle with a unit surface density without coe cient). Let ri (i = 1; 2; 3)
be the radius vector of the vertices of the triangle hp1; p2; p3i; q is the eld
computation point; ai = ri r0; a(j;i) = ai aj = ri rj ; N = a(i 1;i) a(i;i+1)
is the normal to the plane of the triangle with a length equal to its doubled area;
n = N=jNj is the unit normal to the plane of the triangle; A(j;i) = a(j;i)=ja(j;i)j;
(ai n) is the distance from the point q to the plane of the triangle (with the
appropriate sign). Then</p>
      <p>Z</p>
      <p>
        dS
+ X3 [ai 1; ai] arctanh
1. for each element Di;j;k using coordinates transformation (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ), obtain the set
of faces S(D^ i;j;k) of the approximating polyhedron D^ i;j;k (in the Cartesian
system O0x0y0z0);
2. with the help of formulas (
        <xref ref-type="bibr" rid="ref6">6</xref>
        ), (7) calculate the vertical component of the
^ ^
eld Gi;j;k(q) for the polyhedron Di;j;k at the point q, the normal vector
n(q) is calculated by formula (
        <xref ref-type="bibr" rid="ref4">4</xref>
        );
3. assume Gi;j;k(q) G^i;j;k(q) and by eld summation of each D^ i;j;k (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) acquire
g(q).
+
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>Implementation</title>
      <p>In the presented algorithm, computation of formula (7) is taking most of the
time of the running program. Indeed, in order to calculate the eld of body that
consists of Nb discrete elements in Nf points of space, the expression should be
calculated N = kNbNf times, where k is the amount of triangles in one element
of the body. In practice, N is of order of 1015 for high-resolution Earth crust
models (with surface area of order 1000 1000km and depth of 100km).
Without using contemporary parallel technologies such computations would become
senseless since it would take months or even years to run. Hence, our goal is to
utilize most powerful computational devices available, which are GPUs.</p>
      <p>Here, we assume that all the preprocessing steps have been done and as our
input we have a set of triangles T (represented by triplets of points in space)
that has been obtained as a result of triangulation of the discrete elements of
the body. Additionally, we have a set of points Q, in which we want to calculate
the normal component (or a vector) of gravitational eld of the body. We are
not going into details of this step because its computational complexity does not
depend on Nf ; thus, its becoming insigni cant for large values of Nf .</p>
      <p>The eld computation requires minimum two nested cycles through Q and T .
The iterations of the outer loop (over Q) are mutually independent and can be
split between di erent computing nodes or/and GPUs. The inner loop (over T )
can be expressed using map-reduce pattern: gq = reduce(mapq(T )), where g is
the resulting gravitational eld vector the at the point q. The trick is that those
operations are implemented with high e ciency in the CUDA Thrust library [5]
in the form of a single function: thrust::transform reduce(). All we were left to
do is to implement formula (7) and pass it as a parameter.</p>
    </sec>
    <sec id="sec-4">
      <title>Performance tests</title>
      <p>All the tests have been performed using two regional Earth crust models that
have been previously reconstructed in Bulashevich Institute of Geophysics (Ural
Branch of Russian Academy of Sciences) as a result of solving inverse
gravity problem [2{4]. Test models characteristics are shown in Table 1. Krasovsky
Ellipsoid is taken as the reference one.</p>
      <p>Comparison of our most resent CPU available (i7-6900K 8 physical cores @
3.2GHz) and our oldest GPU (GeForce GTX TITAN Black) showed that GPU
outperforms CPU from 15 to 20 times even for considerably small workloads
(Workload 1). So, future tests were conducted using only the GPUs.</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgments</title>
      <p>This work was partly supported by the Center of Excellence \Geoinformation
technologies and geophisical data complex interpretation" of the Ural Federal
University Program and by the The Russian Foundation for Fundamental
Research (project 17-05-00916 ).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Heck</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Seitz</surname>
            ,
            <given-names>K. A.</given-names>
          </string-name>
          :
          <article-title>Comparison of the tesseroid, prism and point-mass approaches for mass reductions in gravity eld modelling</article-title>
          .
          <source>Journal of Geodesy</source>
          .
          <volume>81</volume>
          ,
          <issue>121</issue>
          {
          <fpage>136</fpage>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Ladovskii</surname>
            ,
            <given-names>I. V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Martyshko</surname>
            ,
            <given-names>P. S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Byzov</surname>
            ,
            <given-names>D. D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kolmogorova</surname>
            ,
            <given-names>V. V.</given-names>
          </string-name>
          :
          <article-title>On Selecting the Excess Density in Gravity Modeling of Inhomogeneous Media</article-title>
          .
          <source>Izvestiya, Physics of the Solid Earth</source>
          , Vol.
          <volume>53</volume>
          , No.
          <volume>1</volume>
          ,
          <fpage>130</fpage>
          -
          <lpage>139</lpage>
          (
          <year>2017</year>
          ) https://doi.org/10. 1134/S1069351316060057
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Martyshko</surname>
            ,
            <given-names>P. S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ladovskii</surname>
            ,
            <given-names>I. V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fedorova</surname>
            ,
            <given-names>N. V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Byzov</surname>
            ,
            <given-names>D. D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tsidaev</surname>
            ,
            <given-names>A. G.</given-names>
          </string-name>
          :
          <article-title>Theory and methods of complex interpretation of geophysical data</article-title>
          .
          <source>Yekaterinburg: Ural Department of Russian Academy of Sciences</source>
          ,
          <year>94p</year>
          . (
          <year>2016</year>
          ).
          <source>ISBN 978-5-7691- 2463-1.</source>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Martyshko</surname>
            ,
            <given-names>P. S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Byzov</surname>
            ,
            <given-names>D. D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ladovskii</surname>
            ,
            <given-names>I. V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tsidaev</surname>
            ,
            <given-names>A. G.</given-names>
          </string-name>
          :
          <article-title>3D density models construction method for layered media</article-title>
          .
          <source>15th International Multidisciplinary Scienti c GeoConference SGEM</source>
          <year>2015</year>
          ,
          <article-title>www</article-title>
          .
          <source>sgem.org, SGEM2015 Conference Proceedings, Albena. Bulgaria. Book 2</source>
          Vol.
          <volume>1</volume>
          ,
          <issue>425</issue>
          {
          <fpage>432</fpage>
          (
          <year>2015</year>
          ) https: //doi.org/10.5593/SGEM2015/B21/S8.053
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>NVIDIA</given-names>
            <surname>CUDA Toolkit</surname>
          </string-name>
          <article-title>Documentation</article-title>
          . Trust.: http://docs.nvidia.com/cuda/ thrust/index.html
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Wild-Pfei er</surname>
          </string-name>
          , F.,
          <string-name>
            <surname>Augustin</surname>
            , W. und Heck,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>Optimierung der Rechenzeit bei der Berechnung der 2. Ableitungen des Gravitationspotentials von Massenelementen</article-title>
          . Zeitschrift fur Geodasie. №
          <volume>6</volume>
          (
          <issue>132</issue>
          ),
          <volume>377</volume>
          {
          <fpage>384</fpage>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>