Skip to content

Commit

Permalink
feedback round 2
Browse files Browse the repository at this point in the history
  • Loading branch information
schuhmaj committed Sep 12, 2023
1 parent b3d70aa commit cfec788
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
21 changes: 19 additions & 2 deletions paper/paper.bib
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ @article{izzo2022geodesy
publisher={Nature Publishing Group UK London}
}

@inproceedings{GeodesyNetsBenchmark,
@inproceedings{schuhmacher2023investigation,
title={Investigation of the Robustness of Neural Density Fields},
author={Jonas Schuhmacher and Fabio Gratl and Dario Izzo and Pablo G{\'o}mez},
booktitle={Proceedings of the 12th International Conference on Guidance, Navigation \& Control Systems (GNC)},
Expand All @@ -61,7 +61,6 @@ @TechReport{schuhmacher2022efficient
author={Schuhmacher, Jonas},
year={2022},
institution={Technische Universität München},
note = {\url{https://github.com/esa/polyhedral-gravity-model} last accessed: 26.05.2023}
}

@article{tsoulis2001singularities,
Expand Down Expand Up @@ -95,3 +94,21 @@ @article{hang2015tetgen
year={2015}
}

@inproceedings{wittick2017mascon,
title={Mascon models for small body gravity fields},
author={Wittick, Patrick T and Russell, Ryan P},
booktitle={AAS/AIAA Astrodynamics Specialist Conference},
volume={162},
pages={17--162},
year={2017}
}

@article{vsprlak2021use,
title={On the use of spherical harmonic series inside the minimum Brillouin sphere: Theoretical review and evaluation by GRAIL and LOLA satellite data},
author={{\v{S}}prl{\'a}k, Michal and Han, Shin-Chan},
journal={Earth-Science Reviews},
volume={222},
pages={103739},
year={2021},
publisher={Elsevier}
}
17 changes: 11 additions & 6 deletions paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,28 @@ bibliography: paper.bib

# Summary

Polyhedral gravity models are essential for modeling the gravitational field of irregular bodies, such as asteroids and comets. We present an open-source C++ library for the efficient, parallelized computation of a polyhedral gravity model following the line integral approach by Tsoulis [@tsoulis2012analytical]. A slim, easy-to-use Python interface using *pybind11* accompanies the library. The library is particularly focused on delivering high performance and scalability, which we achieve through vectorization and parallelization with *xsimd* and *thrust*, respectively. The library supports many common formats, such as *.stl*, *.off*, *.ply*, *.mesh* and *tetgen*'s *.node* and *.face* [@hang2015tetgen].
Polyhedral gravity models are essential for modeling the gravitational field of irregular bodies, such as asteroids and comets.
We present an open-source C++ library for the efficient, parallelized computation of a polyhedral gravity model following the line integral approach by Tsoulis [@tsoulis2012analytical]. A slim, easy-to-use Python interface using *pybind11* accompanies the library. The library is particularly focused on delivering high performance and scalability, which we achieve through vectorization and parallelization with *xsimd* and *thrust*, respectively. The library supports many common formats, such as *.stl*, *.off*, *.ply*, *.mesh* and *tetgen*'s *.node* and *.face* [@hang2015tetgen] and is straightforward in its application.

# Statement of Need

The complex gravitational fields of irregular bodies, such as asteroids and comets, are often modeled using polyhedral gravity models as they provide an analytic solution for the computation of the gravitational potential, acceleration (and second derivative) given a mesh of the body [@tsoulis2012analytical;@tsoulis2021computational]. The computation of the gravitational potential and acceleration is a computationally expensive task, especially for large meshes, which can however benefit from parallelization either over computed target points for which we seek potential and acceleration or over the mesh. Thus, a high-performance implementation of a polyhedral gravity model is desirable.
The complex gravitational fields of irregular bodies, such as asteroids and comets, are often modeled using polyhedral gravity models as alternative approaches like mascon models or spherical harmonics struggle with these bodies' irregular geometry. The former struggles with convergence close to the surface [@vsprlak2021use], whereas the latter requires a computationally expensive amount of mascons (point masses) to model fine-granular surface geometry [@wittick2017mascon].

In contrast, polyhedral gravity models provide an analytic solution for the computation of the gravitational potential, acceleration (and second derivative) given a mesh of the body [@tsoulis2012analytical;@tsoulis2021computational] with the only assumption of homogeneous density.
The computation of the gravitational potential and acceleration is a computationally expensive task, especially for large meshes, which can however benefit from parallelization either over computed target points for which we seek potential and acceleration or over the mesh. Thus, a high-performance implementation of a polyhedral gravity model is desirable.

While some research code for these models exists, they are not focused on usability and are limited to FORTRAN\footnote{\url{https://software.seg.org/2012/0001/index.html}} and proprietary software like MATLAB\footnote{\url{https://github.com/Gavriilidou/GPolyhedron}}. There is a lack of well-documented, actively maintained open-source implementations, particularly in modern programming languages, and with a focus on scalability and performance.

The presented software has already seen application in several research works. It has been used to optimize trajectories around the highly irregular comet 67P/Churyumov-Gerasimenko [@marak2023trajectory]. Further, it has been used to study the effectiveness of so-called neural density fields [@izzo2022geodesy], where it can serve as ground truth and to pre-train neural networks [@GeodesyNetsBenchmark]. **TODO_add_more_examples**
The presented software has already seen application in several research works. It has been used to optimize trajectories around the highly irregular comet 67P/Churyumov-Gerasimenko with the goal of maximizing the gravity signal using a genetic optimization algorithm of pygmo [@marak2023trajectory]. In the context of that work, the presented solution was extended to enable caching and even serialization to persistent memory.
Further, it has been used to study the effectiveness of so-called neural density fields [@izzo2022geodesy], where it served as ground truth to (pre-)train neural networks representing the density distribution of an arbitrarily shaped body [@schuhmacher2023investigation].

Thus, overall, this model is highly versatile due to its easy-to-use API and can be used in a wide range of applications. We hope it will enable further research in the field, especially related to recent machine-learning techniques, which typically rely on Python implementations.
Thus, this model is highly versatile overall due to its easy-to-use API and can be used in a wide range of applications. We hope it will enable further research in the field, especially related to recent machine-learning techniques, which typically rely on Python implementations.

# Polyhedral Model

On a mathematical level, the implemented model follows the approach by Petrović [@petrovic1996determination] as refined by Tsoulis and Petrović [@tsoulis2001singularities]. A comprehensive description of the mathematical foundations of the model is given in the associated student report [@schuhmacher2022efficient].
On a mathematical level, the implemented model follows the line integral approach by Petrović [@petrovic1996determination] as refined by Tsoulis and Petrović [@tsoulis2001singularities]. The associated student report gives a comprehensive description of the mathematical foundations of the model and how the gravitational triple integral is resolved to a double summation over the faces and line segments of a polyhedron [@schuhmacher2022efficient].

Implementation-wise, it makes use of the inherent parallelization opportunity of the approach as it iterates over the mesh. This parallelization is achieved via *thrust*, which allows utilizing *OpenMP* and *Intel TBB*. On a finer scale, individual, costly operations have been investigated, and, e.g., the \texttt{arctan} operations have been vectorized using *xsimd*. On the application side, the user can choose between the functional interface for evaluating the full gravity tensor or the object-oriented \texttt{GravityEvaluable}, providing the same functionality while implementing a caching mechanism to avoid recomputing mesh properties that can be shared between multipoint evaluation, such as the face normals.
Implementation-wise, it makes use of the inherent parallelization opportunity of the approach as it iterates over the mesh elements. This parallelization is achieved via *thrust*, which allows utilizing *OpenMP* and *Intel TBB*. On a finer scale, individual, costly operations have been investigated, and, e.g., the \texttt{arctan} operations have been vectorized using *xsimd*. On the application side, the user can choose between the functional interface for evaluating the full gravity tensor or the object-oriented \texttt{GravityEvaluable}, providing the same functionality while implementing a caching mechanism to avoid recomputing mesh properties that can be shared between multipoint evaluation, such as the face normals.

Extensive tests using GoogleTest for the C++ side and pytest for the Python interface are employed via GitHub Actions to ensure the (continued) correctness of the implementation.

Expand Down

0 comments on commit cfec788

Please sign in to comment.